TechVibe is a full-stack e-commerce application with integrated sentiment analysis for product reviews. It uses Django for the backend, React for the frontend, and MongoDB as the database.
- Prerequisites
- Project Structure
- Backend Setup
- Frontend Setup
- Running the Application
- API Endpoints
- Contributing
- License
Before you begin, ensure you have met the following requirements:
- You have installed Python 3.8+
- You have installed Node.js 14+
- You have installed MongoDB
- You have a basic understanding of Django, React, and MongoDB
TechVibe│
├── backend/
│ ├── ecommerce_project/
│ ├── sentiment_analysis/
│ ├── manage.py
│ └── requirements.txt
│
├── frontend/
│ ├── public/
│ ├── src/
│ ├── package.json
│ └── vite.config.js
│
├── .gitignore
└── README.md
-
Navigate to the backend directory:
cd backend
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Install the required packages:
pip install -r requirements.txt
-
Set up your MongoDB database and update the
DATABASES
configuration inecommerce_project/settings.py
. -
Run migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Navigate to the frontend directory:
cd frontend
-
Install the required packages:
npm install
-
Create a
.env
file in the frontend directory and add the backend URL:VITE_API_URL=http://localhost:8000/api
-
Start the backend server:
cd backend python manage.py runserver
-
In a new terminal, start the frontend development server:
cd frontend npm run dev
-
Open your browser and go to
http://localhost:5173
to view the application.
GET /api/products/all/
: Get all productsPOST /api/products/
: Add a new productGET /api/reviews/<product_id>/
: Get reviews for a specific productPOST /api/reviews/<product_id>/
: Add a review for a specific productPOST /api/analyze-sentiment/
: Analyze the sentiment of a given text
For more detailed API documentation, please refer to the backend code or set up Django Rest Framework's built-in API documentation.
This project is licensed under the MIT License. See the LICENSE
file for details.
For any additional questions or issues, please open an issue in the GitHub repository.