A backend for an e-commerce website.
The purpose of this application is to create a back end for an e-commerce site using ExpressJS to create an API and configure it using Sequelize to interact with the MySQL database.
The application is a backend application that can do the following:
- Use a .env file to store the database name, MySQL username and MySQL password
- The application can use these environment variables to connect to the db
- A development database can be created using schema and seed commands
- Open API GET routes in Insomnia core to get the data for categories, products or tags
- POST, PUT and DELETE routes will perform CRUD operations on the db
AS A manager at an internet retail company I WANT a back end for my e-commerce website that uses the latest technologies SO THAT my company can compete with other e-commerce companies
The big take away from this project was learning how to use sequelize to create a model and link to a db with a config folder.
Other things I learned:
- Furthered my understanding of NPM scripts
- How to use environment variables
- Become more familiar with REST API's
In order to install this backend e-commerce app and test it you need to follow these steps.
-
Ensure that you have node and npm installed
-
For detailed instructions on installing node please follow this link for instructions
-
Ensure that you have mySQL installed
-
Clone this repository into your local repository.
git clone git@github.com:TheInfamousGrim/orm-e-commerce-back-end.git
.
-
Install the dependencies to your package.json
npm install
-
Login in to mySQL CLI
mysql -u root -p
enter your password when prompted (It should be blank by default)
-
create the database locally using
source schema.sql
(Make sure the path is correct e.g. you're in the db directory) -
log off by typing and entering
quit
-
seed the database
npm run seed
-
Use the .env.EXAMPLE file to construct your own .env file and save that in the root of your develope folder.
If you've followed these steps correctly then the application should be good to go and can be tested using software like Insomnia Core 😁
For a video of how to test the application please follow this link
Written instructions:
- run the application with
npm run start
- test the application using software like Insomnia Core
The technology used for the development of this app was:
dev-dependencies:
dependencies:
- Use environment variables to login to a development database
- Seed the database using a npm script
- Perform CRUD operations using API
🙏 Made with the help of:
I'm open to have anyone jump in and contribute just message me on twitter
Any feedback please email George Fincher
GitHub: TheInfamousGrim
Twitter: GrimFunk