No description
Find a file
vickytechkey 2e604f1c6f
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 1m4s
ci: configure node:22-alpine container with git and update database host IP in beta workflow
2026-09-06 15:13:35 +05:30
.forgejo/workflows ci: configure node:22-alpine container with git and update database host IP in beta workflow 2026-09-06 15:13:35 +05:30
api refactor: remove support contact fields from SupplierProfile and restrict CORS allowed origins 2026-09-05 16:04:01 +05:30
config refactor: remove support contact fields from SupplierProfile and restrict CORS allowed origins 2026-09-05 16:04:01 +05:30
mnt/s3files/supplierdocuments adding the s3 and cloudfront 2026-08-20 11:21:14 +05:30
.gitignore adding the logs service 2026-08-09 17:24:57 +05:30
conftest.py feat: extend SupplierProfile with business details, category support, and dynamic multi-database configuration 2026-08-18 11:30:22 +05:30
manage.py feat: initialize Django project structure with base configuration files 2026-08-08 08:24:15 +05:30
pytest.ini adding api urls and testing framework 2026-08-09 11:42:43 +05:30
README.md docs: add comprehensive project documentation and API reference to README 2026-08-09 12:12:22 +05:30
requirements.txt feat: implement e-Aadhaar KYC upload and verification service using Surepass API 2026-08-28 22:12:59 +05:30
sample_images.zip feat: add sample product data and images for development and testing 2026-08-12 20:57:29 +05:30
sample_products.csv feat: add sample product data and images for development and testing 2026-08-12 20:57:29 +05:30
seed_db.py adding mock data 2026-08-09 12:17:59 +05:30
seller-central-backend.service ci: switch to native deployment using systemd and a virtual environment 2026-08-09 18:43:29 +05:30
start.sh feat: add DummyAuthentication for development and include startup script for server management 2026-08-27 22:10:10 +05:30

Seller Central Backend

A robust Django-based backend REST API for Seller Central, a web platform designed to streamline and empower suppliers. This backend supports registration, mock OTP verification, profile completion, product catalog management, order fulfillment cycles, customer returns, and financial transactions.


🛠️ Architecture & Technology Stack

  • Framework: Django & Django REST Framework (DRF)
  • Database: SQLite (default, easily configured for PostgreSQL/MySQL)
  • Containerization: Docker & Docker Compose
  • Testing Framework: Pytest with pytest-django
  • CORS Support: Configured for cross-origin frontend communication (django-cors-headers)

📦 Core E2E Modules & Business Logic

1. Onboarding & Authentication

  • Registration & Login: Secure user registration and login endpoints utilizing Django's built-in authentication system.
  • OTP Verification: A simulated 2FA verification system (mock code: 123456) that verifies onboarding/logins.
  • Detailed Profiles: Stores supplier coordinates (latitude/longitude), contact details, store branding details, and document references (Aadhar, PAN, and verified GSTIN).

2. Product Catalog

  • CRUD Operations: Complete management of products, including title, category, price, stock, and SKU details.
  • Bulk Upload: Batch create products using a structured JSON payload to efficiently scale inventory.

3. Order Management & Fulfillment

  • Fulfillment Pipeline: Transition orders through realistic stages: Pending Acceptance ➡️ Ready to Ship ➡️ Shipped ➡️ Delivered
  • Actions: Suppliers can accept or reject pending orders. Accepting automatically assigns tracking numbers, shipping carriers, and estimates transit times.

4. Returns & Customer Service

  • Return Processing: Suppliers can inspect customer returns, view return reasons, and track return packages.
  • Resolution: Actions to approve (marks status as In Transit) or reject returns.

5. Wallet & Payout System

  • Financial Ledger: Tracks outstanding payouts and total withdrawn balances.
  • Payout Withdrawals: Securely requests withdraws from outstanding balances, generating transaction receipts (TX-XXXX) for audit trails.

🗺️ API Reference

Authentication & Profile

  • POST /api/auth/register/: Register a new supplier.
  • POST /api/auth/login/: Authenticate and initiate a session.
  • POST /api/auth/verify-otp/: Validate verification codes (use code 123456 for successful verification).
  • GET /api/profile/: Retrieve the authenticated profile.
  • PUT /api/profile/: Update GSTIN, bank details, and business settings.

Products Catalog

  • GET /api/products/: List all products owned by the supplier.
  • POST /api/products/: Create a new product.
  • DELETE /api/products/<id>/: Delete a product.
  • POST /api/products/bulk-upload/: Bulk create products in a single call.

Order Processing

  • GET /api/orders/: List all orders.
  • POST /api/orders/<id>/accept/: Accept a pending order (updates carrier & tracking).
  • POST /api/orders/<id>/reject/: Reject a pending order.

Customer Returns

  • GET /api/returns/: List return requests.
  • POST /api/returns/<id>/action/: Approve or reject a return request.

Wallet & Financials

  • GET /api/wallet/: Retrieve wallet balance and transactions list.
  • POST /api/wallet/withdraw/: Request payout/withdrawal.

🚀 Getting Started

Prerequisites

  • Python 3.12+
  • Docker & Docker Compose (Optional)

Local Setup

  1. Clone the Repository and navigate to the project directory:
    git clone <repo_url>
    cd seller_central_backend
    
  2. Set up Virtual Environment:
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install Dependencies:
    pip install -r requirements.txt
    
  4. Run Migrations:
    python manage.py migrate
    
  5. Run the Development Server:
    python manage.py runserver
    
    The backend will be running at http://127.0.0.1:8000/.

🐳 Docker Deployment

You can build and run the entire stack inside Docker containers:

docker-compose up --build

This serves the application on port 8000.


🧪 Running Tests

We use pytest for automated test coverage of authentication, profile updates, products CRUD, bulk uploads, order state transitions, and payouts. To execute tests, run:

pytest