Build Using: NodeJs, MongoDb( No SQL Database )
- run npm i (to install all dependencies)
- setup a mongoDb server on localhost
- rename .env.sample file to .env and add your personal configs
- Run npm start (to start the server)
- /api/auth/register - To register user
- /api/auth/login - To login user
- /api/auth/signout - To signout user
- /api/auth/verify - Runs to verify the cookie saved the client local storage
- GET /buyer/list-of-sellers - return a list of sellers
- GET /buyer/seller-catalog/:id - return a list of all catalogs belonging to a particular seller
- POST /buyer/create-order/:id - Creates order to a seller
- GET /buyer/:catalog_id/items - lists all items in a catalog
- POST /seller/create-catalog - to create a catalog
- GET /seller/orders - list all orders
- POST /seller/:catalog_id/create-item - create a item in a catalog
- Users with role as 1 is just a buyer, and cannot list items to sell
- Users with role as 2 can list items to sell and can also buy items from other seller