adrianbonpin a21c76f029 feat: localStorage-backed student CRUD with zod schemas
Split the app into the three pages the navbar promises, each with one job:

- / (home)   -> read-only roster, no mutation controls
- /add       -> create only, redirects to / on success
- /edit      -> update + delete only (picker, plus /edit?id=<uuid> deep links)

Data layer (src/lib/students.ts) is the single source of truth:
- zod studentDraftSchema validates form input (trims name, lowercases email,
  coerces yearLevel to an int 1-5, restricts course to a known list)
- studentSchema = draft + id + createdAt, so types come from z.infer
- versioned key it3206.students.v1, validated on read *and* write; corrupt or
  missing data degrades to an empty list instead of throwing
- typed CRUD helpers; useSyncExternalStore hook with a stable snapshot cache,
  a window event and the storage event so every island and other tabs re-render

Footer "clear local storage" is now wired to clearStudents() (confirm dialog,
label feedback) instead of being inert, and the layout switched to min-h-svh +
an in-flow footer so it no longer overlaps long lists. Footer padding clears the
Astro dev toolbar, which was covering the link in dev.

Also adds zod, plus @astrojs/check + typescript@^6 as dev deps so astro check
runs (TS 7 does not expose the API astro check needs yet).
2026-09-16 19:00:18 +08:00
2026-09-16 18:20:45 +08:00
2026-09-16 18:20:45 +08:00
2026-09-16 18:20:45 +08:00
2026-09-16 18:20:45 +08:00
2026-09-16 18:20:45 +08:00
2026-09-16 18:20:45 +08:00

Astro Starter Kit: Minimal

bun create astro@latest -- --template minimal

🧑‍🚀 Seasoned astronaut? Delete this file. Have fun!

🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

/
├── public/
├── src/
│   └── pages/
│       └── index.astro
└── package.json

Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name.

There's nothing special about src/components/, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the public/ directory.

🧞 Commands

All commands are run from the root of the project, from a terminal:

Command Action
bun install Installs dependencies
bun dev Starts local dev server at localhost:4321
bun build Build your production site to ./dist/
bun preview Preview your build locally, before deploying
bun astro ... Run CLI commands like astro add, astro check
bun astro -- --help Get help using the Astro CLI

👀 Want to learn more?

Feel free to check our documentation or jump into our Discord server.

S
Description
IT3206 Mini Systems - Astro project
Readme
158 KiB
Languages
TypeScript 83.9%
Astro 15.1%
JavaScript 0.9%