How hpsanjel/magicchalk works
This is a Next.js school website and management portal. Families can explore school information, submit admissions, contact, and tour requests; authenticated parents, teachers, and administrators use dashboards for students, appointments, assignments, and school operations. The sampled routes show MongoDB-backed student, teacher, appointment, and tour-booking workflows, with email notifications in some flows. Many listed capabilities are represented by route and page paths, but their internal wiring was not sampled, so the graph limits detailed connections to indexed references and excerpts.
Main entry points: students/route.js Student API · appointments/route.js Appointment API · mongodb.js MongoDB connection · teachers/route.js Teacher API
Components 27
Public Website
- School homepage
app/page.tsx - School content pages
app/programs/page.tsx - Contact form
app/contact/page.tsx - Admissions form
app/admission/page.jsx - Tour booking form
app/school-tour-form/page.jsx
School Portals
- Administrator dashboard
app/dashboard/page.jsx - Parent dashboard
app/parents/dashboard/page.tsx - Teacher dashboard
app/teachers/dashboard/page.jsx - Student enrollment UI
components/StudentForm.tsx - Appointment dialog
app/parents/dashboard/appointment-modal.tsx
Application Services
- API data hook
hooks/useFetchData.js - Student API
app/api/students/route.js - Teacher API
app/api/teachers/route.js - Appointment API
app/api/appointments/route.js - Assignment API
app/api/assignments/route.js - Tour booking API
app/api/tour-bookings/route.js - Message submission action
app/actions/submitMessage.ts - Email notifications
lib/email.ts
Persistence
- MongoDB connection
lib/mongodb.js - Student records
models/Student.Model.js - Teacher records
models/Teacher.Model.js - User accounts
models/User.Model.js - Appointment records
models/Appointment.Model.js - Tour booking records
models/TourBooking.Model.js - Messages
models/Message.Model.js - Assignments
models/Assignment.Model.js
Other components
- Visitor or family
Connections 35
- Visitor or family → School homepage: browses
app/page.tsx - Visitor or family → School content pages: views
- Visitor or family → Contact form: submits message
app/contact/page.tsx - Visitor or family → Admissions form: starts enrollment
app/admission/page.jsx - Visitor or family → Tour booking form: requests tour
- Contact form → Message submission action: submits
app/contact/page.tsx - Message submission action → MongoDB connection: connects
app/actions/submitMessage.ts - Message submission action → Messages: saves message
app/actions/submitMessage.ts - School homepage → School content pages: renders sections
app/page.tsx - School homepage → API data hook: loads content
- Parent dashboard → Appointment dialog: opens dialog
app/parents/dashboard/page.tsx - Student enrollment UI → Student API: submits enrollment
- Parent dashboard → Student API: loads students
- Parent dashboard → Appointment API: requests appointments
- Teacher dashboard → Assignment API: manages assignments
- Administrator dashboard → Tour booking API: manages bookings
- Student API → MongoDB connection: connects
app/api/students/route.js - Student API → Student records: reads and writes
app/api/students/route.js - Student API → User accounts: creates parent account
app/api/students/route.js - Student API → Email notifications: sends welcome email
app/api/students/route.js - Teacher API → MongoDB connection: connects
app/api/teachers/route.js - Teacher API → Teacher records: reads and writes
app/api/teachers/route.js - Teacher API → User accounts: checks and creates
app/api/teachers/route.js - Teacher API → Email notifications: sends invite
app/api/teachers/route.js - Appointment API → MongoDB connection: connects
app/api/appointments/route.js - Appointment API → Appointment records: creates and queries
app/api/appointments/route.js - Appointment API → Student records: looks up student
app/api/appointments/route.js - Appointment API → Teacher records: looks up teacher
app/api/appointments/route.js - Appointment API → User accounts: looks up parent
app/api/appointments/route.js - Tour booking API → MongoDB connection: connects
app/api/tour-bookings/route.js - Tour booking API → Tour booking records: creates and updates
app/api/tour-bookings/route.js - Tour booking API → Email notifications: sends confirmation
app/api/tour-bookings/route.js - Assignment API → MongoDB connection: connects
app/api/assignments/route.js - Assignment API → Student records: filters by students
app/api/assignments/route.js - API data hook → Student API: fetches data