Project Setup
How to get started with using fashionshop backend api endpoint.
Get the project from Github
clone the project from github on to your computer.
Software Requirements - Before Setup the project
MySQL installed on your computer
Node.JS installed on your computer
Any IDE of your choice
Project Setup - Before running the Software
We have to perform a series of installation and preparation of the system before we start using the software.
1.Navigate into the folder directory "fashionshop_backend" and start a terminal or command line on the directory.
2.Ensure that you have Node.js installed on your computer. It is recommended that you use Node.js version 12.xx as this was the Node.js which was used to setup the project.
The project can run on other versions but have not be extensively verified to have break in dependencies and version 12.xx is the one used for the development of the project. Click here to navigate to the "install node version manager" page(link will not open in new tab)
3. Navigate to the root directory of the project and run the command below.
This will install all project required dependencies. You have to do this step first, otherwise the next steps require the project dependencies.
4. Navigate into the config directory and open "default.js" file on the terminal or IDE.
Directory path: config/
File Path: default.js
Change your username and password in this file to your own mysql username and password used on your computer
ensure the database fashionshop is not used throughout the project otherwise you may choose to change it here.
save the file before continuing with the other steps.
.ENV files can be used to replace username and password for greater security.
5. proceed to navigate into the database directory using the command line and run "insert_script.js" this will initialise the database.
Directory path: database/
File Path: insert_script.js
run the command below to create table product & insert 500 records into the table
Once the process is successful, the response image should look like as shown below.
terminate the command CTRL + C
This will delete any existing fashionshop database and re-create a new one then inserting the 500 records into the database. You may re-run this command again in the future to re-initalise the records again.
You have successfully setup the environment in order for you to run the fashionshop backend api project. Navigate to start the application to run the project.
Last updated
Was this helpful?