40227-vm/backend/docs/campus-catalog.md
Dmitri d4a5378adf Refactor: migrate frontend to Vite/React, add product backend modules
Frontend:
- Replace Next.js with Vite + React + TypeScript
- Add new component architecture (app-shell, sidebar, dashboard modules)
- Implement product modules: FRAME, safety protocols, walkthrough checkin,
  campus/staff attendance, personality quiz, sign language, classroom timer
- Add shadcn/ui component library with Tailwind CSS
- Remove legacy generated components, stores, and pages

Backend:
- Add product migrations: frame_entries, user_progress, safety_quiz_results,
  walkthrough_checkins, communication_events, personality_quiz_results,
  campus_attendance_config/summaries, staff_attendance_records, content_catalog
- Add corresponding models, services, and routes
- Implement cookie-based auth with refresh token rotation
- Add content catalog seeder with product content
- Migrate to ESLint flat config
- Switch from yarn to npm

Infrastructure:
- Update .gitignore for new tooling
- Add project documentation (CLAUDE.md, docs/)
- Remove deprecated config files and yarn.lock

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-06-09 15:18:23 +02:00

1.3 KiB

Campus Catalog

Purpose

The database is the source of truth for campus records. Runtime frontend code must not ship campus rows as constants.

Backend Contract

Public read-only campus catalog:

  • GET /api/public/campuses

Response shape:

{
  "rows": [
    {
      "id": "campus uuid",
      "name": "Tigers Campus",
      "code": "tigers",
      "mascot": "Tigers",
      "color": "bg-orange-500",
      "bgGradient": "from-orange-500 to-amber-500",
      "borderColor": "border-orange-500/30",
      "textColor": "text-orange-400",
      "bgLight": "bg-orange-500/10",
      "description": "Strength, courage & determination",
      "isOnline": false
    }
  ],
  "count": 1
}

Only active campuses are returned. The endpoint is intentionally read-only and does not replace the authenticated /api/campuses CRUD workflow.

Campus identity, names, codes, mascot labels, online flag, descriptions, and branding tokens are campus data and belong in the campuses table.

Seed Data

Initial product campuses are seeded by:

  • backend/src/db/seeders/20260608100000-product-campuses.js

The deleted generated sample-data seeder must not be reintroduced. Development or test-only rows belong in backend seeders or backend test fixtures, not frontend runtime constants.