ShopEase is an e-commerce product management system built using Django, Django REST Framework, and PostgreSQL. The system allows administrators to manage products and categories, while users can view and search for products by name or category. The application provides a RESTful API, supports CRUD operations, and includes user authentication and pagination features.
- Product and Category Management: Administrators can add, update, and delete products and categories.
- User Interface: Users can view a list of products and search by name or category.
- RESTful API: Provides endpoints for managing products and categories.
- Pagination: Supports pagination for product listings.
- User Authentication: Secures administrative functions and restricts access.
- PostgreSQL Database: Uses PostgreSQL for storing product, category, and review data.
Follow these steps to set up the project on your local machine:
- Python 3.8+
- PostgreSQL
-
Clone the Repository:
git clone https://github.com/manogna7/ShopEase.git cd ecommerce
-
Install Dependencies:
pip install -r requirements.txt
-
Configure PostgreSQL:
- Create a PostgreSQL database named
ecommerce_db
. - Update the
DATABASES
settings inecommerce/settings.py
with your database credentials.
- Create a PostgreSQL database named
-
Run Migrations:
python manage.py makemigrations python manage.py migrate
-
Create a Superuser:
python manage.py createsuperuser
-
Run the Development Server:
python manage.py runserver
-
Access the Application:
- Visit
http://127.0.0.1:8000/
in web browser to view the application. - Access the admin panel at
http://127.0.0.1:8000/admin/
.
- Visit
- View Products: Navigate to the home page to view a list of available products.
- Search Products: Use the search bar to filter products by name or category.
- Manage Products and Categories: Log in to the admin panel to add, update, or delete products and categories.
The application provides the following API endpoints:
-
Products:
GET /api/products/
: Retrieve a list of products.POST /api/products/
: Create a new product.PUT /api/products/<id>/
: Update an existing product.DELETE /api/products/<id>/
: Delete a product.
-
Categories:
GET /api/categories/
: Retrieve a list of categories.POST /api/categories/
: Create a new category.PUT /api/categories/<id>/
: Update an existing category.DELETE /api/categories/<id>/
: Delete a category.
The project uses a PostgreSQL database with the following schema:
-
Products Table:
id
: Primary keyname
: Product namedescription
: Product descriptionprice
: Product pricecategory_id
: Foreign key referencing the Categories table
-
Categories Table:
id
: Primary keyname
: Category name
-
Reviews Table:
id
: Primary keyproduct_id
: Foreign key referencing the Products tableuser_id
: Foreign key referencing the Users tablerating
: Review ratingcomment
: Review comment