Skip to content

nirajan1111/ecommerce

Repository files navigation

E-commerce Backend

Welcome to the E-commerce Backend repository! This project is the backend service of an e-commerce website, built using Django, a high-level Python web framework. The backend handles all server-side operations, including user authentication, product management, order processing, and more.

Table of Contents

Features

  • User Authentication: Secure user registration, login, and profile management.
  • Product Management: Add, update, delete, and view products.
  • Category Management: Organize products into categories.
  • Order Processing: Handle the creation, updating, and tracking of orders.
  • Shopping Cart: Manage user's shopping cart items.
  • Admin Dashboard: Admin interface for managing the e-commerce platform.

Requirements

  • Python 3.8+
  • Django 3.2+
  • Django REST Framework
  • PostgreSQL (or any other preferred database)

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/ecommerce-backend.git
    cd ecommerce-backend
  2. **Create and activate a virtual environment:
    python3 -m venv venv
    source venv/bin/activate   # On Windows use `venv\Scripts\activate`
  3. **Install the Required Dependency
    pip install -r requirements.txt
  4. **Configure the database: Update the DATABASES setting in settings.py to match your database configuration.
  5. **Run migrations:
    python manage.py migrate
  6. **Create a superuser:
    python manage.py createsuperuser
  7. **Start the development server:
    python manage.py runserver

Usage Admin Panel: Access the Django admin panel at http://127.0.0.1:8000/admin/ to manage the site. API: Access the API endpoints to interact with the backend services. API Endpoints The backend provides a RESTful API for interacting with the e-commerce functionalities. Below are some key endpoints:

API Endpoints

The backend provides a RESTful API for interacting with the e-commerce functionalities. Below are some key endpoints:

  • User Authentication:

    • POST /api/auth/register/ - Register a new user
    • POST /api/auth/login/ - User login
    • GET /api/auth/profile/ - Get user profile
  • Product Management:

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

    • GET /api/orders/ - List all orders (Admin only)
    • POST /api/orders/ - Create a new order
    • GET /api/orders/:id/ - Retrieve an order by ID
    • PUT /api/orders/:id/ - Update an order by ID
    • DELETE /api/orders/:id/ - Cancel an order by ID

Contributing

We welcome contributions! Please follow these steps:

  • Fork the repository.
  • Create a new branch (git checkout -b feature-branch).
  • Make your changes.
  • Commit your changes (git commit -m 'Add some feature').
  • Push to the branch (git push origin feature-branch).
  • Create a new Pull Request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages