You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: version 2/DEPLOY.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,3 +199,39 @@ To receive emails, you must configure Cloudflare Email Routing.
199
199
- **Database errors**: Ensure you ran the `d1 execute`command (Step 4.2).
200
200
- **"Uncaught (in promise)"**: Check your `wrangler secret list` to ensure all secrets are set.
201
201
- **Email not received**: Verify your domain's MX records in Cloudflare DNS settings match what Email Routing requires.
202
+
203
+
---
204
+
205
+
## Local Development
206
+
207
+
You can run the application locally in two modes: **Local Mode** (using a local temporary database) or **Remote Mode** (connecting to your live Cloudflare D1 database).
208
+
209
+
### Option 1: Local Backend (Default)
210
+
*Use this for safe development without affecting production data.*
211
+
212
+
1. **Start Frontend**:
213
+
```bash
214
+
npm run dev
215
+
```
216
+
(Runs on `http://localhost:5173`)
217
+
218
+
2. **Start Backend** (in a new terminal):
219
+
```bash
220
+
npm run dev:backend
221
+
```
222
+
(Runs on `http://localhost:8787` using a local SQLite file)
223
+
224
+
### Option 2: Remote Backend (Live Data)
225
+
*Use this to debug with your actual production database.*
226
+
227
+
1. **Start Frontend**:
228
+
```bash
229
+
npm run dev
230
+
```
231
+
232
+
2. **Start Backend** (in a new terminal):
233
+
```bash
234
+
npm run dev:backend:remote
235
+
```
236
+
(Runs on `http://localhost:8787` but connects to your generic Cloudflare D1 DB)
// Fetch more emails to better support client-side search
51
-
awaitapiFetch<unknown>(`/api/emails?limit=100&offset=0`);// Keeping 'any' for now or defining type if possible, but 'any' is easiest if structure varies.
52
-
// Wait, I should try to fix 'any' if possible.
53
-
// The lint complained about apiFetch<any>.
54
-
// Let's use 'unknown' or a better type.
55
-
// But apiFetch<T> returns T.
56
-
// Let's define the expected response.
57
-
/*
58
-
The worker returns either an array (if standard) or { results: ... } (if D1).
0 commit comments