How codemonk-io/campussync works
Purpose and entry points
This is a full-stack event-management application: users authenticate, create and browse events, register for them, comment, view personal dashboards, and optionally integrate calendars/reminders. The backend HTTP entry point is backend/index.js; the React/Vite client starts at frontend/src/main.jsx and composes application routing/UI in frontend/src/App.jsx.
Frontend application boundary
The browser client is a React single-page application with a centralized API layer and authentication context. frontend/src/api.js is the frontend/backend transport boundary; frontend/src/context/AuthContext.jsx owns client authentication state. Route protection is enforced in frontend/src/components/layout/ProtectedRoute.jsx, while key user workflows are implemented by pages such as frontend/src/pages/EventsPage.jsx, frontend/src/pages/EventDetailPage.jsx, and frontend/src/pages/user/DashboardPage.jsx.
Backend HTTP and request pipeline
The Node backend is organized as route → controller → service → model. Route modules expose domain endpoints, including backend/routes/auth.js, backend/routes/events.js, and backend/routes/registrations.js. Controllers adapt HTTP requests/responses and delegate business work, e.g. backend/controllers/eventController.js, backend/controllers/calendarController.js, and backend/controllers/dashboardController.js. Authentication and centralized error handling form cross-cutting request boundaries in backend/middleware/auth.js and backend/middleware/errorHandler.js.
Core event and participation domain
Events are the central aggregate, represented by backend/models/Event.js and managed through backend/services/eventService.js. Registration is a separate relationship/domain workflow, with backend/models/Registration.js and backend/services/registrationService.js; this separation supports event capacity/attendance logic independently of event authoring. Event discussion is similarly isolated through backend/models/Comment.js and backend/services/commentService.js.
Identity and authorization
Users are persisted in backend/models/User.js. Authentication behavior is concentrated in backend/services/authService.js and exposed through backend/controllers/authController.js; protected backend operations pass through backend/middleware/auth.js. The repository also includes Google auth configuration at backend/config/googleAuth.js, indicating an external identity-provider integration alongside the application’s own auth flow.
Calendar, notifications, and asynchronous work
Calendar integration is handled as an external-service boundary by backend/services/googleCalendarService.js, invoked through backend/controllers/calendarController.js. Email delivery is encapsulated in backend/services/emailService.js. Reminder processing is separated from request handling: backend/cron/reminderCron.js schedules work, while backend/services/reminderService.js determines and sends reminder actions. Time-offset parsing resides in backend/utils/parseOffset.js, supporting reminder scheduling inputs.
Dashboard and data composition
Dashboard data is assembled server-side rather than directly in the client from individual models, through backend/services/dashboardService.js and backend/controllers/dashboardController.js. The resulting user-facing view is rendered by frontend/src/pages/user/DashboardPage.jsx; organizer-specific presentation is represented by frontend/src/components/events/OrganizerDashboardModal.jsx. This creates a clear composition boundary for derived, multi-domain event and registration data.
Main entry points: eventController.js HTTP controllers · Event.js Domain models · App.jsx App routing · api.js API client
Components 23
React client
- Vite entry
frontend/src/main.jsx - App routing
frontend/src/App.jsx - Auth state
frontend/src/context/AuthContext.jsx - Protected routes
frontend/src/components/layout/ProtectedRoute.jsx - Event workflows · Browse, create, and view event details.
frontend/src/pages/EventsPage.jsx - User dashboard
frontend/src/pages/user/DashboardPage.jsx - API client
frontend/src/api.js
Backend HTTP
- HTTP entry
backend/index.js - Domain routes · Auth, event, and registration endpoints.
backend/routes/events.js - Authentication · Protects backend operations.
backend/middleware/auth.js - Error handling
backend/middleware/errorHandler.js - HTTP controllers · Adapts requests to service calls.
backend/controllers/eventController.js
Domain services
- Authentication service
backend/services/authService.js - Event service · Owns event authoring and event logic.
backend/services/eventService.js - Registration service · Handles capacity and attendance workflows.
backend/services/registrationService.js - Comment service
backend/services/commentService.js - Dashboard service · Builds derived multi-domain dashboard data.
backend/services/dashboardService.js - Domain models · User, Event, Registration, and Comment records.
backend/models/Event.js
Async & integrations
- Reminder scheduler
backend/cron/reminderCron.js - Reminder service · Determines and sends reminder actions.
backend/services/reminderService.js - Email delivery
backend/services/emailService.js - Google Calendar
backend/services/googleCalendarService.js - Google identity
backend/config/googleAuth.js
Connections 28
- Vite entry → App routing: mounts
- App routing → Auth state: uses
- App routing → Protected routes: guards routes with
- App routing → Event workflows: renders
- App routing → User dashboard: renders
- Auth state → API client: auth requests
- Event workflows → API client: event requests
- User dashboard → API client: dashboard requests
- API client → HTTP entry: HTTP
- HTTP entry → Domain routes: mounts
- Domain routes → Authentication: protected endpoints
- Authentication → HTTP controllers: authorizes
- Domain routes → HTTP controllers: dispatches
- HTTP entry → Error handling: errors
- HTTP controllers → Authentication service: auth
- HTTP controllers → Event service: events
- HTTP controllers → Registration service: registrations
- HTTP controllers → Dashboard service: dashboard
- HTTP controllers → Google Calendar: calendar actions
- Authentication service → Domain models: users
- Authentication service → Google identity: external sign-in
- Event service → Domain models: events
- Registration service → Domain models: registrations
- Comment service → Domain models: comments
- Dashboard service → Domain models: composes from
- Reminder scheduler → Reminder service: triggers
- Reminder service → Domain models: reads event participation
- Reminder service → Email delivery: sends reminders