How swapnaniltripathy/spotfree works
SpotFree is a campus room-discovery and management product. Users enter through the Next.js app, browse room availability or identify a room, inspect details, then reserve or update status where permitted; recommendations, QR/manual identification, history, timetable, notifications, and profile functions are distinct branches. The frontend context and mock data provide the evidenced room state, while a separate Express backend exposes OTP, authentication, and room API routes backed by database utilities. The README describes backend integration as a roadmap; sampled source does not establish that the frontend calls these endpoints.
Main entry points: SpotFreeContext.tsx Application state · server.js Express API · RoomIdentifiedScreen.tsx Identified room · page.tsx App entry
Components 26
Room workflows
- Room discovery
frontend/components/screens/RoomAvailabilityScreen.tsx - Room details
frontend/components/screens/RoomDetailsScreen.tsx - Room recommendation
frontend/components/screens/BestRoomRequirementsScreen.tsx - QR identification
frontend/components/screens/ScanRoomQRScreen.tsx - Manual identification
frontend/components/screens/EnterRoomNumberScreen.tsx - Identified room
frontend/components/screens/RoomIdentifiedScreen.tsx - Status updates
frontend/components/screens/UpdateRoomStatusScreen.tsx - Reservation controls
frontend/components/ReservationWindow.tsx - Status history
frontend/components/screens/StatusHistoryScreen.tsx - Timetable
frontend/components/screens/MyTimetableScreen.tsx - Notifications
frontend/components/screens/NotificationsScreen.tsx - Profile
frontend/components/screens/ProfileScreen.tsx - Room administration
frontend/components/screens/ManageRoomsScreen.tsx
Backend services
- Express API
backend/server.js - Auth routes
backend/routes/auth.js - OTP routes
backend/routes/otp.js - Room routes
backend/routes/rooms.js - Session handling
backend/lib/session.js - Room scheduler
backend/lib/scheduler.js
State and persistence
- Application state
frontend/context/SpotFreeContext.tsx - UI preferences
frontend/context/UIPrefsContext.tsx - Mock domain data
frontend/lib/mockData.ts - Database access
backend/lib/db.js
Other components
- Campus user
Connections 30
- Campus user → App entry: opens
- App entry → Application state: reads state
- App entry → App shell: renders
- App shell → Room discovery: shows screen
- Room discovery → Application state: reads rooms
- Room details → Application state: reads room
- Room recommendation → Application state: requests match
- QR identification → Application state: identifies room
- Manual identification → Application state: identifies room
- Identified room → Application state: reads room
- Status updates → Application state: updates status
- Reservation controls → Application state: validates booking
- Status history → Application state: reads history
- Timetable → Application state: reads schedule
- Notifications → Application state: reads notices
- Profile → Application state: reads profile
- Room administration → Application state: manages rooms
- Application state → Mock domain data: loads initial data
- Room discovery → Room details: opens room
- QR identification → Identified room: passes identity
- Manual identification → Identified room: passes identity
- Identified room → Status updates: starts update
- Express API → Auth routes: dispatches
- Express API → OTP routes: dispatches
- Express API → Room routes: dispatches
- Express API → Database access: initializes
- Express API → Room scheduler: starts
- Auth routes → Session handling: uses sessions
- Auth routes → Database access: queries users
- Session handling → Database access: finds user