Skip to content

Latest commit

 

History

History
83 lines (60 loc) · 2.24 KB

File metadata and controls

83 lines (60 loc) · 2.24 KB

AdInsight Application Startup Guide

This document provides instructions for running both the backend FastAPI server and the React frontend application.

Prerequisites

  • 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)

Step 1: Setup the Python Environment

  1. Create a virtual environment:

    python -m venv venv
  2. Activate the virtual environment:

    • Windows: venv\Scripts\activate
    • macOS/Linux: source venv/bin/activate
  3. Install the required Python packages:

    pip install fastapi uvicorn pydantic python-multipart python-jose[cryptography] passlib pymongo ollama yt_dlp streamlit

Step 2: Start the Backend Server

  1. Start the FastAPI server:

    python fast_api_server.py
  2. The server will run at http://127.0.0.1:8000 by default

Step 3: Start the React Frontend

  1. Navigate to the React project directory:

    cd react
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm start
  4. The frontend will run at http://localhost:3000 and automatically open in your browser

Using the Application

  1. Authentication

    • Use the default admin account:
      • Username: admin
      • Password: admin123
    • Or create a new account on the signup page
  2. 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

Troubleshooting

  • 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.py includes your frontend origin

Advanced Configuration

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_URL in src/services/api.js if you changed the backend port
  • JWT Secret Key: For production, set a secure secret key in fast_api_server.py