How mermeriem/messaging-system works
This is a browser messaging application with an Express/MySQL backend and Socket.IO real-time transport. Users enter through the React app, authenticate through REST endpoints, then use the dashboard to exchange socket messages and file references; file uploads and downloads use separate HTTP routes. The README also describes notifications and status updates, which align with the server’s socket events. The sampled files do not show persistent chat history or profile-management flows, so those are not represented as implemented subsystems.
Main entry points: App.jsx React app routing · authenticationController.js Auth controller · server.js HTTP and socket server · SocketContext.jsx Socket state
Components 19
Web client
- React app routing
frontend/src/App.jsx - Chat dashboard
frontend/src/pages/DashboardPage.jsx - Login page
frontend/src/pages/LoginPage.jsx - Sign-up page
frontend/src/pages/SignUpPage.jsx - Auth state
frontend/src/context/AuthContext.jsx - Socket state
frontend/src/context/SocketContext.jsx
Authentication
- Auth routes
backend/routes/authenticationRoute.js - Auth controller
backend/controllers/authenticationController.js - Input and token checks
backend/middleware/authenticationMiddlware.js - Password hashing
backend/utils/hashing.js - JWT creation
backend/utils/createToken.js - MySQL connection
backend/config/db.js
Realtime messaging
- HTTP and socket server
backend/server.js
File sharing
- Upload route
backend/routes/sendingFilesRoute.js - Upload handling
backend/middleware/uploadings.js - Download route
backend/routes/downloadFileRoute.js - File download
backend/controllers/downloadFileController.js - Local uploaded files
backend/uploads
Other components
- User
Connections 22
- User → React app routing: uses
README.md - React app routing → Auth state: checks auth
frontend/src/App.jsx - React app routing → Sign-up page: routes to
frontend/src/App.jsx - React app routing → Chat dashboard: routes to
frontend/src/App.jsx - React app routing → Login page: imports
frontend/src/App.jsx - Chat dashboard → Socket state: uses
frontend/src/pages/DashboardPage.jsx - User → Auth routes: submits credentials
README.md - Auth routes → Auth controller: dispatches
backend/routes/authenticationRoute.js - Auth routes → Input and token checks: validates inputs
backend/routes/authenticationRoute.js - Auth controller → MySQL connection: queries
backend/controllers/authenticationController.js - Auth controller → Password hashing: hashes and compares
backend/controllers/authenticationController.js - Auth controller → JWT creation: creates token
backend/controllers/authenticationController.js - Auth controller → Auth state: returns token
- HTTP and socket server → Auth routes: mounts
backend/server.js - HTTP and socket server → Upload route: mounts
backend/server.js - HTTP and socket server → Download route: mounts
backend/server.js - Socket state → HTTP and socket server: exchanges socket events
frontend/src/context/SocketContext.jsx - Socket state → Upload route: uploads files
frontend/src/context/SocketContext.jsx - Upload route → Upload handling: handles upload
backend/routes/sendingFilesRoute.js - User → Socket state: sends messages
README.md - Download route → File download: dispatches
backend/routes/downloadFileRoute.js - File download → Local uploaded files: reads file
backend/controllers/downloadFileController.js