LookBook is your passport to a world of sustainable shopping.
Say hello to a new way of discovering and sharing preloved treasures.
It supports the CRUD operations for sold products with names and multiple photos,
user profiles with names and email, and swap orders that include products and involved users.
It utilized MongoDB to store all data and Firebase for storing images and generating image URLs.
This API uses Bcrypt, JWT, MongoDB, Mongoose, Express and Node.js
- Clone the Repository:
git clone https://github.com/Hindebox/lookbook-back.git- Navigate to directory
cd <your directory>- Install Dependencies
npm install- Rename '.env.example' to '.env'. This file should contain your MongoDB connection string.
DB_URL=Your MongoDB connection string- Database Initialization and start the API
npm run start- Use this command to make autoupdating after changes
npm run dev- The API will be accessible at http://localhost:2000. You can use tools like Postman to test the API endpoints.
GET /api/users GET /api/users/:userId POST /api/users/register GET /api/users/login PUT /api/users/:userId DELETE /api/users/:userId GET /api/products GET /api/users/:productId POST /api/products PUT /api/products/:productId DELETE /api/products/:productId GET /api/swapOrders GET /api/swapOrders/order
GET /api/swapOrders/userOrders
PARAMS {
buyerUserID: currentUserID,
filter: date or products,
sortOrder: 1 for ascending order
or -1 for descending order,
}, POST /api/swapOrders PUT /api/swapOrders/:orderId DELETE /api/swapOrders/:orderId