How kirawat1/co_project works
This is a role-based co-operative education management system for students, teachers, and staff. Students maintain profiles, apply for placements, submit required documents, and coordinate supervision; teachers review applications and documents and manage supervision; staff administer periods, companies, letters, and system-wide operations. The React application sends requests to an Express API, whose routes apply authentication and dispatch to domain controllers backed by Prisma/MySQL. The README documents the principal workflows and KKU SSO; excerpts show selected routing, persistence, and registration integration, but not every subsystem’s internal wiring.
Main entry points: prismaClient.js Prisma data access · server.js Express API server · studentRoutes.js Student routes · App.tsx Role-based app entry
Components 26
Web application
- Role-based app entry
Frontend/src/App.tsx - Student workspace
Frontend/src/components/S_App.tsx - Teacher workspace
Frontend/src/components/T_App.tsx - Staff workspace
Frontend/src/components/A_App.tsx - API request client
Frontend/src/utils/apiFetch.ts
API and identity
- Express API server
backend/server.js - Authentication routes
backend/routes/authRoutes.js - Authentication controller
backend/controllers/authController.js - Token and role guards
backend/middlewares/authMiddleware.js - Student routes
backend/routes/studentRoutes.js - Co-op routes
backend/routes/coopRoutes.js - Admin routes
backend/routes/adminRoutes.js - Supervision routes
backend/routes/supervisionRoutes.js
Co-op operations
- Student profiles and sync
backend/controllers/studentController.js - Applications and documents
backend/controllers/docController.js - Staff document review
backend/controllers/adminDocController.js - Co-op period management
backend/controllers/coopPeriodController.js - Teacher review
backend/controllers/teacherController.js - Program configuration
backend/controllers/configController.js
Supervision
- Supervision scheduling
backend/controllers/supervisionController.js - Supervision evaluation
backend/controllers/supervisionEvalController.js
Persistence and integrations
- Prisma data access
backend/config/prismaClient.js - MySQL database
- KKU registration API
- Registration service
backend/services/kkuRegService.js
Other components
- Student, teacher, staff
Connections 43
- Student, teacher, staff → Role-based app entry: use
Frontend/src/App.tsx - Role-based app entry → Student workspace: selects role app
Frontend/src/App.tsx - Role-based app entry → Teacher workspace: selects role app
Frontend/src/App.tsx - Role-based app entry → Staff workspace: selects role app
Frontend/src/App.tsx - Student workspace → API request client: requests data
- Teacher workspace → API request client: requests data
- Staff workspace → API request client: requests data
- API request client → Express API server: calls API
- Express API server → Authentication routes: mounts routes
backend/server.js - Express API server → Student routes: mounts routes
backend/server.js - Express API server → Co-op routes: mounts routes
backend/server.js - Express API server → Admin routes: mounts routes
backend/server.js - Express API server → Supervision routes: mounts routes
backend/server.js - Authentication routes → Authentication controller: dispatches to
backend/controllers/authController.js - Student routes → Token and role guards: checks access
backend/routes/studentRoutes.js - Student routes → Student profiles and sync: dispatches to
backend/routes/studentRoutes.js - Student routes → Applications and documents: dispatches to
backend/routes/studentRoutes.js - Student routes → Co-op period management: dispatches to
backend/routes/studentRoutes.js - Co-op routes → Token and role guards: checks access
backend/routes/coopRoutes.js - Co-op routes → Applications and documents: dispatches to
backend/routes/coopRoutes.js - Admin routes → Staff document review: dispatches to
backend/routes/adminRoutes.js - Admin routes → Co-op period management: dispatches to
backend/routes/adminRoutes.js - Admin routes → Program configuration: dispatches to
backend/routes/adminRoutes.js - Supervision routes → Supervision scheduling: dispatches to
backend/routes/supervisionRoutes.js - Supervision routes → Supervision evaluation: dispatches to
backend/routes/supervisionRoutes.js - Supervision routes → Program configuration: dispatches to
backend/routes/supervisionRoutes.js - Authentication routes → Token and role guards: guards requests
- Student profiles and sync → Prisma data access: reads and writes
backend/controllers/studentController.js - Applications and documents → Prisma data access: reads and writes
backend/controllers/docController.js - Staff document review → Prisma data access: reads and writes
backend/controllers/adminDocController.js - Teacher review → Prisma data access: reads and writes
backend/controllers/teacherController.js - Supervision scheduling → Prisma data access: reads and writes
backend/controllers/supervisionController.js - Program configuration → Prisma data access: reads and writes
backend/controllers/configController.js - Prisma data access → MySQL database: persists records
- Student profiles and sync → Registration service: syncs student data
backend/controllers/studentController.js - Registration service → KKU registration API: requests registration data
backend/services/kkuRegService.js - Student, teacher, staff → Authentication controller: sign in
README.md - Student, teacher, staff → Student profiles and sync: sync profile
README.md - Student, teacher, staff → Applications and documents: submit documents
README.md - Student, teacher, staff → Teacher review: review applications
README.md - Student, teacher, staff → Supervision scheduling: coordinate visits
README.md - Student, teacher, staff → Co-op period management: manage periods
README.md - Student, teacher, staff → Staff document review: issue letters
README.md