Skip to content

Commit 40ddb61

Browse files
committed
docs: Expand DEPLOYMENT.md with Vercel and Render steps (#651)
1 parent 3e2dd95 commit 40ddb61

1 file changed

Lines changed: 27 additions & 11 deletions

File tree

DEPLOYMENT.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,20 @@ DEFAULT_MAX_PER_CONTRIBUTOR=0
122122
- `ALLOWED_ORIGINS` restricts CORS to your frontend domain.
123123
- Do not rely on SQLite for production data persistence on Render; the container filesystem is ephemeral.
124124

125-
### 2.5 Notes on Render and SQLite
125+
### 2.5 SQLite Persistent Disk Setup on Render
126126

127-
- The backend uses SQLite (`better-sqlite3`) by default.
128-
- Render's storage is not permanent across redeploys.
129-
- For production, use an external database and update `DB_PATH` accordingly.
127+
By default, Render's web service filesystem is ephemeral. To persist SQLite data across deployments, you must attach a Render Disk:
128+
1. In your Render Web Service settings, go to **Disks**.
129+
2. Click **Add Disk**.
130+
3. Name it `sqlite-data` (or similar).
131+
4. Set the **Mount Path** to `/var/data`.
132+
5. Set the Size (e.g., 1 GB).
133+
6. Save changes.
134+
135+
Then, update your environment variables so the application uses the persistent disk:
136+
```env
137+
DB_PATH=/var/data/campaigns.db
138+
```
130139

131140
---
132141

@@ -153,15 +162,13 @@ npm install && npm run build
153162
dist
154163
```
155164

156-
### 3.3 Configure Environment Variables
165+
### 3.3 Configure Environment Variables Checklist
157166

158-
Set the frontend base API URL:
167+
Ensure the following environment variables are set in your Vercel project settings before deploying:
159168

160-
```env
161-
VITE_API_URL=https://<your-backend-service>.onrender.com
162-
```
163-
164-
This value must be the Render backend URL without a trailing `/`.
169+
- [ ] `VITE_API_URL`: The Render backend URL without a trailing `/` (e.g., `https://<your-backend-service>.onrender.com`)
170+
- [ ] `VITE_NETWORK`: The Stellar network to use (e.g., `testnet` or `public`)
171+
- [ ] `VITE_CONTRACT_ID`: The Soroban contract ID (optional, if frontend interacts directly)
165172

166173
### 3.4 Deploy
167174

@@ -210,6 +217,15 @@ If `CONTRACT_ID` is missing, the app may still run, but on-chain pledge integrat
210217

211218
Use the backend health endpoint and the frontend deployment status in Vercel to verify end-to-end availability.
212219

220+
### 4.4 Post-Deploy Verification Checklist
221+
222+
Run through this checklist to ensure a fully functional deployment:
223+
224+
- [ ] **Backend Health:** Run `curl -s https://<your-backend-service>.onrender.com/api/health | grep '"status": "ok"'` to verify it is healthy.
225+
- [ ] **Frontend Load:** Visit the Vercel frontend URL in an incognito window; verify the app loads with no console errors.
226+
- [ ] **Data Persistence:** Create a test campaign via the UI. Manually restart the Render backend from the dashboard. Refresh the page and verify the campaign still exists (confirms SQLite disk is mounted correctly).
227+
- [ ] **Contract Integration:** Check `CONTRACT_ID` is present by attempting a pledge action on the frontend and verifying the transaction initiates via your wallet.
228+
213229
---
214230

215231
## 5. Troubleshooting

0 commit comments

Comments
 (0)