Commit Graph
33 Commits
Author SHA1 Message Date
admin a7730bde0c Terminal 2026-08-22 23:10:12 +00:00
admin 2f50c12828 Modified by www.SourceFiles.app 2026-08-07 04:15:23 +00:00
admin f59e5e579e Modified by www.SourceFiles.app 2026-08-07 04:15:22 +00:00
admin 4d3672a4f0 Modified by www.SourceFiles.app 2026-08-07 04:15:21 +00:00
admin 9a8c4b0e0b Modified by www.SourceFiles.app 2026-08-07 04:15:20 +00:00
admin dc76b10920 Modified by www.SourceFiles.app 2026-08-07 04:15:19 +00:00
admin db1704b87a Modified by www.SourceFiles.app 2026-08-07 04:15:18 +00:00
admin 6d983a410e Modified by www.SourceFiles.app 2026-08-07 04:15:17 +00:00
admin 6e05751f15 Modified by www.SourceFiles.app 2026-08-07 04:15:16 +00:00
admin f1466b1448 Modified by www.SourceFiles.app 2026-08-07 04:15:15 +00:00
admin a186288dce Modified by www.SourceFiles.app 2026-08-07 04:15:14 +00:00
admin 8ad248aed5 Modified by www.SourceFiles.app 2026-08-07 04:15:14 +00:00
admin 2a49cbe66d Modified by www.SourceFiles.app 2026-08-07 04:15:13 +00:00
admin 1c3953d589 Modified by www.SourceFiles.app 2026-08-07 04:14:38 +00:00
admin 573e07777d Modified by www.SourceFiles.app 2026-08-07 04:13:07 +00:00
admin f9a64da58a Modified by www.SourceFiles.app 2026-08-07 04:13:06 +00:00
admin 068bfaaeaa Modified by www.SourceFiles.app 2026-08-07 04:13:06 +00:00
admin a6a8957f67 Modified by www.SourceFiles.app 2026-08-07 04:13:05 +00:00
admin f3395ceec2 Modified by www.SourceFiles.app 2026-08-07 04:13:05 +00:00
admin 89f3f18533 Modified by www.SourceFiles.app 2026-08-07 04:13:04 +00:00
admin 6fc382dc77 Modified by www.SourceFiles.app 2026-08-07 04:13:04 +00:00
admin 4041390ea7 Modified by www.SourceFiles.app 2026-08-07 04:13:03 +00:00
admin 713c58b7f2 Modified by www.SourceFiles.app 2026-08-07 04:12:40 +00:00
admin 95c0961ea8 Modified by www.SourceFiles.app 2026-08-07 04:12:40 +00:00
admin c4ced91e16 Modified by www.SourceFiles.app 2026-08-07 04:12:39 +00:00
admin 023432011b Modified by www.SourceFiles.app 2026-08-07 04:12:38 +00:00
adminandClaude Opus 5 d2d4e49fa6 Add embedded IMAP/SMTP mail for staff
Admins configure one mail server; each staff member gets their own mailbox
login. Read, reply and compose against real IMAP/SMTP.

IMAP and SMTP are raw TCP, so none of this can run in a browser — every
operation is a TanStack Start server function. mail.functions.ts ships to
the client bundle, so imapflow/nodemailer/mailparser and the crypto
helpers are imported inside handlers, never at the top level. Verified
that Nitro inlines all three into .output/server/_libs, since the Docker
runner stage copies only .output and has no node_modules.

Note this ties the app to the Node deployment: the default local build
targets Cloudflare Workers, which cannot open IMAP sockets.

Credential handling, since a mailbox password grants full read and send
access to someone's mail:

- user_mailboxes has RLS enabled, no policies, and SELECT revoked from
  anon and authenticated. Verified: teacher and admin both see zero rows
  and no ciphertext; only service_role can read it. The revoke is belt and
  braces — Supabase's default privileges had granted SELECT, leaving the
  table one stray policy away from leaking.
- Passwords are sealed with AES-256-GCM using MAIL_CRED_KEY from
  .env.secret, so a database dump alone opens nothing. GCM also makes
  tampering fail the auth tag instead of decrypting to garbage.
- Provisioning verifies credentials against the live IMAP server before
  storing them, so typos surface at setup rather than as a broken inbox.

