Digital check-in system for YK Pao School. Replaces paper rosters for morning/evening temperature checks.
pnpm install
cp .env.example .env
# Fill in DATABASE_URL and AUTH_SECRET in .envUses Neon Postgres. Get a free database at neon.tech.
# Push schema to database
pnpm db:push
# Seed demo data (1 device, 10 students, 1 admin user)
pnpm db:seedpnpm devOpen http://localhost:3000. Login with:
- Email:
[email protected] - Password:
admin123
| Variable | Description |
|---|---|
DATABASE_URL |
Neon Postgres connection string |
AUTH_SECRET |
Random secret for NextAuth.js (generate with openssl rand -base64 32) |
AUTH_URL |
App URL, e.g. http://localhost:3000 |
Called by Android PDAs when a student scans their NFC card.
curl -X POST http://localhost:3000/api/checkin \
-H "Content-Type: application/json" \
-H "X-Device-API-Key: YOUR_DEVICE_API_KEY" \
-d '{
"uid": "AABBCCDD",
"temperature": 36.5,
"check_type": "morning",
"device_id": "demo-pda-1"
}'Response:
{
"ok": true,
"student_id": "s99001",
"name": "Alice Wang",
"grade": 9,
"is_late": false,
"is_fever": false,
"message": "OK"
}Auth: X-Device-API-Key header with a device API key (created in the Devices page).
Bind an NFC card UID to a student:
curl -X POST http://localhost:3000/api/students/bind \
-H "Content-Type: application/json" \
-H "Cookie: YOUR_SESSION_COOKIE" \
-d '{"student_id": "s99001", "uid": "AABBCCDD"}'- Next.js 15 (App Router) + TypeScript
- Postgres via Drizzle ORM (Neon)
- NextAuth.js (email + password)
- Tailwind CSS + shadcn/ui
- SSE for live dashboard updates