MY SHOP is a Restful API that is functional for an online shop. Users can see products, filter them by category, price and name, as well as add products to the shopping cart and place orders. You can also log in as an admin, who can manage the web app, adding categories and products, as well as deleting and updating them, and managing users and customers.
The front-end repository for this project can be found at: https://github.com/williamscch/myshop-client
- Node.js
- Express
- PostgreSQL
- Docker
- JWT
- Joi
- Sequelize
- Passport
- Bcrypt
To run this project locally, you will need:
- Node.js v14 or later
- Docker
- Postgres
- Clone the repository from GitHub:
git clone https://github.com/williamsch/myshop.git
- Install all dependencies:
npm install
- Set up the database with Docker:
docker-compose up postgres
- Run the migrations:
npx sequelize-cli db:migrate
- Use the seed file to populate the database: (currently can be done just once because we are not tracking the seeds migrations and some duplicated values will not be allowed, so take care)
npx sequelize-cli db:seed:all
-
Copy the environment variables specified in the
.env.examplefile and create a new.envfile in the root directory of the project. Make sure to set theNODE_ENVvariable todevelopment. -
Start the development server:
npm run dev
The app will now be running on http://localhost:3050.
- IMPORTANT: There are 2 pre created users after you run the seeds:
-
Admin User: "admin@email.com" password:"admin1234" (You can not create more admin users from the client interface, so it is important to keep this one)
-
Customer User: "david@email.com" password: "user1234" (YOu can create more customers from the client interface, this is just for testing purposes)
The API endpoints are documented in the API.md file.
Williams Colmenares
- [Swagger Documentation]
- [JWT Refresh]
- [Pagination]
- [Deployment]
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
This project is MIT licensed.