Repository navigation
Expand file tree
/
Copy pathrender.yaml
More file actions
220 lines (212 loc) · 8.19 KB
/
Copy pathrender.yaml
File metadata and controls
220 lines (212 loc) · 8.19 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# AidFlow — Render Blueprint
# Deploy all services from this single file via:
# Render Dashboard → New → Blueprint → point to this repo
#
# BEFORE deploying, make sure you have:
# 1. Deployed the smart contract to a testnet (see Docs/DEPLOYMENT.md §1)
# 2. Created a MongoDB Atlas cluster and have the connection string
# 3. Generated fresh secrets: openssl rand -hex 64 (JWT), openssl rand -hex 32 (QR, PII)
#
# Fill in every <PLACEHOLDER> value in your Render dashboard env var editor
# after the blueprint creates the services — do NOT commit real secrets here.
services:
# ─────────────────────────────────────────────
# Backend API
# ─────────────────────────────────────────────
- type: web
name: aidflow-backend
runtime: node
rootDir: backend
buildCommand: npm ci --omit=dev
startCommand: node server.js
plan: starter
healthCheckPath: /health
envVars:
- key: NODE_ENV
value: production
- key: PORT
value: 5000
- key: FRONTEND_URL
value: https://aidflow-frontend.onrender.com
- key: MONGO_URI
sync: false # set in dashboard - never commit real URI
- key: JWT_SECRET
generateValue: true
- key: JWT_EXPIRES_IN
value: 7d
- key: JWT_REFRESH_EXPIRES_IN
value: 30d
- key: QR_SECRET
generateValue: true
- key: PII_HASH_SECRET
generateValue: true
- key: REDIS_URL
fromService:
type: redis
name: aidflow-redis
property: connectionString
- key: AI_ELIGIBILITY_URL
value: https://aidflow-eligibility-agent.onrender.com
- key: AI_FRAUD_URL
value: https://aidflow-fraud-agent.onrender.com
- key: AI_RISK_URL
value: https://aidflow-risk-agent.onrender.com
- key: AI_PROOF_URL
value: https://aidflow-proof-agent.onrender.com
- key: STORAGE_TYPE
value: S3
- key: S3_BUCKET
sync: false
- key: S3_REGION
sync: false
- key: AWS_ACCESS_KEY_ID
sync: false
- key: AWS_SECRET_ACCESS_KEY
sync: false
- key: BACKEND_PUBLIC_URL
value: https://aidflow-backend.onrender.com
- key: RPC_URL
sync: false # your Alchemy/Infura testnet URL
- key: AUDIT_CONTRACT_ADDRESS
sync: false # address from your one-time contract deploy
- key: BLOCKCHAIN_PRIVATE_KEY
sync: false # dedicated wallet key - never a Hardhat default
# ─────────────────────────────────────────────
# Background Worker (same image, different CMD)
# ─────────────────────────────────────────────
- type: worker
name: aidflow-worker
runtime: node
rootDir: backend
buildCommand: npm ci --omit=dev
startCommand: node src/workers/index.js
plan: starter
envVars:
- key: NODE_ENV
value: production
- key: MONGO_URI
sync: false
- key: JWT_SECRET
fromService:
type: web
name: aidflow-backend
envVarKey: JWT_SECRET
- key: QR_SECRET
fromService:
type: web
name: aidflow-backend
envVarKey: QR_SECRET
- key: PII_HASH_SECRET
fromService:
type: web
name: aidflow-backend
envVarKey: PII_HASH_SECRET
- key: REDIS_URL
fromService:
type: redis
name: aidflow-redis
property: connectionString
- key: AI_ELIGIBILITY_URL
value: https://aidflow-eligibility-agent.onrender.com
- key: AI_FRAUD_URL
value: https://aidflow-fraud-agent.onrender.com
- key: AI_RISK_URL
value: https://aidflow-risk-agent.onrender.com
- key: AI_PROOF_URL
value: https://aidflow-proof-agent.onrender.com
- key: STORAGE_TYPE
value: S3
- key: S3_BUCKET
sync: false
- key: S3_REGION
sync: false
- key: AWS_ACCESS_KEY_ID
sync: false
- key: AWS_SECRET_ACCESS_KEY
sync: false
- key: RPC_URL
sync: false
- key: AUDIT_CONTRACT_ADDRESS
sync: false
- key: BLOCKCHAIN_PRIVATE_KEY
sync: false
# ─────────────────────────────────────────────
# AI Agent — Eligibility (port 8001)
# ─────────────────────────────────────────────
- type: web
name: aidflow-eligibility-agent
runtime: python
rootDir: ai-agents/eligibility_agent
buildCommand: pip install -r requirements.txt
startCommand: uvicorn main:app --host 0.0.0.0 --port 8001
plan: free # lightweight, stateless rule engine
healthCheckPath: /health
# ─────────────────────────────────────────────
# AI Agent — Fraud (port 8002)
# ─────────────────────────────────────────────
- type: web
name: aidflow-fraud-agent
runtime: python
rootDir: ai-agents/fraud_agent
buildCommand: pip install -r requirements.txt
startCommand: uvicorn main:app --host 0.0.0.0 --port 8002
plan: free
healthCheckPath: /health
# ─────────────────────────────────────────────
# AI Agent — Risk (port 8003)
# ─────────────────────────────────────────────
- type: web
name: aidflow-risk-agent
runtime: python
rootDir: ai-agents/risk_agent
buildCommand: pip install -r requirements.txt
startCommand: uvicorn main:app --host 0.0.0.0 --port 8003
plan: free
healthCheckPath: /health
# ─────────────────────────────────────────────
# AI Agent — Proof (port 8004)
# Uses Docker because it needs tesseract-ocr system package.
# ─────────────────────────────────────────────
- type: web
name: aidflow-proof-agent
runtime: docker
rootDir: ai-agents/proof_agent
plan: starter # heavier: OCR + image hashing
healthCheckPath: /health
envVars:
- key: MONGO_URI
sync: false # same Atlas URI as backend
- key: AI_PROOF_PORT
value: 8004
# ─────────────────────────────────────────────
# Frontend — Static Site
# VITE_* vars are baked in at build time, not runtime.
# ─────────────────────────────────────────────
- type: web
name: aidflow-frontend
runtime: static
rootDir: frontend
buildCommand: npm ci && npm run build
staticPublishPath: dist
pullRequestPreviewsEnabled: false
routes:
- type: rewrite
source: /*
destination: /index.html
envVars:
- key: VITE_API_BASE_URL
value: https://aidflow-backend.onrender.com/api
- key: VITE_CHAIN_ID
value: 80002 # Polygon Amoy testnet
- key: VITE_BLOCKCHAIN_EXPLORER
value: https://amoy.polygonscan.com
- key: VITE_APP_NAME
value: AidFlow
# ─────────────────────────────────────────────
# Managed Redis
# ─────────────────────────────────────────────
databases:
- type: redis
name: aidflow-redis
plan: free
maxmemoryPolicy: noeviction # important for BullMQ queue durability