|
1 | | -EDICTO — The official register of verified statements. |
2 | | - |
3 | | -Stack |
4 | | -- Next.js 14 App Router, React Server Components, TypeScript |
5 | | -- Tailwind CSS v4 |
6 | | -- Prisma + PostgreSQL |
7 | | -- NextAuth, Stripe, Resend, S3-compatible storage |
8 | | - |
9 | | -Getting Started |
10 | | -1) Install dependencies |
| 1 | +## EDICTO — The official register of verified statements |
| 2 | + |
| 3 | +EDICTO is a public, neutral platform that centralizes official communications from verified organizations (companies, institutions, NGOs). It provides transparent publishing, versioning, integrity proofs, powerful search, personalized monitoring, and open access for everyone. |
| 4 | + |
| 5 | +### Vision |
| 6 | +- Public-by-default register, not a social network |
| 7 | +- Verified sources only (domain/DNS/legal checks) |
| 8 | +- Tamper-resistant history (timestamps + SHA-256), readable diffs |
| 9 | +- Powerful research and monitoring for journalists, researchers, and institutions |
| 10 | + |
| 11 | +## Features (MVP) |
| 12 | +- Public browsing: home, explore, statement detail with versions, organization pages, topics, search, RSS |
| 13 | +- Organization verification: domain email + DNS TXT + optional legal docs; admin approval |
| 14 | +- Publishing & versioning: Markdown + PDF attachments; SHA-256, timestamps, diffs, current version pin |
| 15 | +- Integrity & proof: display hash, “Verify hash” button, version history |
| 16 | +- Search: Postgres FTS + trigram; filters by org/topic/date; Pro unlocks advanced facets/exports |
| 17 | +- Monitoring: follows, alerts (by org/keywords/conditions), in-app and email (digest/instant) |
| 18 | +- Realtime: live updates (SSE) on feed |
| 19 | +- API: public read endpoints; org write endpoint; webhooks (statement.published/updated) |
| 20 | +- Billing: Free vs Pro vs Team (Stripe); plan-based limits |
| 21 | +- Admin: verification queue, moderation, audit logs |
| 22 | + |
| 23 | +## Tech Stack |
| 24 | +- Next.js 14 (App Router, React Server Components) — TypeScript strict |
| 25 | +- Tailwind CSS v4 — design tokens (Navy #0B1B2B, Ivory #F7F3EA, Gold #C6A15B) |
| 26 | +- Prisma + PostgreSQL (Neon) — FTS (tsvector + triggers), trigram, JSONB metadata |
| 27 | +- Auth: NextAuth (Email magic link + optional OAuth later); Dev credentials for local |
| 28 | +- Emails: Resend (or SMTP); S3-compatible storage for PDFs/images |
| 29 | +- Realtime: SSE; Cron: Vercel Cron/Node cron; Rate limit: Redis (future) |
| 30 | + |
| 31 | +## App Structure (Routes) |
| 32 | +- Public: `/`, `/statements`, `/statements/[org]/[slug]`, `/org/[slug]`, `/topics`, `/topics/[slug]`, `/search`, `/pricing`, `/about`, `/help`, `/brand`, `/rss`, `/legal/privacy`, `/legal/terms`, `/legal/cookies`, `/legal/imprint` |
| 33 | +- User (auth): `/feed`, `/saved`, `/alerts`, `/settings`, `/billing` |
| 34 | +- Organization (verified): `/org/[slug]/dashboard`, `/publish`, `/verification`, `/api`, `/webhooks` |
| 35 | +- Admin: `/admin/verify`, `/admin/moderation`, `/admin/logs` |
| 36 | +- Onboarding: `/onboarding`, `/onboarding/org`, `/onboarding/user`, `/onboarding/user/preferences` |
| 37 | + |
| 38 | +## Data Model (Prisma overview) |
| 39 | +- Users (plans, locale, sessions, accounts) |
| 40 | +- Organizations (verified status, domains) |
| 41 | +- Statements + StatementVersions (content, hashSha256, PDFs, attachments) |
| 42 | +- Topics/Tags and many-to-many join tables |
| 43 | +- Follows, SavedStatements, SavedSearch, AlertRules, Notifications |
| 44 | +- ApiKeys, WebhookEndpoints, Integrations |
| 45 | +- VerificationRequest (with reviewer), AuditLog, ViewLog, BillingSubscription |
11 | 46 |
|
| 47 | +## Getting Started |
| 48 | +### 1) Install |
12 | 49 | ```bash |
13 | 50 | npm install |
14 | 51 | ``` |
15 | 52 |
|
16 | | -2) Configure environment |
17 | | - |
18 | | -Create `.env` from `.env.example` and set `DATABASE_URL` (Postgres) and other keys. |
19 | | - |
20 | | -3) Prisma |
| 53 | +### 2) Environment |
| 54 | +Create `.env` with at least: |
| 55 | +``` |
| 56 | +DATABASE_URL=postgresql://... |
| 57 | +NEXTAUTH_SECRET=change_me |
| 58 | +NEXTAUTH_URL=http://localhost:3000 |
| 59 | +DEV_AUTH=1 |
| 60 | +``` |
| 61 | +Email (optional): |
| 62 | +``` |
| 63 | +RESEND_API_KEY=... |
| 64 | +RESEND_FROM="EDICTO <no-reply@yourdomain.com>" |
| 65 | +``` |
21 | 66 |
|
| 67 | +### 3) Database |
22 | 68 | ```bash |
23 | 69 | npx prisma generate |
24 | 70 | npx prisma db push |
| 71 | +npm run db:seed |
| 72 | +npm run db:fts |
25 | 73 | ``` |
26 | 74 |
|
27 | | -4) Run the dev server |
28 | | - |
| 75 | +### 4) Run |
29 | 76 | ```bash |
30 | 77 | npm run dev |
31 | 78 | ``` |
32 | | - |
33 | | -## Getting Started |
34 | | - |
35 | | -First, run the development server: |
36 | | - |
37 | | -```bash |
38 | | -npm run dev |
39 | | -# or |
40 | | -yarn dev |
41 | | -# or |
42 | | -pnpm dev |
43 | | -# or |
44 | | -bun dev |
45 | | -``` |
46 | | - |
47 | | -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
48 | | - |
49 | | -You can start editing by modifying files under `app/`. |
50 | | - |
51 | | -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. |
52 | | - |
53 | | -## Learn More |
54 | | - |
55 | | -To learn more about Next.js, take a look at the following resources: |
56 | | - |
57 | | -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. |
58 | | -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. |
59 | | - |
60 | | -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! |
61 | | - |
62 | | -## Deploy on Vercel |
63 | | - |
64 | | -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. |
65 | | - |
66 | | -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. |
| 79 | +Open `http://localhost:3000`. |
| 80 | + |
| 81 | +## Authentication (Dev & Prod) |
| 82 | +- Dev: go to `/login` and click “Developer sign in (no email)” (requires `DEV_AUTH=1`). |
| 83 | +- Email magic link (no SMTP): link is logged to the dev console; you can also open `/api/dev/latest-token-link` to retrieve a clickable link. |
| 84 | +- Production: set `RESEND_API_KEY` and `RESEND_FROM` (or SMTP). DKIM/brand alignment recommended, but not required to start. |
| 85 | + |
| 86 | +## API (MVP) |
| 87 | +- Public read: |
| 88 | + - `GET /api/public/statements?query=&org=&topic=&from=&to=&page=` |
| 89 | + - `GET /api/public/orgs`, `GET /api/public/topics` |
| 90 | + - `GET /api/public/statements/by-slug?org=&slug=` |
| 91 | +- RSS: |
| 92 | + - `/rss/org/[slug].xml`, `/rss/topic/[slug].xml`, `/rss/search/[id].xml` |
| 93 | +- Org write (verified): |
| 94 | + - `POST /api/org/publish` — create statement + v1 (hash, timestamps, notify) |
| 95 | + |
| 96 | +## Scripts |
| 97 | +- `dev` — start Next.js |
| 98 | +- `db:push` — apply Prisma schema |
| 99 | +- `db:seed` — seed demo data |
| 100 | +- `db:fts` — install FTS triggers |
| 101 | +- `lint`, `build` |
| 102 | + |
| 103 | +## Deployment |
| 104 | +- Frontend: Vercel (recommended) |
| 105 | +- Database: Neon (Postgres) |
| 106 | +- Storage: S3-compatible provider (R2/MinIO) |
| 107 | +- Emails: Resend/SMTP |
| 108 | +- Billing: Stripe (Pro/Team), with webhooks |
| 109 | + |
| 110 | +## Roadmap |
| 111 | +- AI summaries & translation on publish (worker) |
| 112 | +- Advanced Pro search facets and exports |
| 113 | +- SSE feed for followed orgs |
| 114 | +- Admin tooling: verification queue, moderation actions |
| 115 | +- API docs (OpenAPI) and /api/docs |
| 116 | + |
| 117 | +## Contributing & License |
| 118 | +- See CI workflow in `.github/workflows/ci.yml`; PRs welcome via issues and templates. |
| 119 | +- License: MIT (see `LICENSE`). |
0 commit comments