Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
988e9ee
fix(iris): report disabled test notifications instead of a render fai…
Dasa122 Nov 10, 2026
53c07eb
feat(mail): render an optional details block in notification emails
Dasa122 Nov 10, 2026
586bc2e
feat(chronos): build substitution and moved-lesson email details and …
Dasa122 Nov 10, 2026
e2ee51f
fix(chronos): name the substitute teacher and complete the moved-less…
Dasa122 Nov 10, 2026
7d7d108
feat(iris): preview real notification records and desktop/phone sizes
Dasa122 Nov 10, 2026
abd4e1b
refactor(chronos): share the substitution notification payload
Dasa122 Nov 10, 2026
bca65bd
fix: fit the phone preview inside the dialog and log skipped substitu…
Dasa122 Nov 10, 2026
7287e91
feat: enhance email notifications with highlights and dedicated SMTP …
Dasa122 Nov 12, 2026
f0ff72e
feat(mail): send notification email through Microsoft Graph
Dasa122 Nov 12, 2026
7703f54
feat(notifications): split delivery into email, push and in-app channels
Dasa122 Nov 12, 2026
8ff3989
feat(notifications): channel switches in settings and a manage link i…
Dasa122 Nov 12, 2026
fe8f784
fix(notifications): resolve legacy channel preferences on read and write
Dasa122 Nov 12, 2026
a860537
fix(iris): compare the login redirect by origin and prefetch settings
Dasa122 Nov 12, 2026
c5ce3b3
refactor(notifications): resolve preferences through the shared helpers
Dasa122 Nov 12, 2026
8a0c38a
feat(notifications): role-aware email defaults and teacher email auto…
Dasa122 Nov 12, 2026
5e3b6f8
perf(notifications): index teacher links and share the role predicate
Dasa122 Nov 12, 2026
3589e3a
refactor(notifications): drop the in-app preference flag
Dasa122 Nov 14, 2026
471b6c5
refactor(notifications): drop the push preference flag
Dasa122 Nov 14, 2026
a159259
chore(iris): simplify notification channel copy
Dasa122 Nov 14, 2026
65ced38
feat(notifications): rich in-app notification details
Dasa122 Nov 14, 2026
8a32841
fix(chronos): keep a pending moved-lesson notification on failed edits
Dasa122 Nov 14, 2026
e405312
fix(notifications): one mail locale rule, localized test mails, saved…
Dasa122 Nov 14, 2026
315f611
feat(notifications): notify teachers when their lesson is moved
Dasa122 Nov 14, 2026
8260c0c
fix(notifications): keep teacher-linked users out of the student less…
Dasa122 Nov 14, 2026
1a7cc05
feat(notifications): make announcement email an opt-in preference
Dasa122 Nov 14, 2026
9cbbbf8
feat(notifications): a notification stops being unread once its day h…
Dasa122 Nov 14, 2026
bc91662
fix(i18n): call announcements "hírek" in the hu notification preferences
Dasa122 Nov 14, 2026
a86214a
fix(api): keep teacher email out of the public substitution data
Dasa122 Nov 14, 2026
1433333
fix(notifications): harden delivery, unsubscribe and inbox reads
Dasa122 Nov 14, 2026
c7bd172
fix(i18n): correct the notification preference and unsubscribe copy
Dasa122 Nov 14, 2026
e9ea7e4
fix(iris): address the branch review findings in settings, auth and n…
Dasa122 Nov 14, 2026
d96d98e
fix(mail): guard headers, cap the MIME size and frame transport failures
Dasa122 Nov 14, 2026
27e6b03
feat(notifications): send a List-Unsubscribe header on notification mail
Dasa122 Nov 14, 2026
f3564c2
fix(mail): fall back to English copy and key template rows by index
Dasa122 Nov 14, 2026
98cae62
test(mail): cover the Entra request, the Graph retry rules and the te…
Dasa122 Nov 14, 2026
ce538b9
docs(api): document the notification preferences and the preview enti…
Dasa122 Nov 14, 2026
e96f444
feat(notifications): always deliver system messages in-app and by email
Dasa122 Nov 15, 2026
e5d38bd
fix(notifications): report the real FCM delivery outcome
Dasa122 Nov 16, 2026
fba798f
fix(mail): honour Graph Retry-After verbatim and schedule the retry
Dasa122 Nov 16, 2026
c35e0ff
fix(iris): patch only the notification preferences the user changed
Dasa122 Nov 16, 2026
b8b38f8
fix(iris): drop the mark-as-unread affordance that never existed
Dasa122 Nov 16, 2026
86f838c
feat(i18n): add @filcdev/i18n with the notification and mail catalogue
Dasa122 Nov 17, 2026
442c8f0
refactor(notifications): read every string from @filcdev/i18n and ded…
Dasa122 Nov 17, 2026
3286709
refactor(iris): reduce the preference state and share the auth schema
Dasa122 Nov 17, 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ thoughts
.opencode
.codegraph
graphify-out/