Message bodies render as plain text; sender HTML is never injected, which
would execute sender-controlled markup and leak read receipts via
tracking pixels.

Mailboxes are limited to admins and teachers. Students are excluded
deliberately — external mail for minors carries archiving, monitoring and
consent obligations that should be chosen, not inherited.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 10:46:47 -04:00
adminandClaude Opus 5 9360bf3055 Add printable report cards, progress reports and invoices
Three documents, all print-styled rather than generated server-side: no
PDF dependency is added, and "Save as PDF" in the browser produces the
file. @media print in styles.css strips the app chrome (.no-print) and
breaks each student onto its own sheet (.print-page).

- Report card: weighted category breakdown, overall percent and letter
  from the existing gradebook config, plus an attendance summary.
- Academic progress report: the same, plus assignment-level detail —
  a mid-term report is only actionable with the underlying work listed.
- 504 / IEP progress report: each goal's baseline, target, status and
  progress entries within the period, for the quarterly report IDEA
  requires. RLS keeps it to the case manager, admins and parents.
- Invoice, reachable per student from the tuition ledger: opening
  balance carried forward, itemised activity, and balance due.

Grade maths is reused from lib/grades and the class grading config from
useEffectiveConfig, so report cards cannot drift from the gradebook.

The "Email to parents" button opens a prefilled mailto: draft — the same
mechanism the intake-link share already uses. It gathers addresses from
intake guardians and linked parent accounts. mailto cannot attach a file,
so the itemisation goes in the body as text; sending a real attachment
would need a transactional email provider and an API key.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 09:45:46 -04:00
adminandClaude Opus 5 9d7d18669d Add 504 / IEP plans with tiered confidentiality
Plans, accommodations, related services, annual goals with progress
monitoring, meetings/team, and signed documents — plus a compliance
list and dashboard alerts for annual-review and triennial re-evaluation
dates (overdue in red, due-within-30-days in amber).

Access is tiered because special-education records are need-to-know
under FERPA:

  FULL  admin, the plan's case manager, the student's parents
  IMPL  the above, plus any teacher of the student — accommodations
        and services only, never eligibility or meeting notes

RLS is row-level and every app role is the same Postgres role
(`authenticated`), so column grants cannot separate the tiers. The
split is therefore physical: confidential fields live in plan_details,
plan_goals, plan_meetings and plan_documents rather than as columns on
student_plans.

The UI asks the database which tier applies via the same predicates the
policies use (can_view_plan_full / can_edit_plan) instead of re-deriving
the rules client-side.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 09:14:40 -04:00
adminandClaude Opus 4.8 90e3c2c188 Add admin-emailed one-time intake links
- intake_tokens table (server-only via service role)
- Server functions: createIntakeToken (admin), getIntakeToken (public validate),
  submitIntake (public write + mark used, 14-day one-time tokens)
- Public /intake/$token full intake form (no login) with valid/used/expired states
- Student profile (admin): generate link, copy, and email-to-parent (mailto)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 18:00:39 -04:00
adminandClaude Opus 4.8 8fe6ad00f4 Gradebook: classes, weighted grading, assignments, grades, student role
- Migration: student role, students.user_id, grade_categories/grade_scale
  (school defaults + per-class override), assignments, grades + RLS
- Classes area (nav): list/create classes, class page with Gradebook / Roster /
  Grading setup tabs; teachers see their classes, admins all
- Weighted-category grade calc -> letter scale (shared helper)
- Roster assignment (admin), assignment + grade entry (teacher/admin)
- Student profile: view-only Grades tab (parents/students)
- Portal access: create parent OR student logins linked to the student

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 16:57:27 -04:00
adminandClaude Opus 4.8 73a4e70f0b Parent hand-off: admin creates parent/teacher accounts + portal edit
- Admin server function (service-role) to create accounts, set role, and
  optionally link a parent to a student; wired via env_file (.env.secret)
- Admin > Users: "Add a user" form (teacher/parent/admin) with one-time temp password
- Student profile > Family: "Parent portal access" — create + link a parent login
- Parents can now edit their own child's profile (RLS-scoped); internal notes stay admin-only

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 16:30:56 -04:00
Lovable cb75921659 template: tanstack_start_ts_current-40f3c252c0da 2025-01-01 00:00:00 +00:00