How harishanandh/campushub works
CampusHub combines student community management with a separate campus-safety planning area. Students enter through the React app, authenticate, and use protected pages for clubs, discussions, events, polls, profiles, and dashboard summaries; those features use the frontend API service to reach FastAPI, which accesses PostgreSQL through SQLAlchemy. The safety branch includes a local crowd-route simulation. README documents additional platform capabilities, but most page and backend implementation excerpts were not sampled, so only documented or directly evidenced connections are shown.
Main entry points: App.jsx App routes · api.js REST API client · CrowdFlow.jsx CrowdFlow page · main.py FastAPI endpoints
Components 22
Student platform
- App routes
frontend/src/App.jsx - Login and registration
frontend/src/pages/Login.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - Clubs and details
frontend/src/pages/Clubs.jsx - Discussions
frontend/src/pages/Discussions.jsx - Events
frontend/src/pages/Events.jsx - Polls and voting
frontend/src/pages/Polls.jsx - Profile
frontend/src/pages/Profile.jsx - REST API client
frontend/src/services/api.js
API and persistence
- FastAPI endpoints
backend/main.py - SQLAlchemy models
backend/models.py - Database sessions
backend/database.py
Safety planning
- CampusShield
frontend/src/pages/safety/CampusShield.jsx - CrowdFlow page
frontend/src/pages/safety/CrowdFlow.jsx - Scenario inputs
frontend/src/components/safety/CrowdInputForm.jsx - Route simulation
frontend/src/services/safety/routeSimulation.js - Simulation results
frontend/src/components/safety/CrowdSimulation.jsx - Safety reports
frontend/src/components/safety/SafetyReportForm.jsx - Safety API client
frontend/src/services/safety/safetyApi.js - Crowd API client
frontend/src/services/safety/crowdApi.js
External services
- PostgreSQL
Other components
- Student
Connections 25
- Student → App routes: uses
- App routes → Login and registration: routes to
- App routes → Dashboard: routes to
- App routes → Clubs and details: routes to
- App routes → Discussions: routes to
- App routes → Events: routes to
- App routes → Polls and voting: routes to
- App routes → Profile: routes to
- App routes → CampusShield: routes to
- App routes → CrowdFlow page: routes to
- Login and registration → REST API client: requests auth
- Dashboard → REST API client: requests data
- Clubs and details → REST API client: requests club data
- Discussions → REST API client: requests posts
- Events → REST API client: requests events
- Polls and voting → REST API client: requests polls
- Profile → REST API client: requests account data
- REST API client → FastAPI endpoints: sends REST requests
- FastAPI endpoints → SQLAlchemy models: queries and updates
- FastAPI endpoints → Database sessions: uses sessions
- Database sessions → PostgreSQL: connects to
- CrowdFlow page → Scenario inputs: renders
- Scenario inputs → CrowdFlow page: submits scenario
- CrowdFlow page → Route simulation: simulates route
- CrowdFlow page → Simulation results: passes results