This is a back end E-commerce app which works with Express.js API and use Sequelize to interact with a MySQL database.
As a manager at an internet retail company, user wants a back end for their e-commerce website that uses the latest technologies, so that their company can compete with other e-commerce companies.
- About the Project
- Project Links
- Demo
- Installation
- Contribution Guidelines
- Project Team
- Questions
- License
Given a functional Express.js API:
- When user add their database name, MySQL username, and MySQL password to an environment variable file, then they are able to connect to a database using Sequelize.
- When user enter schema and seed commands, then a development database is created and is seeded with test data.
- When user enter the command to invoke the application, then their server is started and the Sequelize models are synced to the MySQL database.
- When user open API GET routes in Insomnia for categories, products, or tags, then the data for each of these routes is displayed in a formatted JSON.
- When user test API POST, PUT, and DELETE routes in Insomnia, then user is able to successfully create, update, and delete data in my database.
git clone https://github.com/SepidehAyani/orm_e-commerce.git
In the root directory of the project, run 'npm i' to download the dependencies.
Initiate the database with 'mysql -u root -p'.
To create tables, run 'source db/schema.sql'.
Exit the mysql terminal, and run 'npm run seed' to insert data into the tables.
Run 'npm start' to start your server.
Make sure to add a .env file to the root of the app with the following details:
DB_NAME='ecommerce_db'
DB_USER='user'
DB_PW='xxx'
Note: follow this to install MySql and setup your own username & password
Feel free to contribute to this repo by creating issues or sending an email to sepid.ayani@gmail.com