Festiva is a full-stack E-commerce platform that combines a React.js frontend with a Flask-based backend. It features user authentication, dynamic product trends, demand prediction, and more.
- Features
- Prerequisites
- Repository Structure
- Installation
- Environment Variables
- Running the Application
- Available Scripts
- Testing
- API Documentation
- Troubleshooting
- Contributing
- License
- User Authentication: Secure JWT-based authentication for signup and login.
- Dynamic Product Trends: Fetch and display trending products based on categories.
- Demand Prediction: Machine learning integration for demand prediction.
- Product Filtering: Filter products by categories dynamically.
- Responsive UI: Fully responsive frontend built with React.
- Backend API: Flask-based backend with PostgreSQL integration.
- Secure Data Management: User data and product details are stored securely.
Ensure you have the following installed on your system:
- Node.js (v16+) and npm or Yarn: Install Node.js
- Python (v3.8+): Install Python
- PostgreSQL: Install PostgreSQL
- Git: Install Git
Festiva/
├── festiva-frontend/ # React.js Frontend
│ ├── public/ # Static assets
│ ├── src/ # React components & pages
│ ├── .env # Frontend environment variables
│ ├── package.json # Frontend dependencies
│ └── README.md # Frontend instructions
│
├── festiva-backend/ # Flask Backend
│ ├── migrations/ # Database migration files
│ ├── static/ # Static files
│ ├── templates/ # HTML templates (if needed)
│ ├── .env # Backend environment variables
│ ├── app.py # Main Flask app
│ ├── models.py # Database models
│ ├── requirements.txt # Backend dependencies
│ └── README.md # Backend instructions
│
├── .gitignore # Ignored files and folders
├── .gitattributes # Git LFS configurations
└── README.md # This file
git clone https://github.com/siezer-5997/Festiva.git
cd FestivaNavigate to the festiva-frontend folder and install dependencies:
cd festiva-frontend
npm installNavigate to the festiva-backend folder and set up a virtual environment:
cd ../festiva-backend
python -m venv venv # Create a virtual environment
source venv/Scripts/activate # Activate virtual environment (Windows)
# For Mac/Linux: source venv/bin/activate
pip install --upgrade pip # Upgrade pip
pip install -r requirements.txt # Install backend dependenciesCreate a .env file in festiva-frontend:
REACT_APP_API_URL=http://localhost:5000
Create a .env file in festiva-backend:
FLASK_APP=app.py
FLASK_ENV=development
PORT=5000
DATABASE_URL=postgresql://<username>:<password>@localhost:5432/festiva
JWT_SECRET_KEY=your_jwt_secret_key
Replace <username> and <password> with your PostgreSQL credentials.
Start the Flask server:
cd festiva-backend
source venv/Scripts/activate # Activate virtual environment (venv\Scripts\activate for Windows)
flask db upgrade # Run database migrations
flask run # Start the Flask serverBackend will be available at http://localhost:5000.
In a new terminal, start the React app:
cd festiva-frontend
npm startFrontend will be available at http://localhost:3000.
- Start Development Server:
npm start
- Build for Production:
npm run build
- Start Development Server:
flask run
- or use this if flask doesn't work, I use python:
python app.py
- Database Migrations:
flask db migrate -m "migration message" flask db upgrade
| Method | Endpoint | Description |
|---|---|---|
| POST | /signup |
User signup |
| POST | /login |
User login |
| GET | /products |
Fetch all products |
| GET | /products/category/:id |
Fetch products by category |
| GET | /recommendations |
Fetch recommended products |
| GET | /fetch-trends |
fetch products trending |
| POST | /predict |
Predict product demand |
Run tests in festiva-frontend:
cd festiva-frontend
npm testRun backend tests using unittest:
cd festiva-backend
venv\Scripts\activate
python app.py-
Backend Not Starting:
- Ensure the virtual environment is activated.
- Check
.envfile configuration.
-
Database Errors:
- Ensure PostgreSQL is running.
- Verify the
DATABASE_URLin the.envfile.
-
Port in Use:
- Change the ports in
.envorpackage.json.
- Change the ports in
Slide presentation of the Project available in Google Slides with details about features of the Application
- Presentation: Google Slides
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Commit changes:
git commit -m "Add your feature" - Push and open a pull request:
git push origin feature/your-feature
This project is licensed under the MIT License.
For any issues, suggestions, or feedback, please reach out:
- Siem Zeresenay: siemzeresenay937@gmail.com
Enjoy Festiva 🚀!