Skip to content

Commit 98f4c04

Browse files
committed
docs: add deployment docs and update readme
1 parent de54348 commit 98f4c04

2 files changed

Lines changed: 63 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
<p><strong>One workspace. Every developer workflow. Zero cloud dependency for AI.</strong></p>
55

66
<p>
7+
<a href="https://dev-flow-ai-five.vercel.app"><img src="https://img.shields.io/badge/Live_App-Vercel-black?logo=vercel" alt="Live App" /></a>
8+
<a href="https://devflow-api-comy.onrender.com"><img src="https://img.shields.io/badge/API-Render-black?logo=render" alt="Live API" /></a>
79
<img src="https://img.shields.io/badge/status-Production%20Ready-success" alt="Status" />
810
<img src="https://img.shields.io/badge/license-MIT-blue" alt="License" />
9-
<img src="https://img.shields.io/badge/platform-Web%20%7C%20iOS%20%7C%20Android-lightgrey" alt="Platforms" />
1011
</p>
1112
</div>
1213

@@ -28,12 +29,12 @@ DevFlow AI is built as a robust **Monorepo** using the latest enterprise-grade t
2829

2930
| Layer | Technology | Description |
3031
|---|---|---|
31-
| **Web App** | Next.js 15, React 19, Tailwind CSS | App Router, Server Components, shadcn/ui components |
32+
| **Web App** | Next.js 15, React 19 (Hosted on **Vercel**) | App Router, Server Components, shadcn/ui components |
3233
| **Mobile App** | React Native CLI | Native iOS & Android application sharing the same core backend |
33-
| **Backend API** | NestJS | Modular architecture, WebSockets (Socket.io) for real-time progress |
34-
| **Database** | PostgreSQL 16 + pgvector | Relational data + Vector embeddings for semantic AI search |
35-
| **Cache & Auth** | Redis | JWT Token blacklisting and session management |
36-
| **AI Runtime** | Ollama | Local execution of Llama 3, Mistral, and Nomic Embeddings |
34+
| **Backend API** | NestJS (Hosted on **Render**) | Modular architecture, WebSockets for real-time progress |
35+
| **Database** | PostgreSQL + pgvector (Hosted on **Neon.tech**) | Relational data + Vector embeddings for semantic AI search |
36+
| **Cache & Auth** | Redis (Hosted on **Upstash**) | JWT Token blacklisting and session management |
37+
| **AI Runtime** | Ollama (Hosted on **Oracle Cloud VM**) | Remote execution of Llama 3 and Nomic Embeddings |
3738
| **ORM** | Prisma 7 | Type-safe database interactions and automated migrations |
3839
| **State** | Zustand + React Query | Global UI state management and server-data caching |
3940

@@ -129,6 +130,7 @@ For an exhaustive, deep-dive look into how this system was built, please refer t
129130
- `DevFlowAI-Documentation_1.md`: Weeks 1-3 (Foundation & Auth)
130131
- `DevFlowAI-Documentation_2.md`: Weeks 4-10 (RAG, WebSockets, GitHub Indexing)
131132
- `DevFlowAI-Documentation_3.md`: Weeks 11-12 (Mobile App & Polish)
133+
- `DevFlowAI-Documentation_4.md`: Weeks 13-14 (Production Deployment, Neon, Render, Oracle Cloud, E2E & Load Testing)
132134

133135
---
134136

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# DevFlow AI: Production Deployment & Verification
2+
3+
## 1. Cloud Infrastructure & Architecture
4+
5+
Moving from a local Docker Compose setup to a production-ready cloud architecture required distributing our services across multiple specialized platforms to balance cost, performance, and scalability. The final production architecture is 100% free-tier compliant while maintaining high availability.
6+
7+
### 1.1 Web Frontend (Vercel)
8+
- **Host**: Vercel
9+
- **Live URL**: `https://dev-flow-ai-five.vercel.app`
10+
- **Why**: Vercel provides zero-config Next.js deployments, global CDN caching, and automatic CI/CD from GitHub.
11+
- **Configuration**: The `NEXT_PUBLIC_API_URL` environment variable was set to point to the production Render backend instead of localhost.
12+
13+
### 1.2 Backend API (Render)
14+
- **Host**: Render (Web Service)
15+
- **Live URL**: `https://devflow-api-comy.onrender.com`
16+
- **Why**: Render offers native Node.js/NestJS support, easy environment variable management, and automatic HTTPS.
17+
- **Configuration**: Configured CORS to whitelist the Vercel frontend domain, preventing unauthorized clients from accessing the API.
18+
19+
### 1.3 PostgreSQL Database (Neon)
20+
- **Host**: Neon.tech
21+
- **Why**: Serverless Postgres that scales to zero and supports the `pgvector` extension out of the box, which is critical for our RAG (Retrieval-Augmented Generation) embeddings.
22+
- **Configuration**: The `DATABASE_URL` was securely stored in Render. We executed `npx prisma migrate deploy` and `npx prisma db seed` during the build step.
23+
24+
### 1.4 Redis Cache (Upstash)
25+
- **Host**: Upstash
26+
- **Why**: Serverless Redis with a generous free tier. It provides the exact same API as local Redis, making it a drop-in replacement.
27+
- **Usage**: Used for BullMQ background job processing, caching GitHub repositories, and JWT session blacklisting.
28+
29+
### 1.5 AI Runtime (Oracle Cloud Infrastructure)
30+
- **Host**: Oracle Cloud "Always Free" ARM VM
31+
- **IP**: `http://152.67.112.59:11434`
32+
- **Why**: Ollama requires significant RAM to run models like LLaMA 3. Oracle Cloud provides a 24GB RAM / 4 OCPU ARM instance entirely for free, which is perfect for hosting an LLM API.
33+
- **Configuration**: Configured `OLLAMA_HOST=0.0.0.0` and opened port `11434` in the Oracle Cloud VCN ingress rules. The backend connects to this via the `OLLAMA_URL` environment variable.
34+
35+
---
36+
37+
## 2. Production Verification & Testing
38+
39+
To ensure the system works reliably under real-world conditions, we implemented two rigorous testing suites.
40+
41+
### 2.1 End-to-End (E2E) Testing with Playwright
42+
We implemented automated browser tests to verify critical user flows in the live production environment.
43+
- **Framework**: Playwright
44+
- **Coverage**: User Registration, Login, Workspace Creation, Project Setup.
45+
- **Execution**: The tests were configured to dynamically use `PLAYWRIGHT_TEST_BASE_URL=https://dev-flow-ai-five.vercel.app`.
46+
- **Result**: The test suite successfully completed all end-to-end flows in **15.8 seconds** with zero errors.
47+
48+
### 2.2 API Load Testing with k6
49+
To verify that our free-tier architecture (specifically Neon and Render) wouldn't collapse under a sudden influx of traffic, we used `k6` to stress-test the backend.
50+
- **Framework**: k6 by Grafana
51+
- **Scenario**: 50 concurrent Virtual Users (VUs) constantly hitting the `/` endpoint and the `/auth/login` endpoint for 60 seconds.
52+
- **Result**:
53+
- Over 1,800 requests were processed.
54+
- The NestJS `ThrottlerModule` (Rate Limiter) successfully intercepted the flood. It allowed exactly 100 requests per IP and returned `429 Too Many Requests` for the rest, preventing database connection exhaustion.
55+
- 95th percentile latency (p95) for successful requests remained under 800ms.

0 commit comments

Comments
 (0)