# TimeZero Production Engine - Local Deployment Guide This directory contains the full backend architecture for TimeZero, ready to run locally or deploy to a free tier cloud provider (Render, Railway, Fly.io). ## Files Included: 1. `timezero_production_engine.py` - The core FastAPI application (contains the routing, crawls, vector math, and Neo4j injection). 2. `requirements.txt` - All necessary Python dependencies. 3. `Dockerfile` - For containerized deployment. ## Option A: Run Locally (Fastest for testing) 1. **Clone/Download these files** into a new directory on your machine. 2. **Create a virtual environment:** ```bash python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` ``` 3. **Install dependencies:** ```bash pip install -r requirements.txt ``` 4. **Set your environment variables** (You only strictly need Gemini and Neo4j for the core to function): ```bash export GEMINI_API_KEY="your_google_ai_studio_key" export NEO4J_URI="neo4j+s://your-instance.databases.neo4j.io" export NEO4J_USER="neo4j" export NEO4J_PASS="your_password" # Optional: For Dark Social & Vector Cache export PINECONE_API_KEY="your_pinecone_key" export TELEGRAM_API_ID="your_api_id" export TELEGRAM_API_HASH="your_api_hash" ``` 5. **Run the server:** ```bash uvicorn timezero_production_engine:app --reload ``` 6. **Test the API:** The backend will be live at `http://127.0.0.1:8000`. You can access the automatic interactive API documentation at `http://127.0.0.1:8000/docs`. ## Option B: Deploy to Render (Free Tier) 1. Push these three files (`timezero_production_engine.py`, `requirements.txt`, `Dockerfile`) to a new GitHub repository. 2. Go to [Render.com](https://render.com) and click "New Web Service". 3. Connect your GitHub repository. 4. Render will automatically detect the Dockerfile (or you can select Python environment and set the build command to `pip install -r requirements.txt` and start command to `uvicorn timezero_production_engine:app --host 0.0.0.0 --port $PORT`). 5. Add your Environment Variables in the Render dashboard. 6. Deploy. You will get a live URL (e.g., `https://timezero-backend.onrender.com`). Once you have that URL (either `http://127.0.0.1:8000` or a live Render URL), we can immediately plug it into the frontend POC to execute real traces.