Deployment Guide

Development Setup

Set up your local development environment for the RokuChannel Platform. This guide covers prerequisites, installation, database creation, and running the app for the first time.

Windows Development machine C:\PROJECTS\ROKU Python 3.11+ FastAPI :8065 uvicorn server 6 middleware layers 50 routes Sync SQLAlchemy PostgreSQL :9433 DB: rokuchannel Schema: roku Redis :6379/10 Cache layer ONETIMELOGIN :8001 COLLECTIONS :8050

Figure 1: Dev Environment Architecture

Prerequisites

Software Version Notes
Python 3.11+ Required for FastAPI and async features
PostgreSQL 14+ Runs on port 9433 (not default 5432)
Redis 6+ Uses database 10 (redis://localhost:6379/10)
Git 2.x For version control
Non-Standard PostgreSQL Port
This project uses port 9433 for PostgreSQL, not the default 5432. Make sure your PostgreSQL instance is configured to listen on port 9433.

Cloning and Installing

  1. Clone the repository
    git clone <repo-url> C:\PROJECTS\ROKU
  2. Create a virtual environment
    cd C:\PROJECTS\ROKU\backend
    python -m venv venv
    venv\Scripts\activate
  3. Install dependencies
    pip install -r requirements.txt
  4. Configure environment

    Copy or edit backend/.env with your database credentials and JWT secret.

Database Creation

  1. Run the setup script
    python setup_db.py

    This creates the rokuchannel database (if it does not exist), creates the roku schema, and runs all V*.sql migration files in order.

  2. Verify tables

    The script verifies that all 11 tables in the roku schema were created successfully by querying information_schema.tables.

First Run

  1. Start the development server
    uvicorn app.main:app --host 0.0.0.0 --port 8065 --reload
  2. Verify health check
    curl http://localhost:8065/health

    Should return JSON with {"status": "healthy"} and database connection details.

Debug Mode
With DEBUG=true in .env, the FastAPI docs are available at /docs (Swagger) and /redoc. Useful during development.