This document provides instructions for running both the backend FastAPI server and the React frontend application.
- Python 3.8 or later
- Node.js 14 or later
- npm or yarn
- MongoDB (running locally on default port 27017)
- Ollama (for local LLM support)
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- Windows:
venv\Scripts\activate - macOS/Linux:
source venv/bin/activate
- Windows:
-
Install the required Python packages:
pip install fastapi uvicorn pydantic python-multipart python-jose[cryptography] passlib pymongo ollama yt_dlp streamlit
-
Start the FastAPI server:
python fast_api_server.py
-
The server will run at
http://127.0.0.1:8000by default
-
Navigate to the React project directory:
cd react -
Install dependencies:
npm install
-
Start the development server:
npm start
-
The frontend will run at
http://localhost:3000and automatically open in your browser
-
Authentication
- Use the default admin account:
- Username:
admin - Password:
admin123
- Username:
- Or create a new account on the signup page
- Use the default admin account:
-
Basic Workflow
- After logging in, upload YouTube ad URLs on the Dashboard page
- View your uploaded ads in the "My Ads" section
- Analyze ad performance in the Analytics section
- Use the AI Chatbot for deeper insights about ad performance
- API Connection Issues: Ensure the FastAPI server is running on port 8000
- MongoDB Errors: Make sure MongoDB is running on the default port (27017)
- CORS Errors: Check that the CORS configuration in
fast_api_server.pyincludes your frontend origin
You can modify the following settings as needed:
- Backend port: Edit the port in
fast_api_server.py(default: 8000) - Frontend API URL: Edit the
API_BASE_URLinsrc/services/api.jsif you changed the backend port - JWT Secret Key: For production, set a secure secret key in
fast_api_server.py