Discover Your Style, Shop with Ease
The ShopSmart API is a powerful backend application built using Express and MongoDB. It provides various endpoints to manage users, categories, brands, and products for your e-commerce platform.
/api/users/signin: User login endpoint./api/users/signup: User registration endpoint./api/users/getUsers: Get all users from the database./api/users/updateUser: Update user profile./api/users/getUserByID: Get user details by ID./api/users/deleteUser: Delete user from the database.
/api/category/getCategory: Get all categories from the database./api/category/getCategoryByName: Get category details by name./api/category/createCategory: Create a new category./api/category/deleteCategory: Delete category from the database./api/category/updateCategory: Update category details.
/api/brand/getBrand: Get all brands from the database./api/brand/getBrandByName: Get brand details by name./api/brand/createBrand: Create a new brand./api/brand/deleteBrand: Delete brand from the database./api/brand/updateBrand: Update brand details.
/api/product/getProduct: Get all products from the database./api/product/getProductByName: Get product details by name./api/product/createProduct: Create a new product./api/product/deleteProduct: Delete product from the database./api/product/updateProduct: Update product details.
Before running the API, make sure to set the following environment variables in a .env file:
SERVER_PORT: Port for API to run on.MONGO_URI: Your MongoDB connection string.JWT_SECRET: Secret key for JWT token generation.NODEMAILER_EMAIL: Email for Emailing via nodemailer.NODEMAILER_PASSWORD: Password for email.
- Install the required dependencies using
npm install. - Set up the environment variables in the
.envfile. - Start the server with
npm start. - The API will be accessible at
http://localhost:PORT, wherePORTis the port number specified in your environment or the default3000.
Feel free to customize the API according to your specific requirements. You can add more endpoints or modify existing ones to suit your application's needs.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.
If you have any questions or need further assistance, feel free to contact us at s.ammarahmed14@gmail.com.