How deekshith1707/syncwave works
SyncWave is a collaborative music-listening app: users authenticate, create or join a room, then share playback and room activity. The frontend routes users through authentication and into Home or a Session; backend HTTP routes handle identity, room membership, and song operations, while the server’s Socket.io handlers coordinate live room state. Songs are stored in Firebase and session/user records in MongoDB. Major components are retained from the source index and README; some frontend-to-backend wiring and unsampled features are documented but not visible in excerpts, so those links are dashed or omitted.
Main entry points: App.js App routing · AuthContext.js Auth state · server.js API and sockets · songController.js Song handlers
Components 23
Web client
- App routing
frontend/src/App.js - Auth screens
frontend/src/components/Auth/Auth.js - OAuth redirect
frontend/src/pages/AuthRedirect.js - Auth state
frontend/src/context/AuthContext.js - Auth service
frontend/src/services/authServices.js - Route guard
frontend/src/components/PrivateRoute.js - Room discovery
frontend/src/pages/Home.js - Session room UI
frontend/src/pages/Session.js
HTTP API
- Auth routes
Backend/routes/authRoutes.js - Identity handlers
Backend/controllers/authController.js - JWT protection
Backend/middleware/auth.js - Session routes
Backend/routes/sessionRoutes.js - Session handlers
Backend/controllers/sessionController.js - Song routes
Backend/routes/songRoutes.js - Song handlers
Backend/controllers/songController.js
Live collaboration
- API and sockets
Backend/server.js
Persistence and storage
- Database connection
Backend/config/db.js - User records
Backend/models/User.js - Session records
Backend/models/Session.js - Song records
Backend/models/Song.js
Other components
- Listener
- MongoDB
- Firebase Storage
Connections 33
- Listener → App routing: uses
frontend/src/App.js - App routing → Auth screens: routes to
frontend/src/App.js - App routing → OAuth redirect: routes to
frontend/src/App.js - App routing → Room discovery: routes to
frontend/src/App.js - App routing → Session room UI: routes to
frontend/src/App.js - App routing → Route guard: guards routes
frontend/src/App.js - App routing → Auth state: provides state
frontend/src/App.js - Auth screens → Auth state: uses state
frontend/src/components/Auth/Auth.js - OAuth redirect → Auth state: sets identity
frontend/src/pages/AuthRedirect.js - Auth state → Auth service: loads user
frontend/src/context/AuthContext.js - Route guard → Auth state: checks identity
frontend/src/components/PrivateRoute.js - Room discovery → Auth state: reads identity
frontend/src/pages/Home.js - Session room UI → Auth state: reads identity
frontend/src/pages/Session.js - Auth service → Auth routes: calls auth API
- Auth routes → Identity handlers: dispatches
Backend/routes/authRoutes.js - Auth routes → JWT protection: protects profile
Backend/routes/authRoutes.js - Identity handlers → User records: reads and writes
Backend/controllers/authController.js - Session routes → Session handlers: dispatches
Backend/routes/sessionRoutes.js - Session routes → JWT protection: protects routes
Backend/routes/sessionRoutes.js - Session handlers → Session records: reads and writes
Backend/controllers/sessionController.js - Session handlers → User records: populates host
Backend/controllers/sessionController.js - Song routes → Song handlers: dispatches
Backend/routes/songRoutes.js - Song routes → JWT protection: protects routes
Backend/routes/songRoutes.js - Song handlers → Session records: reads and updates
Backend/controllers/songController.js - Song handlers → Song records: creates and reads
Backend/controllers/songController.js - Song handlers → Firebase Storage: uploads audio
Backend/controllers/songController.js - API and sockets → Auth routes: mounts routes
Backend/server.js - API and sockets → Session routes: mounts routes
Backend/server.js - API and sockets → Song routes: mounts routes
Backend/server.js - API and sockets → Database connection: connects database
Backend/server.js - API and sockets → Session records: persists room state
Backend/server.js - Database connection → MongoDB: connects
- Session room UI → API and sockets: exchanges live events
README.md