A real time chat feature for a social e-commerce platform that involves exchange of user text messages, exchange of product thumbnail images by product code annotation and a selection cart to assist online buying.
-
Download all the php files and store them in a folder named "chatbox" and save it in "htdocs" folder of Xampp.
-
Install aws.phar file by following the steps given here and save it in your "chatbox" folder.
-
Create an AWS account and edit your credentials, i.e. the AWS_KEY and AWS_SECRET_KEY in the "core_users.php" file.
-
Download jquery-3.1.1 and store it in "chatbox" folder.
-
Download the security certificate "cacert.pem" and rename it to "curl-ca-bundle". Save it in "chatbox" folder.
-
Create four tables in DynamoDB as follows -
- Table 1 : Users (UserName (S), UserPassword (S), FriendList (NS), OnlineStatus (N), UserID (S)).
- Table 2 : Products(ProductCode (S), ProcductID (N), ProductLink (S), ProductName (S), ProductThumbnail (S)).
- Table 3 : Selection Cart(UsersId (S), DateAndTime (S), ProductCode (S), ProductLink (S), ProductName (S), ProductThumbnail (S)).
- Table 4 : Chats(UsersId (S), DateAndTime (S), Message (S), Sender (S)).
- Select the products you want to share in your chats from Amazon, Flipcart etc..
- Add their link to the "Products" table under "ProductLink".
- Store the product thumbnail images in a S3 bucket and add their S3 links generated to the "Products" table under "ProductThumbnail" attribute.
-
Example of an entry in Users Table : Angelina Jolie, angelinia824, { 12, 8, 7, 5, 4, 3, 19, 20, 2, 10, 18, 1 }, 0, 14
-
Example of an entry in Products Table : motoG12, 1, Amazon link, Moto G Plus Smartphone, "image link from S3"
Now you're good to go!
- Open Xampp and start Apache and MySQL
- Open Shell in Xampp and run the command "php -q c:/xampp/htdocs/chatbox/server.php".
- Finally, open "localhost/chatbox/login_users.php" in browser and you're good to go!