https://github.com/mastermind-fa/youfashion_backend
A Django Rest Framework-based backend for user authentication, product management, cart, wishlist, and secure payments via SSLCommerz. 🚀
https://github.com/mastermind-fa/youfashion_backend
django django-rest-framework python sslcommerz
Last synced: 3 months ago
JSON representation
A Django Rest Framework-based backend for user authentication, product management, cart, wishlist, and secure payments via SSLCommerz. 🚀
- Host: GitHub
- URL: https://github.com/mastermind-fa/youfashion_backend
- Owner: mastermind-fa
- Created: 2025-01-26T17:43:12.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-03-11T09:09:46.000Z (3 months ago)
- Last Synced: 2025-03-11T10:26:24.861Z (3 months ago)
- Topics: django, django-rest-framework, python, sslcommerz
- Language: JavaScript
- Homepage: https://you-fashion-backend.vercel.app
- Size: 2.14 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YouFashion - Clothing Store Backend
## Overview
YouFashion is a Django Rest Framework-based backend for a clothing store. It provides essential functionalities such as user authentication, product management, cart and wishlist features, and a seamless payment experience using SSLCommerz.
## Features
- **User Authentication:**
- User registration with email confirmation.
- User login/logout functionality.
- **Product Management:**
- Only admin users can add new products.
- Update or delete product quantity.
- **Cart & Wishlist:**
- Users can add products to their cart.
- Users can add products to their wishlist.
- **Payments:**
- SSLCommerz integration for secure payments.
- **Filtering & Sorting:**
- Products can be filtered and sorted by price and popularity.## Technologies Used
- **Backend:** Django Rest Framework
- **Database:** PostgreSQL
- **Authentication:** JWT Authentication
- **Payments:** SSLCommerz
- **Deployment:** Secure hosting platform## Installation & Setup
### Prerequisites
Ensure you have the following installed:
- Python 3.x
- PostgreSQL
- Virtual Environment (optional but recommended)### Steps to Run the Project
1. **Clone the Repository:**
```sh
git clone https://github.com/mastermind-fa/YouFashion_Backend.git
cd YouFashion_Backend
```
2. **Create & Activate Virtual Environment:**
```sh
python -m venv venv
source venv/bin/activate # For Linux/Mac
venv\Scripts\activate # For Windows
```
3. **Install Dependencies:**
```sh
pip install -r requirements.txt
```
4. **Set Up Environment Variables:**
- Create a `.env` file in the project root directory and add the following:
```sh
SECRET_KEY=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_PORT=
EMAIL=
PASSWORD=
SUCCESS_URL=http://127.0.0.1:8000/order.html
CANCEL_URL=http://127.0.0.1:8000/cart.html
FAIL_URL=http://127.0.0.1:8000/cart.html
```
- To generate a new Django secret key, run:
```sh
python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
```
5. **Apply Migrations:**
```sh
python manage.py migrate
```
6. **Create a Superuser (Admin):**
```sh
python manage.py createsuperuser
```
7. **Run the Development Server:**
```sh
python manage.py runserver
```## API Endpoints
### Base URL: `http://127.0.0.1:8000/`
| Endpoint | Method | Description |
| ---------------------------------------- | ------ | -------------------------------------------- |
| `/customer/list/` | GET | Fetch all customers |
| `/customer/login/` | POST | User login (JSON format) |
| `/customer/logout/` | POST | User logout |
| `/customer/register/` | POST | Register a new user |
| `/customer/details//` | GET | Fetch user details |
| `/products/list/` | GET | Get all products, filter by price/popularity |
| `/products/list//` | GET | Get details of a single product |
| `/products/reviews/list/?productID` | GET | Get all reviews of a product |
| `/products/reviews/` | POST | Post a review |
| `/order/cart/` | POST | Add product to cart |
| `/order/cart/` | GET | Get cart data |
| `/order/cart/` | PUT | Update cart quantity |
| `/order/cart//` | DELETE | Remove product from cart |
| `/products/wishlist/` | POST | Add product to wishlist |
| `/products/wishlist/` | GET | Get wishlist data |
| `/products/wishlist/remove//` | DELETE | Remove product from wishlist |
| `/order/orders/` | GET | Get previous orders of user |
| `/payment/sslcommerz/` | POST | Process payment with SSLCommerz |## Contribution
Contributions are welcome! Feel free to fork the repo and submit a pull request.
## License
This project is licensed under the MIT License.
---
Developed by **Farhana Alam**