build.env
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
- [apps/chronos](apps/chronos) is the oRPC + Drizzle backend: it implements the contract from `packages/api` and serves an RPC endpoint for the apps plus an OpenAPI surface for external clients.
- [packages/api](packages/api) is the shared API contract package (`@filcdev/api`): the oRPC contract, the zod wire schemas per domain, the error map, permission constants and the typed client factory. Chronos implements the contract, iris and kiosk consume it, and it is the only place endpoint metadata lives. Future apps calling the Chronos API should depend on this package instead of the Chronos workspace.
- [packages/auth](packages/auth) is the shared auth surface (`@filcdev/auth`): the better-auth user fields, the session/user types and the browser client (`authClient`, `useSession`). Chronos passes the fields to better-auth and the apps read the client; `apps/chronos/src/_types/auth.ts` proves at compile time that the two still agree.
- [packages/mail](packages/mail) is the shared email package (`@filcdev/mail`): the SMTP transport (`createMailTransport`) and the react-email templates (`renderEmail`), carrying the Filc email styling and copy. Chronos renders and sends every notification email through it ([apps/chronos/src/utils/notifications/providers/smtp.ts](apps/chronos/src/utils/notifications/providers/smtp.ts) wires env and the per-type labels into it), so template markup and email copy live in `packages/mail/src/templates`.
- [packages/mail](packages/mail) is the shared email package (`@filcdev/mail`): the two transports — SMTP (`createMailTransport`, basic or Entra XOAUTH2) and Microsoft Graph (`createGraphTransport`) — plus the react-email templates (`renderEmail`), carrying the Filc email styling and copy. [docs/email-setup.md](docs/email-setup.md) covers the Entra app, the transport choice and the env it needs. Chronos renders and sends every notification email through it ([apps/chronos/src/utils/notifications/providers/smtp.ts](apps/chronos/src/utils/notifications/providers/smtp.ts) wires env and the per-type labels into it), so template markup stays in `packages/mail/src/templates`; every notification and mail string lives in `packages/i18n`.
- [packages/i18n](packages/i18n) is the shared translation package (`@filcdev/i18n`): the i18next instance and locale rule behind `createTranslator`, the mail date/period formatters, and the `notifications` string catalogues under `locales/<en|hu>`. It owns every notification and mail string — a template carries markup, never copy.
- [packages/ui](packages/ui) is the shared design system (`@filcdev/ui`): the shadcn-style primitives, `cn`, `useIsMobile`, the theme tokens in `globals.css`, the seasonal skins in `themes.css`, their emoji motifs in `lib/site-theme-art` + `components/site-theme-art` (`SiteThemeArt` for a panel, `SiteThemeBackdrop` once per app — no image assets), and `applySiteTheme`/`DEFAULT_SITE_THEME` in `lib/site-theme`, the attribute the skins key on. Iris imports them as `@filcdev/ui/components/*`, `@filcdev/ui/lib/utils`, `@filcdev/ui/hooks/*`, `@import "@filcdev/ui/globals.css"`, `@import "@filcdev/ui/themes.css"` (plus an `@source` for the package). App-agnostic primitives belong here; app-specific composition stays in the app, so an app opts into the seasonal skins with those two imports, one `applySiteTheme` call and one `<SiteThemeBackdrop>`, and its own route/API code (e.g. iris' admin picker) stays in the app. Changing a token in `globals.css` reaches every app and every skin — never copy a palette into an app. The layer order (`globals.css` → `schemes.css` → `themes.css`) *is* the precedence, and [docs/theming.md](docs/theming.md) has the recipe for adding a skin or a palette.
- [apps/iris](apps/iris) is the React + Vite frontend.

Expand All @@ -15,7 +16,7 @@
- Use `bun` only. Do not switch to `npm`, `pnpm`, or `yarn`.
- Run validation from the repo root in this order: `bun install` when dependencies change, `bun lint`, `bun typecheck`, `bun run build`.
- Do not use bare `bun build` from the repo root; the root build command is `bun run build`.
- No reliable repo-wide test command is documented. Do not invent one unless the task is explicitly about adding tests.
- Tests: `bun run test` at the root runs every workspace's suite (`turbo run test`); each package can be run on its own with `bun test` from its directory. Chronos' suite is `bun test --isolate ./src/utils ./src/modules/notifications` — `--isolate` gives each test file a fresh module registry, because `mock.module()` is permanent for the process and would leak between files.
- Local Postgres is managed by the `pg-dispo` script (`pg-dispo start|stop|wipe`), not Docker Compose or devcontainers.

## Conventions
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This guide gets you from a fresh clone to a running dev environment, then covers

- **Disposable container (recommended)**: the [`pg-dispo`](https://gist.github.com/nemvince/89c8f12e8dd4f4eec8d31aa9a9018a73#file-pg-dispo) script — a single command that starts a Postgres 16+ container with defaults `postgresql://postgres:postgres@localhost:5432/postgres`.

- **Compose stack**: `docker compose up -d` at the repo root runs Postgres 18 (Alpine) and [Mailpit](https://mailpit.axllent.org) (SMTP capture). Uncomment the SMTP block in [`apps/chronos/.env.example`](apps/chronos/.env.example) to route Chronos email through Mailpit; the web UI is at <http://localhost:8025>. Only use one Postgres source at a time — both bind host port 5432.
- **Compose stack**: `docker compose up -d` at the repo root runs Postgres 18 (Alpine) and [Mailpit](https://mailpit.axllent.org) (SMTP capture). Uncomment the SMTP block in [`apps/chronos/.env.example`](apps/chronos/.env.example) to route Chronos email through Mailpit; the web UI is at <http://localhost:8025>. Only use one Postgres source at a time — both bind host port 5432. Production does not use Mailpit: there Chronos sends through Microsoft Graph, documented in [`docs/email-setup.md`](docs/email-setup.md).

1. Clone and install:

Expand Down
45 changes: 26 additions & 19 deletions apps/chronos/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,17 @@ CHRONOS_MODE=development
# --------------------------------------------------
# | Notification system |
# --------------------------------------------------
# Which transport delivers notification email: "smtp" (the default) or "graph"
# (Microsoft Graph app-only Mail.Send, configured in the production block
# below).
# CHRONOS_MAIL_TRANSPORT=smtp

# SMTP delivery for the Mailpit service in the local dev compose stack
# (see compose.yml — web UI http://localhost:8025, SMTP localhost:1025).
# Leave the block commented when using pg-dispo without Mailpit: with no SMTP
# host configured, Chronos disables email delivery instead of failing sends.
# Uncomment it when running the compose stack:
# This block needs CHRONOS_MAIL_TRANSPORT=smtp, the default. Leave it commented
# when using pg-dispo without Mailpit: with no SMTP host configured, Chronos
# disables email delivery instead of failing sends. Uncomment it when running
# the compose stack:
# CHRONOS_SMTP_HOST=localhost
# CHRONOS_SMTP_PORT=1025
# CHRONOS_SMTP_USER=
Expand All @@ -110,21 +116,25 @@ CHRONOS_MODE=development
# and Outlook.com, which reject basic auth). Defaults to "basic".
# CHRONOS_SMTP_AUTH=basic

# Sending from Exchange Online / Outlook.com (SMTP AUTH OAuth 2.0):
# CHRONOS_SMTP_AUTH=oauth2
# CHRONOS_SMTP_HOST=smtp.office365.com
# CHRONOS_SMTP_PORT=587
# CHRONOS_SMTP_SECURE=false
# CHRONOS_SMTP_USER=school@example.com (the mailbox to send as; falls back to
# CHRONOS_SMTP_FROM_EMAIL when unset)
# Production: Microsoft Graph app-only Mail.Send
# The mail app needs the Microsoft Graph "Mail.Send" application permission
# (+ admin consent), a service principal registered in Exchange, and send access
# on the mailbox — see docs/email-setup.md for the Entra app and Exchange RBAC
# setup.
# CHRONOS_MAIL_TRANSPORT=graph
# CHRONOS_GRAPH_MAILBOX=school@example.com (the mailbox to send as; defaults to
# CHRONOS_SMTP_FROM_EMAIL when unset)
# CHRONOS_SMTP_FROM_NAME=Filc
# CHRONOS_SMTP_FROM_EMAIL=school@example.com
# OAuth2 mints the bearer token with the Entra app above (CHRONOS_ENTRA_CLIENT_ID,
# CHRONOS_ENTRA_CLIENT_SECRET, CHRONOS_ENTRA_TENANT_ID) via the client-credentials
# grant. The app needs the "Office 365 Exchange Online" application permission
# SMTP.SendAsApp, a service principal registered in Exchange
# (New-ServicePrincipal) and access granted on the sending mailbox
# (Add-MailboxPermission, plus Add-RecipientPermission for SendAs).
# The mail app: a dedicated registration whose values fall back, per field, to
# the sign-in app above (CHRONOS_ENTRA_CLIENT_ID, CHRONOS_ENTRA_CLIENT_SECRET,
# CHRONOS_ENTRA_TENANT_ID).
# CHRONOS_MAIL_ENTRA_CLIENT_ID=
# CHRONOS_MAIL_ENTRA_CLIENT_SECRET=
# CHRONOS_MAIL_ENTRA_TENANT_ID=
# SMTP XOAUTH2 stays available against Exchange Online with
# CHRONOS_SMTP_AUTH=oauth2 (smtp.office365.com:587, SMTP.SendAsApp on the same
# mail app); Graph is the preferred production transport.

# Firebase Cloud Messaging for push notifications
# CHRONOS_FCM_CREDENTIALS={"type":"service_account",...}
Expand All @@ -137,9 +147,6 @@ CHRONOS_MODE=development
# CHRONOS_NOTIFICATION_DELAY_SYSTEM_MESSAGE=60
# CHRONOS_NOTIFICATION_DELAY_BLOG_POST=60

# Delay before a cohort-reselection notice is sent in seconds (default: 0)
# CHRONOS_NOTIFICATION_DELAY_COHORT_RESELECTION_REQUIRED=0

# --------------------------------------------------
# | Rate limiting |
# --------------------------------------------------
Expand Down
Loading
Loading