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: .github/SECRETS.md
+4-12Lines changed: 4 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,15 @@ Configure under **Settings → Secrets and variables → Actions** for [adab-tec
4
4
5
5
| Secret | Required | Purpose |
6
6
|--------|----------|---------|
7
-
|`FLY_API_TOKEN`| For GitHub deploy | Deploy to Fly.io via Actions (`workflow_dispatch`) |
8
7
|`GOOGLE_API_KEY`| Optional | Google Custom Search API (higher quota than scrape fallback) |
9
8
|`GOOGLE_CSE_ID`| Optional | Custom Search Engine ID (pair with `GOOGLE_API_KEY`) |
10
9
11
-
### Fly.io deploy token
12
-
13
-
After `flyctl auth login` on your machine:
14
-
15
-
```powershell
16
-
flyctl tokens create deploy -a adab-opportunityfinder
17
-
gh secret set FLY_API_TOKEN --repo adab-tech/OpportunityFinder
18
-
```
19
-
20
-
Then run **Actions → Deploy to Fly.io → Run workflow** on GitHub, or use `.\scripts\deploy-fly.ps1` locally.
21
-
22
10
CI runs without these secrets (SQLite + smoke tests only). For production scraping performance, add both keys from [Google Programmable Search](https://developers.google.com/custom-search/v1/introduction).
23
11
12
+
Production deploy credentials (Render, Cloudflare) live in each platform's
13
+
own dashboard, not as GitHub Actions secrets — see docs/DEPLOY-RENDER.md and
14
+
docs/DEPLOY-CLOUDFLARE-WORKERS.md.
15
+
24
16
**Local setup:** copy `backend/.env.example` to `backend/.env` and fill values.
Global Opportunities is an AI-assisted opportunity discovery app for scholarships, fellowships, grants, and jobs.
3
+
Global Opportunities is an AI-assisted discovery site for scholarships, fellowships, grants, and jobs — plain-English summaries, real deadlines, refreshed automatically.
4
4
5
-
## What is included
5
+
**Live:**https://globalopportunities.app
6
6
7
-
-`backend/` - FastAPI API, database, scraping, and scheduled refresh jobs
8
-
-`frontend/` - static UI that talks to the API
9
-
-`opportunities.db` - local SQLite database used during development
7
+
## Architecture
10
8
11
-
## Quick start (Windows)
9
+
-`backend/` — FastAPI API, Postgres (via [Neon](https://neon.tech)), scraping/RSS ingest, and scheduled refresh jobs. Deployed on [Render](https://render.com).
10
+
-`frontend/` — static UI, no build step, served from Cloudflare's edge via a Worker (`worker/index.js` + `wrangler.jsonc`). The same worker proxies `/api/*`, `/health`, `/docs`, `/openapi.json`, and `/redoc` to the Render backend, so the browser only ever sees one origin.
Double-click `start.bat` in the repo root. The app opens at http://127.0.0.1:8000/ with curated opportunities loaded immediately; a background scrape adds more within a few minutes. Click **Find New** anytime to refresh.
13
+
See [docs/DEPLOY-RENDER.md](docs/DEPLOY-RENDER.md) and [docs/DEPLOY-CLOUDFLARE-WORKERS.md](docs/DEPLOY-CLOUDFLARE-WORKERS.md) for the full deploy story, and [docs/DEPLOY.md](docs/DEPLOY.md) for local development and Docker.
Copy `backend/.env.example` to `backend/.env` first. With nothing else set, the app runs on SQLite and logs alert/save-confirmation emails to the console instead of sending them.
40
29
41
-
The repo also includes `frontend/config.js` as the deployment hook for that value.
42
-
Edit it when you want to point the static frontend at a separate backend host.
43
-
44
-
If you are running locally from `file://`, the app falls back to `http://127.0.0.1:8000/api/v1`.
30
+
### Frontend
45
31
46
-
## Optional search API keys
32
+
Serve `frontend/` with any static web server; it talks to the API at the same origin (`/api/v1`) by default. To point it at a separately-hosted backend, set `window.OPPORTUNITYFINDER_API_BASE` in `frontend/config.js`.
47
33
48
-
`backend/.env.example` includes optional Google Custom Search settings:
34
+
### Windows quick start
49
35
50
-
-`GOOGLE_API_KEY`
51
-
-`GOOGLE_CSE_ID`
36
+
Double-click `start.bat` — creates a venv, installs backend dependencies, and opens the app at http://127.0.0.1:8000/. Local only, not how production runs.
52
37
53
-
Without those keys, the scraper falls back to public search scraping.
38
+
## Optional discovery API keys
54
39
55
-
## Deploy to the web
40
+
`backend/.env.example` documents `GOOGLE_API_KEY` / `GOOGLE_CSE_ID` (Google Custom Search) and `YOU_API_KEY` (You.com) — both optional. Without them, the scraper falls back to public search scraping.
56
41
57
-
**Recommended:** one container serves the UI and API on the same domain (simplest for users).
42
+
## Email alerts
58
43
59
-
| Method | Guide | CLI needed? |
60
-
|--------|--------|-------------|
61
-
|**Render** (easiest public URL) |[docs/DEPLOY-RENDER.md](docs/DEPLOY-RENDER.md)| No — GitHub + dashboard |
Alert and save-confirmation emails are logged to the console by default — no provider required to run or test the feature end-to-end. Set `RESEND_API_KEY`, `BREVO_API_KEY`, or `SENDGRID_API_KEY` to send them for real; see `backend/app/services/email_sender.py`.
64
45
65
-
Production uses **PostgreSQL** (`DATABASE_URL`) and **RSS feeds** for reliable ingest (ReliefWeb, Scholars4Dev, Opportunity Desk, and more). Optional Google CSE keys still improve discovery.
46
+
## Tests
66
47
67
-
## Production notes
48
+
```powershell
49
+
cd backend && python -m pytest tests -v
50
+
cd frontend && npm test
51
+
```
68
52
69
-
- Set `DATABASE_URL` to Postgres in production (see `docker-compose.yml` or Fly Postgres).
70
-
-`ENABLE_SCHEDULER=true` on a single instance runs periodic RSS + scrape jobs.
71
-
-`CORS_ORIGINS` defaults to `*`; restrict when the frontend is on another host.
72
-
- Health: `GET /health` (used by Fly.io checks).
53
+
CI (`.github/workflows/ci.yml`) runs both suites plus `ruff` lint on every push/PR to `main`.
One domain, one container: FastAPI serves `/api/v1`and the static`frontend/`on the same origin (no CORS headaches).
3
+
Production is two pieces: the **backend** (FastAPI + Postgres) on Render, and the **frontend** (static, no build step) on Cloudflare Workers at the edge, which proxies API calls back to Render so the browser only ever sees one origin. See:
4
4
5
-
## Option A — Docker Compose (local production test)
5
+
-[DEPLOY-RENDER.md](DEPLOY-RENDER.md) — backend + database, from zero to a live URL
6
+
-[DEPLOY-CLOUDFLARE-WORKERS.md](DEPLOY-CLOUDFLARE-WORKERS.md) — moving the frontend to the edge and wiring up the custom domain
And set `CORS_ORIGINS` on the API to your Pages URL.
75
-
76
22
## Environment reference
77
23
78
-
Copy `backend/.env.example` to `backend/.env` for local dev.
24
+
Copy `backend/.env.example` to `backend/.env` for local dev. Full definitions live in `backend/app/config.py`; highlights:
79
25
80
26
| Variable | Purpose |
81
27
|----------|---------|
82
28
|`DATABASE_URL`| SQLite locally; Postgres in production. Prefer [Neon](https://neon.tech)'s free tier over a platform's own free Postgres (e.g. Render) — Render's free Postgres auto-deletes the database 30 days after creation, which has already caused a production outage; Neon's free tier only autosuspends compute when idle and never deletes data. |
83
-
|`ENABLE_SCHEDULER`| Background RSS + scrape jobs |
84
-
|`CORS_ORIGINS`| Comma-separated origins, or `*`|
85
-
|`PORT`| Set by Fly/Railway/Render (uvicorn listens here) |
|`RESEND_API_KEY` / `BREVO_API_KEY` / `SENDGRID_API_KEY`| Optional; unset means alert/save-confirmation emails are logged, not sent. If more than one is set, Resend takes priority, then Brevo. |
33
+
|`ADMIN_EMAIL` / `ADMIN_PASSWORD_HASH` / `SESSION_SECRET_KEY`| Required together for admin login (analytics + moderation queue). Generate the hash with `backend/scripts/hash_admin_password.py`. Unset means admin endpoints refuse every request. |
34
+
|`PUBLIC_BASE_URL`| Builds the manage-your-alerts link in outgoing emails; set to your real domain in production. |
88
35
89
36
## Health check
90
37
@@ -95,12 +42,6 @@ Copy `backend/.env.example` to `backend/.env` for local dev.
0 commit comments