File size: 2,184 Bytes
ed895b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# πŸš€ Master Deployment Guide: Dodge AI

Follow these steps to take your project from local to live.

## πŸ“ Repository Structure (Monorepo)
Your project is now organized for professional deployment:
```

dodge-ai/

 β”œβ”€β”€ backend/            # FastAPI + SQLite

 β”‚    β”œβ”€β”€ dodge_ai.py    # Main API

 β”‚    β”œβ”€β”€ data.db        # Database

 β”‚    └── requirements.txt

 └── frontend/           # React (Vite)

      β”œβ”€β”€ src/           # UI Components

      └── .env           # Environment config

```

---

## 🟒 Step 1: Backend Deployment (Render.com)

1. **Create Account**: Go to [Render](https://render.com) and connect your GitHub.
2. **New Web Service**: Select your repository.
3. **Configure**:
   - **Name**: `dodge-ai-backend`
   - **Root Directory**: `backend`
   - **Runtime**: `Python 3`
   - **Build Command**: `pip install -r requirements.txt`
   - **Start Command**: `uvicorn dodge_ai:app --host 0.0.0.0 --port 10000`
4. **Env Variables**:
   - Add `OPENROUTER_API_KEY`: `your_key_here`
5. **Wait**: Once deployed, you will get a URL like `https://dodge-ai-backend.onrender.com`.

---

## πŸ”΅ Step 2: Frontend Deployment (Vercel.com)

1. **Create Account**: Go to [Vercel](https://vercel.com) and connect your GitHub.
2. **Import Project**: Select the same repository.
3. **Configure**:
   - **Project Name**: `dodge-ai-frontend`
   - **Framework Preset**: `Vite`
   - **Root Directory**: `frontend`
4. **Env Variables** (CRITICAL):
   - Add `VITE_API_URL`: `https://dodge-ai-backend.onrender.com` (from Step 1)
5. **Deploy**: Click Deploy. Your site will be live at `https://dodge-ai-frontend.vercel.app`.

---

## 🧠 Master Prompt for Future AI Help
If you need to explain this deployment to another AI or for documentation, use this:

> **Goal**: Deploy a monorepo ERP AI System.
> **Backend**: FastAPI in `/backend`, port 10000, Root Dir: `backend`.
> **Frontend**: React (Vite) in `/frontend`, Root Dir: `frontend`.
> **Linkage**: Frontend uses `VITE_API_URL` to hit the Render backend.
> **Features**: Intent detection, SQL generation, Cytoscape graph, Recharts.