- user authentication (jwt)
- email verification
- user address
- categories
- products
- email verification
- cart
- orders
- payment
i know that mongodb is not a relational database but i made it like this to make it easy to understand
- Clone the repo
- run
./start.sh
this will start docker container for mongodb and the nodejs server - open
http://localhost:3000/ecommerce/v1/api-docs/
to see the swagger documentation - to run seed data run
./runseeds.sh
this will create a user and some categories and products in mongodb
API_URL=/ecommerce/v1
<!-- the base url for the api -->
IP=0.0.0.0
<!-- the ip for the server -->
PORT=3000
<!-- the port for the server -->
secret=secrte
<!-- the secret for jwt -->
User=6ad3f083f82509
<!-- the user for mailtrap -->
Pass=216d5fd895c179
<!-- the password for mailtrap -->
EMAIL=test@gmail.com
<!-- the email for mailtrap -->
In this project i used morgan to log the requests as well as presistent logging in server.log file with details formated
172.20.0.1 - - [20/Dec/2023:23:14:22 +0000] "GET /ecommerce/v1/api-docs/favicon-32x32.png HTTP/1.1" 304 - "http://localhost:3000/ecommerce/v1/api-docs/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
172.20.0.1 - - [20/Dec/2023:23:14:41 +0000] "DELETE /ecommerce/v1/users/deleteuser/lkkk HTTP/1.1" 401 47 "http://localhost:3000/ecommerce/v1/api-docs/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
192.168.1.3 - - [20/Dec/2023:23:16:31 +0000] "GET / HTTP/1.1" 404 139 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36"