- Description
- Built With
- Installation Instructions
- Usage Instructions
- License Section
- How To Contribute
- Tests
- Contact Me
This project creates the back-end code for an e-commerce site. This application uses Express.js API and Sequelize to interact with a MySQL database. The database is created using mySQL with models and associations. The API Routes are created using RESTful CRUD methods displayed in my walk through videos. Since there is no front-end code, the application was tested using Insomnia.
- HTML
- CSS
- JavaScript
- MySQL
- Sequelize
- dotenv (to create the environmental variables)
- Insomnia (for testing)
Make sure that you have Node.js installed on your computer by entering node -v in the command line. If successful, the command prompt will return a version number. If not, try reinstalling Node.js by following this link: https://nodejs.org/en/ and clicking on the LTS version. If you are on Windows, make sure to look for the section that says Download for Windows (x64)
. If you are using macOS, make sure to look for the section that says Download for MacOS (x64)
Once Node.js is downloaded, click on the green code button and copy the link to this repository. Then open up your favorite code editor and open the terminal. In the terminal use cd
to go to the root directory you want this repository to be cloned to. Finally, in the terminal, type git clone <file link>
to clone this repository to your directory.
You must also install the Express.js, Sequelize, and MySQL2 npm packages to run the server. Since these are npm packages instead of being built directly into node.js, you must type npm i
into the command line to allow the npm packages to be installed.
To use this application follow the steps below.
-
To connect to the MySQL database, run
mySQL -u root -p
in the command line and enter your MySQL password. -
Run
source db/schema.sql
in the MySQL command line to populate the database and then typequit
to exit MySQL. -
Run
npm run seed
in the command line to seed the file. If the file was properly seeded, you should see something similar to the screenshot below.
![Seeded Code]
- Connect to the server by typing
npm start
in the command line. If the server connected successfully, you should see something similar to the screenshot below.
![Start Server]
- To test the application, follow the Screencastify videos below. For more information on Insomnia, follow this link: https://docs.insomnia.rest/.
-
For a walkthrough of MySQL and how to seed and start the server, watch this walkthrough:
-
For a walkthrough of how the routes work using Insomnia, watch this walkthrough:
Permission to use this application is granted under the MIT license. Click on the link for more information: MIT License Information
To contribute, refer to the installation instructions above.
There is no command for running these tests. To test the application, download insomnia and watch the Screencastify videos in the usage section to seed the data, start the application and test the routes in Insomnia. For more information on Insomnia, follow this link: https://docs.insomnia.rest/.
GitHub Link: (https://github.com/mmorua)
Email Address: [email protected]