How balaji-aiml/scholarnet works
ScholarNet is a campus networking app for student and senior profiles, connection requests, event notices, and chat. Users enter through the React app, authenticate, then use domain pages that call the Express API; messaging also uses Socket.io for live updates. The API applies authentication and role checks, then domain controllers read or update MongoDB-backed models. The README documents the main capabilities and REST/socket contracts; some frontend components and backend subsystems were not sampled, so their internal links are shown only where documented or indexed.
Main entry points: server.js Express API server · App.jsx App routing · api.js HTTP API client · messageController.js Threads and messages
Components 27
Web application
- App routing
frontend/src/App.jsx - Sign-in and auth
frontend/src/context/AuthContext.jsx - Profiles and connections
frontend/src/pages/Profile.jsx - Connection discovery
frontend/src/pages/Connections.jsx - Event board
frontend/src/pages/Events.jsx - Chat interface
frontend/src/pages/Messages.jsx - HTTP API client
frontend/src/services/api.js
API and domains
- Express API server
backend/server.js - Auth routes
backend/routes/authRoutes.js - User routes
backend/routes/userRoutes.js - Connection routes
backend/routes/connectionRoutes.js - Event routes
backend/routes/eventRoutes.js - Message routes
backend/routes/messageRoutes.js - JWT and role checks
backend/middleware/auth.js - Auth and profiles
backend/controllers/userController.js - Connection lifecycle
backend/controllers/connectionController.js - Events and interactions
backend/controllers/eventController.js - Threads and messages
backend/controllers/messageController.js
Live messaging
- Socket client
frontend/src/services/socket.js - Socket event handler
backend/socket.js
Persistence and shared contracts
- MongoDB
backend/config/db.js - User records
backend/models/User.js - Connection records
backend/models/Connection.js - Event records
backend/models/Event.js - Message records
backend/models/Message.js - Shared domain constants
shared/constants.js
Other components
- Campus user
Connections 44
- Campus user → App routing: uses
- App routing → Sign-in and auth: routes auth
frontend/src/App.jsx - App routing → Profiles and connections: routes profile
frontend/src/App.jsx - App routing → Connection discovery: routes connections
frontend/src/App.jsx - App routing → Event board: routes events
frontend/src/App.jsx - App routing → Chat interface: routes chat
frontend/src/App.jsx - Sign-in and auth → HTTP API client: calls auth API
frontend/src/context/AuthContext.jsx - Sign-in and auth → Socket client: connects socket
frontend/src/context/AuthContext.jsx - Profiles and connections → HTTP API client: calls user API
frontend/src/pages/Profile.jsx - Connection discovery → HTTP API client: calls connection API
frontend/src/pages/Connections.jsx - Event board → HTTP API client: calls event API
frontend/src/pages/Events.jsx - Chat interface → HTTP API client: loads threads
frontend/src/pages/Messages.jsx - Chat interface → Socket client: sends live events
frontend/src/pages/Messages.jsx - HTTP API client → Express API server: sends REST requests
- Express API server → MongoDB: connects database
backend/server.js - Express API server → Auth routes: mounts routes
backend/server.js - Express API server → User routes: mounts routes
backend/server.js - Express API server → Connection routes: mounts routes
backend/server.js - Express API server → Event routes: mounts routes
backend/server.js - Express API server → Message routes: mounts routes
backend/server.js - Express API server → Socket event handler: initializes handler
backend/server.js - Auth routes → JWT and role checks: protects endpoints
backend/routes/authRoutes.js - User routes → JWT and role checks: protects endpoints
backend/routes/userRoutes.js - Connection routes → JWT and role checks: protects endpoints
backend/routes/connectionRoutes.js - Event routes → JWT and role checks: protects endpoints
backend/routes/eventRoutes.js - Message routes → JWT and role checks: protects endpoints
backend/routes/messageRoutes.js - Auth routes → Auth and profiles: dispatches auth
backend/routes/authRoutes.js - User routes → Auth and profiles: dispatches profile
backend/routes/userRoutes.js - Connection routes → Connection lifecycle: dispatches requests
backend/routes/connectionRoutes.js - Event routes → Events and interactions: dispatches events
backend/routes/eventRoutes.js - Message routes → Threads and messages: dispatches messages
backend/routes/messageRoutes.js - Auth and profiles → User records: reads and writes
backend/controllers/userController.js - Connection lifecycle → Connection records: reads and writes
backend/controllers/connectionController.js - Connection lifecycle → User records: checks users
backend/controllers/connectionController.js - Events and interactions → Event records: reads and writes
backend/controllers/eventController.js - Threads and messages → Message records: reads and writes
backend/controllers/messageController.js - Threads and messages → Connection records: checks accepted links
backend/controllers/messageController.js - Threads and messages → User records: loads partners
backend/controllers/messageController.js - Socket event handler → Threads and messages: uses shared send rules
backend/socket.js - Socket client → Socket event handler: exchanges events
- Auth and profiles → Shared domain constants: validates roles
- Events and interactions → Shared domain constants: validates categories
backend/controllers/eventController.js - User records → Shared domain constants: uses role values
backend/models/User.js - Event records → Shared domain constants: uses categories
backend/models/Event.js