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.
- Features
- Requirements
- Installation
- Configuration
- Usage
- API Endpoints
- Testing
- Contributing
- License
- Contact
- 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.
- Python 3.8+
- Django 3.2+
- Django REST Framework
- PostgreSQL (or any other preferred database)
- Clone the repository:
git clone https://github.com/yourusername/ecommerce-backend.git cd ecommerce-backend
- **Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- **Install the Required Dependency
pip install -r requirements.txt
- **Configure the database: Update the DATABASES setting in settings.py to match your database configuration.
- **Run migrations:
python manage.py migrate
- **Create a superuser:
python manage.py createsuperuser
- **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:
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 userPOST /api/auth/login/
- User loginGET /api/auth/profile/
- Get user profile
-
Product Management:
GET /api/products/
- List all productsPOST /api/products/
- Create a new product (Admin only)GET /api/products/:id/
- Retrieve a product by IDPUT /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 orderGET /api/orders/:id/
- Retrieve an order by IDPUT /api/orders/:id/
- Update an order by IDDELETE /api/orders/:id/
- Cancel an order by ID
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.