A demonstration of the back-end of an e-commerce site, using RESTful API routes to make requests and post updates to the database. The database includes 4 tables for; Categories, Products, Tags and Product Tags.
https://github.com/ViennaBorowska/eCommerce-Back-End
- config > connection.js = Sequelize/MySql configuration.
- db > schema.sql = file to initialise & use database.
- models > 4 x .js files = models for each table. index.js = table associations
- routes > index.js = file for defaulthome route '/', including error message & instructions.
...............> api > 3 x routes.js files = API request routes for each model. index.js = connecting & using routes with express. - seeds > 4 x seeds.js files = seed data for tables. index.js = links 4 seed files together to run as one command.
- .env file = environment variables for MySql credentials in config/connection.js
- package-lock.json - node modules tree visiblity
- package.json - node.js metadata
- README.md - project information
- server.js > starting server using Express & Sequelize
- Clone the GitHub repository by pasting the following in your command line:
git clone git@github.com:ViennaBorowska/eCommerce-Back-End.git
- Install required packages/dependencies by running
npm i
in terminal. - Add own credentials to .env file to configure MySQL
- Initialise the database in MySQL
- Seed the database by running
npm seed
. - Run the command
npm start
in the terminal to start the MySQL server. - API routes can now be accessed on the browser, or through a REST application e.g. Insomnia, Postman etc.
Once the above installation steps have been completed, the database can be used. Please see below walkthrough video demonstration.
This video is also available in Google Drive here
Contributions and improvements are always welcome. Please make your own branch and commit any changes for review. Do not push changes to the main branch.
If you have any questions about this projects, please contact me directly at viennabdev@gmail.com. You can view more of my projects at https://github.com/ViennaBorowska.
This README was compiled using my own README generator