How nr-labs-digital/only-one-coin works
Only One Coin is an academic platform: a public multilingual site feeds a four-step enrollment journey, while students use a portal and staff manage academic and administrative work in a backoffice. The Fastify API supplies real enrollment, student, staff, and feature-flag capabilities, backed by Postgres; enrollment notifications use an outbox and email workers. The graph preserves the major documented surfaces and operational domains. Some app/API and worker wiring is not shown in the sampled source, so those relationships are cited to the README or omitted where uncertain.
Main entry points: app.ts HTTP API · DrizzlePublicEnrollmentRepository.ts Enrollment persistence · enrollment Enrollment wizard · send-email.worker.ts Email workers
Components 20
Public discovery
- Public site
apps/landing/src/i18n/ui.ts
Enrollment and portal
- Web app
apps/app/src/app/[locale] - Enrollment wizard
apps/app/src/app/[locale]/enrollment - Student portal
apps/app/src/app/[locale]/portal
Staff operations
- Staff backoffice
apps/app/src/app/[locale]/backoffice
API and domain
- HTTP API
apps/api/src/app.ts - Enrollment domain
packages/domain/src/enrollment - Student domain
packages/domain/src/student - Staff identity
packages/domain/src/identity - Course catalog
packages/domain/src/catalog - Feature flags
apps/app/src/lib/feature-flags/server.ts
Persistence and messaging
- Postgres
packages/db/src/schema.ts - Enrollment persistence
apps/api/src/infra/persistence/enrollment/DrizzlePublicEnrollmentRepository.ts - Student directory query
apps/api/src/infra/persistence/student/ListStudentsQuery.ts - Email outbox
apps/api/src/infra/persistence/notification/DrizzleOutboxRepository.ts - Email workers
apps/api/src/workers/send-email.worker.ts - Job queue
packages/queue/src/connection.ts
Other components
- Prospective student
- Brevo email
- External payment
Connections 19
- Prospective student → Public site: browses
- Prospective student → Enrollment wizard: starts enrollment
- Public site → Web app: redirects CTAs
- Enrollment wizard → External payment: uploads receipt for
- Enrollment wizard → HTTP API: submits enrollment
- HTTP API → Enrollment domain: handles enrollment
- HTTP API → Student domain: handles students
- HTTP API → Staff identity: handles staff access
- HTTP API → Course catalog: serves catalog
- Staff backoffice → HTTP API: uses API
- Student portal → HTTP API: uses API
- Web app → Feature flags: gates sections
apps/app/src/lib/feature-flags/server.ts - Enrollment persistence → Postgres: reads and writes
apps/api/src/infra/persistence/enrollment/DrizzlePublicEnrollmentRepository.ts - Enrollment persistence → Email outbox: queues email
apps/api/src/infra/persistence/enrollment/DrizzlePublicEnrollmentRepository.ts - Enrollment persistence → Enrollment domain: persists domain records
apps/api/src/infra/persistence/enrollment/DrizzlePublicEnrollmentRepository.ts - Student directory query → Postgres: queries students
apps/api/src/infra/persistence/student/ListStudentsQuery.ts - Email workers → Job queue: processes jobs
- Email workers → Brevo email: delivers email
- Email outbox → Job queue: relayed to