How rawathimanshu05/authsystem works
AuthSystem is a MERN authentication app whose visible workflow is registration, login, and a locally displayed profile. The frontend submits credentials to the Express API; registration stores a user, while login verifies credentials and returns a JWT that the browser stores. The app uses that stored token to restore its client-side authenticated state and gate the profile route. The sampled routes do not show protected profile API access, and the imported authorization middleware is not visibly invoked, so no such flow is inferred.
Main entry points: App.js App routing · Userroutes.js User API routes · Login.jsx Login form · Register.jsx Registration form
Components 13
Frontend
- App routing
AuthSystem/frontend/login/src/App.js - Session restore
AuthSystem/frontend/login/src/Refreshhandler.js - Registration form
AuthSystem/frontend/login/src/Components/Register.jsx - Login form
AuthSystem/frontend/login/src/Components/Login.jsx - Profile and logout
AuthSystem/frontend/login/src/Components/Profile.jsx - Toast messages
AuthSystem/frontend/login/src/Util.js
Backend API
- HTTP server
AuthSystem/backend/index.js - User API routes
AuthSystem/backend/Routes/Userroutes.js - JWT authorization
AuthSystem/backend/Middleware/Auth.js
Persistence
- User model
AuthSystem/backend/Models/UserModel.js - Mongo connection
AuthSystem/backend/Models/db.js
Other components
- User
- MongoDB
Connections 17
- User → App routing: uses
- App routing → Registration form: renders
AuthSystem/frontend/login/src/App.js - App routing → Login form: renders
AuthSystem/frontend/login/src/App.js - App routing → Profile and logout: gates route
AuthSystem/frontend/login/src/App.js - App routing → Session restore: mounts
AuthSystem/frontend/login/src/App.js - Session restore → App routing: sets auth state
AuthSystem/frontend/login/src/App.js - Registration form → User API routes: posts registration
AuthSystem/frontend/login/src/Components/Register.jsx - Login form → User API routes: posts login
AuthSystem/frontend/login/src/Components/Login.jsx - Login form → Profile and logout: navigates after login
AuthSystem/frontend/login/src/Components/Login.jsx - Registration form → Toast messages: shows feedback
AuthSystem/frontend/login/src/Components/Register.jsx - Login form → Toast messages: shows feedback
AuthSystem/frontend/login/src/Components/Login.jsx - Profile and logout → Toast messages: shows feedback
AuthSystem/frontend/login/src/Components/Profile.jsx - HTTP server → User API routes: mounts API
AuthSystem/backend/index.js - User API routes → User model: queries and saves
AuthSystem/backend/Routes/Userroutes.js - Mongo connection → MongoDB: connects
AuthSystem/backend/Models/db.js - User API routes → JWT authorization: imports only
AuthSystem/backend/Routes/Userroutes.js - User model → MongoDB: persists user records