How nalumnsut/nalum works
1. This is a two-app monorepo with a clear split between a React/Vite frontend and an Express backend. The backend serves as the API and realtime service layer; the frontend is the user-facing SPA and also includes an admin area.
2. The backend is organized by domain rather than by technical layer. Major route/controller/model groupings exist for auth, profiles, posts, comments, queries, reports, notifications, events, giving, alumni verification, search, and chat. There is also a separate admin domain with its own controllers, routes, and models.
3. Data access is centralized in backend models and configuration files. The presence of postgres configuration plus Redis configuration suggests a relational primary datastore with Redis used for caching, sessions, rate limiting, queues, or realtime coordination. The codebase also includes session, OTP, verification token, push subscription, and moderation-related models.
4. The request path is conventional Express flow: route modules map endpoints to controllers, controllers coordinate services/models, and middleware enforces auth, admin auth, bans, validation, rate limiting, and image compression. This creates a boundary between transport concerns and business logic.
5. Authentication and account lifecycle are substantial subsystems. The backend includes sign-up, sign-in, refresh/logout/revoke-token, forgot/reset password, OTP, verification links, and alumni verification flows. The frontend mirrors this with dedicated auth pages and protected routes, indicating stateful session/token handling across the app.
6. Chat is a separate realtime subsystem. It includes conversation, message, connection, community, and search endpoints on the backend, plus socket infrastructure under backend/sockets. The frontend has chat-specific context, hooks, and page components, so chat traffic likely mixes REST for history/state and WebSockets for live messaging, typing, and presence.
7. Notifications are another cross-cutting subsystem. The backend has notification models, notification preferences, a notification service, and mailer/templates. The frontend has notification context/components and push-related hooks, suggesting a combination of in-app notifications, email notifications, and browser push support.
8. Content and community features are modeled as first-class domains: posts, comments, reports, queries, giving, events, and alumni directory/map views. These are exposed both to the public site and to authenticated dashboard users, while admins get separate moderation/management views for approvals, bans, reports, newsletters, and statistics.
9. File handling is a significant boundary in the backend. Multiple multer configurations and upload directories exist for profile pictures, posts, events, giving, newsletters, and queries. This indicates the API accepts and stores user-generated media locally within backend/uploads, with middleware handling compression and upload constraints.
10. The frontend is structured as a routed SPA with public, auth, dashboard, and admin route groups. It uses many reusable UI components, feature-specific components, and page-level route modules. Context providers for auth, chat, notifications, and profile imply that client state is shared across route boundaries rather than fetched independently in each page.
11. The frontend also has platform-level features beyond the SPA shell: PWA support, a service worker, push notification hooks, page tracking, responsive utilities, and theme toggling. That means the client is designed to behave like an app, not just a static website, and participates in background notifications and installability.
12. There is a strong admin boundary in both layers. Backend admin routes/controllers isolate privileged operations such as user management, verification queues, reports, event approvals, posts moderation, newsletters, alumni database, and codes/statistics. Frontend admin pages are separately routed and protected, reinforcing role-based access control end to end.
13. Operationally, the repo is built for containerized development and deployment. Dockerfiles exist for both apps, docker-compose is present, and there are GitHub Actions workflows for CI/CD. Nginx/Vercel config files indicate the frontend is deployed as a static app or edge-hosted site while the backend is container/API deployed separately.
14. The repository also includes a substantial test and automation surface: backend integration and route tests, frontend component/page tests, Bruno API collections, and utility scripts for seeding, verification, consistency checks, and admin/event setup. This suggests the architecture depends on both API correctness and repeatable environment setup.
Main entry points: controllers Controllers · routes Routes · index.js Server entry · models Models
Components 20
Backend
Express API, realtime services, and domain data layer.
- Server entry · Starts the API server and wires the backend application together.
backend/index.js - Routes · Domain route modules for auth, profiles, posts, chat, admin, and other features.
backend/routes - Controllers · Coordinates requests across auth, content, moderation, notifications, and chat.
backend/controllers - Middleware · Auth, admin auth, bans, validation, rate limiting, and image compression boundaries.
backend/middleware - Models · Primary persistence layer for users, auth, posts, chat, moderation, and admin state.
backend/models - Config · Database, Redis, JWT, mail, and upload configuration.
backend/config - Services · Shared business logic for notifications, alumni, mentions, geocoding, and comments.
backend/services - Sockets · WebSocket chat transport and message/typing handlers.
backend/sockets - Mail · Notification mailer and templates for outbound messaging.
backend/mail - Uploads · Server-side storage for profile, post, event, giving, newsletter, and query assets.
backend/uploads
Frontend
React/Vite SPA with public, dashboard, and admin surfaces.
- Routes · Public, auth, dashboard, and admin route groups for the client app.
frontend/src/routes - Contexts · Shared auth, chat, notification, and profile state across the SPA.
frontend/src/context - Pages · Route-level screens for public content, auth flows, dashboard, chat, and admin.
frontend/src/pages - Components · Reusable UI plus feature components for posts, profile, notifications, chat, and admin.
frontend/src/components - Hooks & lib · API wrappers, hooks, validation, analytics, PWA, push, and socket helpers.
frontend/src/hooks - PWA shell · Service worker, manifest, static content, and edge/web deployment assets.
frontend/public
Ops & QA
Containers, CI/CD, API collections, and automated checks.
- Compose · Local multi-service orchestration for frontend and backend.
docker-compose.yml - CI/CD · GitHub Actions workflows for backend and frontend build, test, and deploy.
.github/workflows - API tests · Bruno collections and API smoke tests for auth, profile, chat, and dashboard flows.
api_test/NALUM - Scripts · Seeding, repair, verification, and admin/event setup scripts.
backend/scripts
Connections 25
- Server entry → Routes: mounts · The server bootstraps the route tree.
- Server entry → Middleware: uses · Global request policies are applied during request handling.
- Server entry → Models: connects · The app initializes persistence-backed features.
- Routes → Controllers: dispatches · Route modules hand off to domain controllers.
- Controllers → Services: orchestrates · Controllers delegate shared business logic to services.
- Controllers → Models: reads/writes · Controllers persist and query domain state through models.
- Controllers → Middleware: guards · Admin/auth/validation middleware protects sensitive flows.
- Services → Models: persists · Services use models for notifications, chat, alumni, and geocoding data.
- Controllers → Mail: sends · Notification and verification flows emit email.
- Controllers → Uploads: stores media · Upload-backed features save images and files through constrained handlers.
- Routes → Sockets: extends · Chat routes complement realtime socket interactions.
- Config → Server entry: configures · Database, Redis, JWT, and mail settings are loaded by the backend.
- Config → Models: supports · Database and cache configuration underpins persistence.
- Routes → Pages: renders · Route groups resolve to page-level screens.
- Pages → Components: composes · Pages are built from reusable feature and UI components.
- Pages → Contexts: consumes · Pages share auth, chat, notification, and profile state.
- Components → Hooks & lib: uses · UI features rely on hooks and API helpers.
- Hooks & lib → Routes: calls API · Client hooks and libraries talk to the backend endpoints.
- Contexts → Routes: syncs with · Client state is hydrated and maintained through API calls.
- PWA shell → Routes: boots · Static assets and the service worker support the SPA shell.
- Compose → Server entry: runs · Compose brings up the API service.
- Compose → Routes: runs · Compose brings up the client app.
- CI/CD → API tests: verifies · CI pipelines use API and app-level checks.
- Scripts → Models: seeds/repairs · Utility scripts manipulate backend data and admin setup.
- API tests → Routes: tests · Bruno collections target core API routes.