Skip to content

NafeesMadni/GenZStudio_Backend

Repository files navigation

🚀 FastAPI Project

This is a FastAPI project setup using uv, a blazing fast Python package manager.

Follow the steps below to get started.


📦 Requirements

  • Python 3.10 (uv handles virtual environments automatically)
  • uv installed
curl -LsSf https://astral.sh/uv/install.sh | sh

⚙️ Environment Variables

Create a .env file in the project root with the following values:

# API Keys
GEMINI_API_KEY= # for API_VERSION_V1
ANTHROPIC_API_KEY= # for API_VERSION_V2
GROQ_API_KEY=

# Spotify API
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=

# Supabase
SUPABASE_API_KEY=
SUPABASE_URL=

# Auth0 - only for testing protected route
AUTH0_DOMAIN=
AUTH0_API_IDENTIFIER=
AUTH0_CLIENT_SECRET=

# Logging
LOG_LEVEL=INFO   # Options: NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL

⚠️ Make sure not to commit .env to version control.


🎵 Splitter AI Setup (Audio Processing)

Splitter AI saves processed audio files to Supabase Storage.

Before running:

  1. Go to your Supabase project dashboard

  2. Navigate to Storage → Buckets

  3. Create a new bucket with the name:

    Media-Files
    
  4. Enable ✅ “Public bucket”

  5. Inside this bucket, create a directory:

    splitter_ai
    

Now, Splitter AI will save all audio files under:

Media-Files/splitter_ai/

⚙️ Local Setup Instructions

  1. Clone the repository

    git clone https://github.com/NafeesMadni/GenZStudio_Backend.git
    cd GenZStudio_Backend
  2. Install dependencies

    uv sync
  3. Activate the virtual environment (optional if you run via uv run)

    source .venv/bin/activate   # Linux / MacOS
    .venv\Scripts\activate      # Windows

▶️ Running the App (Local)

uv run main.py

⚡ Running Celery Worker (Local)

celery -A app.core.celery_app worker --loglevel=INFO

🧪 Running Tests

Run all tests:

pytest

Run Generators API tests:

pytest app/tools/testing/test_api.py -v

🐳 Running with Docker & Docker Compose

1. Build & Start Services

docker-compose up --build

Services started:

  • Redis (broker & backend for Celery)
  • Web (FastAPI app)http://localhost:8000
  • Celery Worker (background task processor)

2. Stop Services

docker-compose down

Remove volumes (e.g., Redis data):

docker-compose down -v

3. Logs

docker-compose logs -f        # all services
docker-compose logs -f web    # only FastAPI
docker-compose logs -f celery-worker

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published