- create user 'shopit'@'localhost' identified by 'shopit';
- grant grant all privileges on * . * to 'shopit'@'localhost';
- flush privileges;
-
Log in using
mysql -u shopit -p
-
Password is : shopit
-
Add following tables
CREATE TABLE `Item` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `photo` varchar(255) NOT NULL, `price` int(11) NOT NULL, `seller` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name_fk` (`name`,`seller`), KEY `seller` (`seller`), CONSTRAINT `Item_ibfk_1` FOREIGN KEY (`seller`) REFERENCES `User` (`id`) )
CREATE TABLE `User` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(255) NOT NULL, `last_name` varchar(255) NOT NULL, `address` varchar(255) NOT NULL, `contact_no` varchar(255) NOT NULL, `user_type` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), UNIQUE KEY `email` (`email`) )
CREATE TABLE `CartItem` ( `id` int(11) NOT NULL AUTO_INCREMENT, `item` int(11) NOT NULL, `buyer` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unique_item` (`item`,`buyer`) )
CREATE TABLE `Order` ( `id` int(11) NOT NULL AUTO_INCREMENT, `buyer` int(11) NOT NULL, `date` date NOT NULL, `address` varchar(255) NOT NULL, PRIMARY KEY (`id`), KEY `buyer` (`buyer`), CONSTRAINT `Order_ibfk_1` FOREIGN KEY (`buyer`) REFERENCES `User` (`id`) )
CREATE TABLE `OrderItem` ( `id` int(11) NOT NULL AUTO_INCREMENT, `item` int(11) NOT NULL, `name` varchar(255) NOT NULL, `seller` int(11) NOT NULL, `order` int(11) NOT NULL, `status` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `item` (`item`), KEY `order` (`order`), KEY `seller` (`seller`), KEY `name` (`name`), CONSTRAINT `OrderItem_ibfk_5` FOREIGN KEY (`name`) REFERENCES `Item` (`name`), CONSTRAINT `OrderItem_ibfk_2` FOREIGN KEY (`item`) REFERENCES `Item` (`id`), CONSTRAINT `OrderItem_ibfk_3` FOREIGN KEY (`order`) REFERENCES `Order` (`id`), CONSTRAINT `OrderItem_ibfk_4` FOREIGN KEY (`seller`) REFERENCES `User` (`id`) )
npm install
installes the node_modulesPORT='<Port number>' nodejs server.js
- Go to url
localhost:<Port number>/catalogue
If you have questions about how to use PyMail, please open an issue with the concerned question.
If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an issue to our GitHub Repository. Even better you can submit a Pull Request with a fix.
You can request a new feature by submitting an issue to our GitHub Repository. If you would like to implement a new feature then Contact us through email.