Skip to content

HuseynliIlqar/e-commers-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


E-commerce API

This project is an e-commerce API built with Node.js, Express, and MongoDB. It provides a robust backend solution for managing products, users, orders, and authentication within an e-commerce platform.


Features

  • User Authentication & Authorization: Secure user management with JWT (JSON Web Tokens) for authentication and role-based authorization (e.g., admin, user).
  • Product Management: CRUD (Create, Read, Update, Delete) operations for products, including details like name, description, price, categories, and stock.
  • Order Processing: Functionality for users to create orders, view their order history, and for administrators to manage order statuses.
  • Shopping Cart: Users can add and remove items from their cart, which persists across sessions.
  • Category Management: Organize products into various categories for easier navigation and filtering.
  • Search & Filtering: Robust search capabilities and filtering options for products based on categories, price ranges, and other attributes.
  • Image Uploads: Support for uploading product images (likely via a cloud storage service or local file system).
  • Payment Integration (Placeholder): Designed to be extensible for integrating various payment gateways.
  • Admin Panel (API-driven): Provides endpoints for administrative tasks such as managing users, products, and orders.


API Endpoints

(A detailed list of API endpoints with their HTTP methods, routes, request bodies, and response structures would typically go here. As I don't have access to the actual code beyond the repository name, this is a placeholder. You would generate this based on your Express routes.)

Example structure:

Authentication

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Log in a user and receive a JWT

Users

  • GET /api/users - Get all users (Admin only)
  • GET /api/users/:id - Get a single user by ID
  • PUT /api/users/:id - Update a user by ID
  • DELETE /api/users/:id - Delete a user by ID (Admin only)

Products

  • GET /api/products - Get all products
  • GET /api/products/:id - Get a single product by ID
  • POST /api/products - Create a new product (Admin only)
  • PUT /api/products/:id - Update a product by ID (Admin only)
  • DELETE /api/products/:id - Delete a product by ID (Admin only)


Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature/your-feature-name).
  6. Open a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details. (If you have a LICENSE file in your repository, ensure its content is correct.)


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published