Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ae99931
fix(campaigns): revalidate moderation routes and harden report queue …
JOY Nov 18, 2026
1da02c1
fix(campaigns): harden organizer list UX, statement preview, and home…
JOY Nov 18, 2026
402e8b3
fix(campaigns): prevent replaced-cover exposure, guard cleanup, and f…
JOY Nov 19, 2026
3108be3
feat(email): email outbox and first transactional emails (#254) (#257)
JOY Nov 19, 2026
b73c629
fix(campaigns): fix ShareButtons timer race, add component tests, and…
JOY Nov 19, 2026
25895e4
feat(campaigns): add privacy-preserving pitch video player and milest…
JOY Nov 19, 2026
2697227
docs(design): recurring monthly donations model (#255) (#256)
JOY Nov 19, 2026
9b9e244
feat(campaigns): add organizer YouTube pitch video editor and inline …
JOY Nov 19, 2026
77b8be0
docs(po): add agent_model and gatekeeper_model to PO config (#280)
JOY Nov 19, 2026
1f18dc3
feat(campaigns): add campaign status history disclosure to admin mode…
JOY Nov 19, 2026
d29fba2
feat(campaigns): add BreadcrumbList JSON-LD and sync Wave-4 changelog…
JOY Nov 19, 2026
7da95ad
feat(campaigns): add draft campaign updates workflow (#281) (#286)
JOY Nov 19, 2026
18c7a2f
feat(campaigns): show status history in organizer workspace and sync …
JOY Nov 19, 2026
9bdc181
feat(email): provider-neutral SES transport, hold on SES daily quota …
JOY Nov 19, 2026
469772b
chore(deps): bump read-excel-file from 9.3.13 to 9.3.17 (#289)
dependabot[bot] Nov 20, 2026
80e200d
feat(monthly): monthly donations plan A: sign-up, plan view, stop lin…
JOY Nov 20, 2026
e1a88bd
docs(po): update product-owner-config for CC-PO v2.18.0 parallel POs …
JOY Nov 21, 2026
baae5f2
docs(agents): forbid local Docker and local Supabase, point database …
JOY Nov 21, 2026
8ff173e
feat(web): organizer campaign analytics tracking & Thống kê tab (#295)
JOY Nov 21, 2026
826af67
feat(web): campaign comments with 1-level replies and moderation (#296)
JOY Nov 22, 2026
e6d51f8
feat(web): public organizer profile /u/[handle], /me editor & campaig…
JOY Nov 22, 2026
4a07a3d
feat(web): co-organizers invites, editor workspace guards, team tab &…
JOY Nov 22, 2026
c595676
docs(campaigns): sync CHANGELOG/README for #250-#253 wave and fix 2 P…
JOY Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .cursor/rules/000-core-setup.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Tôi cần AI làm tự động nhiều nhất có thể, ít phải động tay
- **Runtime**: Node.js v22, PowerShell 7 (Windows 11)
- **Frontend**: Next.js, React, TypeScript
- **Backend**: Strapi CMS v5.15+, Node.js APIs
- **Database**: PostgreSQL v17+ chạy trong docker container tên DB
- **DevOps**: Docker, Docker Compose
- **Database**: shared DOS Supabase, schema `give`; DDL and pgTAP tests live in DOS/DOS.Me and run in its GitHub CI
- **Local Docker / local Supabase**: forbidden for Give work (owner decision 2026-11-21); read `AGENTS.md`, which overrides this file
- **Future**: Flutter (mobile development)

## 🤖 AI AUTOMATION PRINCIPLES
Expand All @@ -36,7 +36,6 @@ Tôi cần AI làm tự động nhiều nhất có thể, ít phải động tay
### Project Structure
- Tạo file structure hoàn chỉnh cho new projects
- Include package.json với correct dependencies
- Setup Docker files khi cần
- Tạo environment files (.env.example)

## 📁 WORKSPACE PATTERNS
Expand Down
36 changes: 36 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Agent instructions for Give

These rules apply to every coding agent working on Give (Claude Code, Codex,
Qwen Code, Gemini, Antigravity, Cursor and others). `QWEN.md`, `GEMINI.md` and
`.cursor/rules` point here.

## No local Docker, no local Supabase

Local Docker and local Supabase are forbidden for Give work (owner decision
2026-11-21). Do not run `supabase start`, `supabase db start`,
`supabase db reset`, `supabase test db`, `docker run`, `docker build`,
`docker compose up`, or anything else that creates containers or databases on
the developer's machine. Forgotten local test databases filled the machine
before; this rule exists so that never happens again.

- **Database tests (pgTAP) and migration replay run in GitHub CI on the
DOS/DOS.Me PR.** All `give` schema DDL and its pgTAP suites live in
DOS/DOS.Me (`supabase/migrations`, `supabase/tests/database/give_*.test.sql`).
Push the DOS.Me branch, open the PR and read the CI result: the
`Supabase migration replay (<base>)` check replays every migration in a fresh
database, and the `Give pgTAP tests (<base>)` check runs the Give suites and
logs each suite's test count.
- **App checks run without Docker:** `pnpm format:check`, `pnpm lint`,
`pnpm typecheck`, `pnpm test` (Vitest) and `pnpm build`, the same checks the
`Lint` and `Build all apps` CI jobs run.
- **If you think you need a local database, ask the Product Owner (PO)
instead.** Do not work around this rule.

## Other rules

- This repository never changes the database schema; DDL goes through a
DOS/DOS.Me PR and follows DOS.Me's `AGENTS.md`.
- How the PO runs this repository (board, branches, gates, required checks) is
in [docs/product-owner-config.md](docs/product-owner-config.md); the product
and money design is in
[docs/Give-Technical-Design.md](docs/Give-Technical-Design.md).
297 changes: 297 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Gemini instructions

Read [AGENTS.md](AGENTS.md) and follow it. In short: no local Docker and no
local Supabase for Give work; database tests run in GitHub CI on the DOS/DOS.Me
PR.
5 changes: 5 additions & 0 deletions QWEN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Qwen Code instructions

Read [AGENTS.md](AGENTS.md) and follow it. In short: no local Docker and no
local Supabase for Give work; database tests run in GitHub CI on the DOS/DOS.Me
PR.
52 changes: 36 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,44 @@ only reports how many events are waiting. All cron routes need
`Authorization: Bearer $CRON_SECRET` (at least 16 characters) and refuse
everything when it is not set.

Monthly plans (DOS/Give#276): `GET /api/cron/issue-plan-donations` runs hourly
and `GET /api/cron/plan-notices` every 10 minutes. Each database function
handles one plan per call; the route calls it again with the last plan id
(`p_after`) until it answers no row or 45 seconds pass, so a run sweeps the
plans once and a retried or overlapping run creates nothing twice. Reminder
stop links are signed with `GIVE_RATE_LIMIT_SECRET` under a label of their
own (required in Production, at least 32 characters, and an error is logged
without it; previews and local runs fall back to the service-role key); the
database keeps only the token's hash. To rotate the secret without breaking
links already sent (60 days), set the old value as
`GIVE_RATE_LIMIT_SECRET_PREVIOUS` until they expire.

## Routes

| Route | Who | What |
| ----------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `/` | everyone | New campaigns and categories. |
| `/campaigns` | everyone | Discovery: filter by type and category, search title and summary. |
| `/campaigns/[slug]` | everyone | Public campaign page with reporting for signed-in visitors (hidden on previews and the organizer’s own campaign); the organizer and staff also see a preview before it is published. |
| `/start` | signed in | Organizer profile, then a new draft. |
| `/me/campaigns` | signed in | The organizer's campaigns. |
| `/me/campaigns/[id]` | the organizer | Editor: content, milestones, cover, submit, cancel, delete draft, updates. |
| `/me/campaigns/[id]/fulfillment` | the owning organizer | Fulfillment for back projects; paid pledges and delivery updates are available only after the project has succeeded. |
| `/admin` | moderators, admins | Review queue (approve, request changes) and organizer verification. |
| `/admin/reports` | moderators, admins | Campaign report queue: ask the organizer, dismiss reports, suspend campaigns or stop payment requests; no self-review. |
| `/api/cron/activate` | Vercel Cron | Activates scheduled campaigns. |
| `/api/cron/finalize-ended` | Vercel Cron | Closes ended give campaigns. |
| `/api/cron/reprocess-inbound` | Vercel Cron | Retries pending inbound events. |
| `/media/public/...`, `/media/private/...` | – | Cover images from the private `give-media` bucket, after a visibility check. |
| `/auth/login`, `/auth/callback`, `/auth/logout` | – | DOS.Me login flow. |
| Route | Who | What |
| ----------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/` | everyone | New campaigns and categories. |
| `/campaigns` | everyone | Discovery: filter by type and category, search title and summary. |
| `/campaigns/[slug]` | everyone | Public campaign page with comments (1-level replies and reporting), public team block when co-organizers are present, and campaign reporting for signed-in visitors (hidden on previews and the organizer’s own campaign); the organizer, accepted co-organizers and staff also see a preview before it is published. |
| `/u/[handle]` | everyone | Public organizer profile (bio, avatar, verification status and public campaigns). |
| `/start` | signed in | Organizer profile, then a new draft. |
| `/me` | signed in | Organizer public profile editor (`handle` and `bio`, preserving verification status). |
| `/me/campaigns` | signed in | The organizer's owned campaigns and accepted co-organizer (editor) campaigns. |
| `/me/campaigns/[id]` | owner / co-organizer | Editor (content, cover, pitch video, milestones, reward tiers, updates); owner-only tabs for `Thống kê` analytics (`?tab=analytics`), `Đội ngũ` co-organizer invites (`?tab=team`), lifecycle actions and money surfaces. |
| `/me/campaigns/[id]/fulfillment` | the owning organizer | Fulfillment for back projects; paid pledges and delivery updates are available only after the project has succeeded. |
| `/invites/[token]` | signed in | Single-use co-organizer invite preview and acceptance (`no-referrer`, `no-store`, `noindex`; guests are prompted to sign in). |
| `/admin` | moderators, admins | Review queue (approve, request changes) and organizer verification. |
| `/admin/reports` | moderators, admins | Campaign report queue: ask the organizer, dismiss reports, suspend campaigns or stop payment requests; no self-review. |
| `/admin/reports/comments` | moderators, admins | Reported campaign comments queue: hide/unhide comments, dismiss reports and view moderation history; no self-review. |
| `/api/analytics/event` | everyone (POST) | Privacy-safe same-origin campaign view and share-click event ingestion (bot-filtered, referrer-sanitized, rate-limited). |
| `/api/cron/activate` | Vercel Cron | Activates scheduled campaigns. |
| `/api/cron/finalize-ended` | Vercel Cron | Closes ended give campaigns. |
| `/api/cron/reprocess-inbound` | Vercel Cron | Retries pending inbound events. |
| `/api/cron/issue-plan-donations` | Vercel Cron | Monthly plans: issues each plan's donation for the month (once) and ends plans past the campaign's end; expires past months' unpaid plan donations. |
| `/api/cron/plan-notices` | Vercel Cron | Monthly plans: tells each donor once when a plan ends; second reminders where the account allows them. |
| `/plans/stop`, `/api/plans/stop` | – | Stop link of monthly plan reminders: the page asks first (GET changes nothing); POST, or the one-click `List-Unsubscribe` (RFC 8058), stops the plan. |
| `/media/public/...`, `/media/private/...` | – | Cover images from the private `give-media` bucket, after a visibility check. |
| `/auth/login`, `/auth/callback`, `/auth/logout` | – | DOS.Me login flow. |

## Security model

Expand Down
16 changes: 16 additions & 0 deletions apps/web/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,19 @@ OIDC_CLIENT_ID=
OIDC_CLIENT_SECRET=
# Shared secret Vercel Cron sends as "Authorization: Bearer <CRON_SECRET>".
CRON_SECRET=
# Email (DOS/Give#254): AWS SES over SMTP, the provider DOS.Me uses.
# EMAIL_DELIVERY: smtp (real mail) or log (mails nobody). Defaults to smtp in
# Production and log everywhere else. Outside Production, smtp reaches only
# EMAIL_ALLOWLIST (comma-separated addresses or @domain); others are logged.
# In log mode, ...@retry.invalid fails every attempt and ...@bounce.invalid
# fails permanently, to test retries and dead emails without a provider.
EMAIL_DELIVERY=log
EMAIL_ALLOWLIST=
SMTP_HOST=email-smtp.ap-southeast-1.amazonaws.com
SMTP_PORT=587
SMTP_USER=
SMTP_PASS=
EMAIL_FROM="Give <no-reply@give.vn>"
# Origin of links in emails; defaults to NEXT_PUBLIC_SITE_URL, then
# https://give.vn in Production. Set https://beta.give.vn for beta.
EMAIL_LINK_ORIGIN=
10 changes: 10 additions & 0 deletions apps/web/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ const nextConfig: NextConfig = {
{ key: "Cache-Control", value: "private, no-store" },
],
},
{
// Co-organizer invite URLs carry single-use secret tokens: never send a
// Referer from them, never cache them, and keep crawlers out (DOS/Give#253).
source: "/invites/:path*",
headers: [
{ key: "Referrer-Policy", value: "no-referrer" },
{ key: "Cache-Control", value: "private, no-store" },
{ key: "X-Robots-Tag", value: "noindex, nofollow" },
],
},
]
},
}
Expand Down
4 changes: 3 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
"clsx": "^2.1.1",
"jose": "^6.2.15",
"next": "^16.4.6",
"nodemailer": "10.3.1",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"react-markdown": "^10.1.0",
"read-excel-file": "9.3.13",
"read-excel-file": "9.3.17",
"server-only": "^0.0.1",
"sharp": "^0.35.5",
"uqr": "0.1.3",
Expand All @@ -27,6 +28,7 @@
"devDependencies": {
"@tailwindcss/postcss": "^4.3.5",
"@types/node": "^24",
"@types/nodemailer": "8.0.2",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^10.14.0",
Expand Down
Loading