I learnt how to represent games as a search problem, defining the starting states, rules, goal test, etc on games like othello, tic tac toe, using mini-max algorithm, alpha beta pruning when the branches of the search tree need not be considered. Also to deal with time limit on adversary search ,iterative deepening search is useful.
Learnt about differences between complete search and partial searching using examples like the TSP, how complete search doesn’t give the optimal solution but rather guarantees that if the goal exists ,the algorithm will reach the goal . The difference between local search and global search, that local search only consider the solutions in the neighborhood while global search considers all possible solutions , I also learnt genetic algorithms use natural selection.
I learnt different types of searching algorithms used by agents , DFS, BFS, A*, SSS, greedy search how they compare to each other and factors to consider when choosing which one you should use like completeness, time complexity, space complexity and optimality. I also learnt how to design a problem solving agent , the formulation of the goal, actions and representation of knowledge required.
I learnt that machine learning is a subset of AI, AI being broad covers a lot of aspects and is mostly defined by thinking rationally, acting rationally, thinking humanly, acting humanly, I also have an understanding of what an agent is, the various types , how they perceive the environment and also factors that describe the environment. So far I’m interested in just looking at everyday scenarios and trying to figure out what intelligent solution could be implemented to make tasks easier.
Our project is an online shop that sells makeup . The basic idea is that people can buy products without having to physically go to shops or malls and they can get other additional information like tutorials on how to use the products they buy without exhausting searches on google. Real life examples include Sephora, Ulta.
There are four different types of users that can access the system and they all have different interfaces specific to their needs.
Customers
They can browse through the products available in the shop, choose the products the want and make a purchase.
Influencer
They can browse through products , choose a product they want to promote and create tutorials and tips.
Brand Ambassador
They manage products specific to their brand, they can add new product as well as delete the product specified. They can also recommend tutorials for their products.
Admin
Manages all the users, products, brands, tutorials. Basically they can see all the data in the database .
Team Roles
Beauty Tatenda Tasara 2201849402
Designing the database and documentation
Michael Stanely Chinaza 2201853785
Database security and backend classes
Rachel Hera 2201841671
Designing user Interface
Isabella Virgin 2201808144
Managing queries and demo video
ERD
Relation Schema
Ambassador
ambassodorid→ brand
Ambassador(username,brand)
Attribute
datatype
Default
key
Reason
username
varchar
Not Null
primary/foreign
Uniquely identifies each user and therefore each ambassador
brand
int
Not Null
foreign
Every ambassador is specific to one brand
Brand
brandid→ {brandName}
Brand(brandid, brandName)
Attribute
datatype
Default
key
Reason
brandid
int
Not Null
primary
Unique for every brand and practical to use on queries(names can be too long
brandName
varchar
Not Null
Cart
cartid→ {productid,quantity,customerid}
Cart(cartid, productid, quantity, customerid)
Foreign Key productid references Product(productid) On Delete Cascade On Update Restrict
Attribute
datatype
default
key
Reason
cartid
int
Not null
primary
Uniquely identifies all rows
productid
int
Not null
foreign
To perform join queries with product table
quantity
int
Not null
customerid
varchar
Not null
foreign
Every item in the cart belongs to a specific customer
ordered
boolean
false
Category
categoryid→ categoryname
Category(categoryid, categoryname)
Attribute
datatype
default
key
Reason
categoryid
int
Not null
primary
Uniquely identifies each row
categoryname
varchar
Not null
CreditCard
cardnumber→ {nameOnCard,expiryDate}
CreditCard(cardNumber, expirydate, NameOnCard)
Attribute
datatype
default
key
Reason
cardnumber
varchar
Not null
primary
Unique in real life
expirydate
Date
Not null
Nameoncard
varchar
Not null
Customer
customerid→ creditCardNum
Customer(Username, cardnumber)
Foreign Key cardnumber references CreditCard(cardNumber) On Delete Cascade On Update Cascade
Foreign Key Username references Users(Username) On Delete Cascade On Update Restrict
Attribute
datatype
default
key
Reason
username
varchar
Not null
primary/foreign
Unique for every user hence also unique for every customer, a customer should be a user
cardnumber
varchar
Not null
foreign
Every customer has a card to make purchases
Influencer
influencerid→ {skinTone,TypeOfMakeup}
Influencer(username, skintone, typeOfMakeup)
Foreign Key username references users(username) On Delete Cascade On Update Restrict
Attribute
datatype
default
key
Reason
username
varchar
Not null
primary/foreign
Uniqely defines each role,Influencer is a user
skintone
varchar
null
typeOfmakeup
varchar
null
Order
orderid→ {cartid,creditCardNumber}
Orders(orderid, customerid, cardnumber, Date)
Foreign Key customerid references customers (username) On Delete Cascade On Update Restrict
Foreign Key cardnumber references creditcard(cardnumber) On Delete Cascade On Update Cascade
Foreign Key influencerId references influencer(username) On Delete Cascade On Update Restrict
Foreign Key productid references Product(productid) On Delete Cascade On Update Restrict
Attribute
datatype
default
key
Reason
tutorialid
int
Not null
primary
Unique for each tutorial
productid
int
Not null
foreign
Each tutorial is for one product
influencerid
varchar
Not null
foreign
Influencer makes the tutorial
VideoUrl
varchar
Not null
Tips
varchar
No Tips
Recommended
boolean
false
Users
username → {firstname,lastname,password,role}
Attribute
datatype
default
key
Reason
firstname
varchar
Not null
lastname
varchar
Not null
username
varchar
Not null
primary
Uniquely identifies each role and similar to real life
isAdmin
boolean
0
isInfluencer
boolean
0
isAmbassador
boolean
0
isCustomer
boolean
0
Sample Queries
To show subtotal in the Cart
SELECT SUM(PRODUCT.PRODUCTPRICE* CART.QUANTITY ) AS TOTAL FROM CART INNER JOIN PRODUCT ON CART.PRODUCTID= PRODUCT.PRODUCTID AND CART.CUSTOMERID = ‘”+currentUserId+”‘”;
To show Cart items of the customer
SELECT * FROM CART INNER JOIN PRODUCT ON CART.PRODUCTID= PRODUCT.PRODUCTID AND CART.CUSTOMERID = ‘”+currentUserId+”‘”
To insert Products into Product Table
“INSERT INTO PRODUCT(BRAND,PRODUCTID,PRODUCTNAME,PRODUCTPRICE,CATEGORY) VALUES(?,?,?,?,?)”
To delete Users by userid perfomed by admin
“DELETE FROM USERS WHERE USERNAME='”+userid+”‘”
To insert tutorials into Tutorials table
“INSERT INTO TUTORIALS(TUTORIALID,PRODUCTID,URL,TIPS,INFLUENCERID) VALUES(?,?,?,?,?)”
Security
Our system uses traditional authentication of password and username.If the user enters credentials conforming to the admin then they will be directed to the admin page else there will be directed to their respective pages depending on their roles.
User Interface
Register as a new user form.
INSERT INTO USERS(FIRSTNAME,LASTNAME,USERNAME,PASSWORD,ISADMIN,ISCUSTOMER,
With the increase in demand of beauty products, many companies are looking to sell their products online which provides a faster way to get what you want without going to the store. To make this experience efficient we proposed to make a database which stores all the important information in making the shopping experience more efficient. Our database will contain information of the products in the shop, the brand ambassadors, influencers, customers and will also manage the privileges of users.
We chose to use database instead of traditional file system because the data is related hence more efficient to use database. The data will be structured and stored in well defined required formats. Using SQL queries will also be an advantage to the integrated system.
Memcached is a free open source high performance multithreaded event-based key-value cache store intended to be used in a distributed system. It was first developed by Bradley Joseph Fitzpatrick for his website LiveJournal, it was originally written in Perl then later rewritten in C by Anatoly Vorobey then employed by LiveJournal. Memcached today is used by many systems including Facebook, Pinterest, Twitter, Reddit, Wikipedia , Microsoft Azure etc.Link to website https://www.memcached.org/