aibilly_backend_code/RUNNING.md
laxmanhalaki b793ac859a
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / build (push) Has been cancelled
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-production (push) Has been cancelled
modification done to up the project
2026-03-12 20:52:08 +05:30

2.1 KiB

Running the AI-Detection Project

This project is a FastAPI-based AI application for detection and RAG (Retrieval-Augmented Generation).

Prerequisites

  • Python 3.11+ (for local setup)
  • Docker and Docker Compose (for containerized setup - Recommended)
  • PostgreSQL and Redis (if running locally)

The easiest way to run the project is using Docker Compose, which sets up the application, database, and Redis automatically.

  1. Configure Environment Variables: Copy the example environment file and fill in your keys:

    cp .env.example .env
    

    Note: Open .env and provide your OPENAI_API_KEY or ANTHROPIC_API_KEY if using AI features.

  2. Start the Services:

    docker-compose up --build
    
  3. Access the API:


🛠️ Option 2: Running Locally

If you prefer to run the application directly on your machine:

  1. Create a Virtual Environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  2. Install Dependencies:

    pip install -r requirements.txt
    
  3. Configure Environment Variables: Copy .env.example to .env and update the settings:

    • Set DATABASE_URL to point to your local PostgreSQL instance (e.g., postgresql://user:pass@localhost:5432/dbname).
    • Set REDIS_HOST to localhost.
  4. Run the Application:

    uvicorn main:app --host 0.0.0.0 --port 8000 --reload
    

📂 Project Structure Highlights

  • main.py: Entry point of the FastAPI application.
  • src/config/: Configuration management and startup migrations.
  • src/services/: Core business logic (RAG, JWT, etc.).
  • src/migrations/: Database schema definitions.
  • docker-compose.yml: Multi-container orchestration.

🧪 Testing

To run tests, ensure dependencies are installed and run:

pytest