Architecture overview
How the eleven blueprint modules fit together—auth, data, money, feeds, and ops.
How the pieces collaborate
Identity lands in users (OAuth, email, or Web3/SIWE). The Profile & unified modules layer owns user_profiles and module/website tables for the public page. Payments writes orders and credits. Cron jobs fill news / price / gas caches and drive notifications. Short links map codes to users via short_links. Sync & invite moves content between users using content_sync_records and user_invitations. Admin operates across presets and caches with ADMIN_EMAILS-gated APIs. Dokploy (or any host) is where you wire env so all of the above can reach Postgres and third parties.
flowchart TB
subgraph identity["Identity"]
O[OAuth / email]
W[Web3 / SIWE]
end
U[(users)]
O --> U
W --> U
U --> P[Profile and modules]
P --> M[(user_profiles, module tables)]
U --> Pay[Payments]
Pay --> OC[(orders, credits)]
Cron[Cron jobs] --> NC[(news and price caches)]
NC --> NF[News feeds API]
NF --> App[Readers and UI]
U --> SL[Short links]
SL --> SLT[(short_links)]
U --> Sy[Sync and invite]
Sy --> SyT[(content_sync_records, user_invitations)]
U --> Ns[Notifications]
Ns --> Ps[(push_subscriptions, reminder subs)]
Ad[Admin] --> Ops[Presets, cache, debug APIs]Module map
| Module | Role in the system | Typical next step after auth |
|---|---|---|
| OAuth | Google/GitHub/email providers via NextAuth | Session established → Profile |
| Web3 auth | WalletConnect + SIWE when NEXT_PUBLIC_WEB3_ENABLED is true (optional WEB3_ENABLED fallback via /api/runtime-config) | Same users row, wallet fields |
| Profile & modules | Public profile, modules, websites | Data in user_profiles + module tables |
| Payments | Stripe/Creem checkout → credits | orders / credits updated |
| Short links | /i/[code], /u/[shortId] | short_links + users.id |
| News feeds | Read APIs over cached news | Filled by Cron and admin tools |
| Notifications | Web Push, Alpha reminders | push_subscriptions, VAPID |
| Sync & invite | Pending sync, invitations, tokens | content_sync_records, user_invitations |
| Admin | Presets, news ops, stats | ADMIN_EMAILS + admin routes |
| Cron | Scheduled refresh, notify pipelines | CRON_SECRET_KEY + Bearer auth |
| Dokploy | Deployment and env wiring | Set DATABASE_URL, secrets, redeploy |
Environment and DB
Each module page ends with a [Dependencies] section listing environment variables and database tables (see src/db/schema.ts). Start from Dokploy for a host-level checklist, then drill into the module you are changing.