How dishan919/security-system works
This is a browser-based account security and session-management product. Users register or log in, then manage active sessions, review login history, trust devices, connect external accounts, and adjust security settings; administrators have a separate dashboard. The client calls an Express API, whose authentication and domain handlers operate on MongoDB models. The graph preserves the documented OAuth, notification, device, and session branches. The README is empty, and unsampled modules are represented only where the source index or routing evidence supports them.
Main entry points: authController.js Registration and login · api.jsx API client · server.js HTTP app · authMiddleware.js Session verification
Components 30
Web client
- Page router
client/src/App.jsx - API client
client/src/api.jsx - Auth state
client/src/authState.js - Dashboard
client/src/pages/Dashboard.jsx - Login review
client/src/components/LoginReview.jsx - Session controls
client/src/components/ActiveSessions.jsx - Trusted devices
client/src/components/TrustedDevices.jsx - Account connections
client/src/components/ConnectedAccounts.jsx - History page
client/src/pages/History.jsx - Security settings
client/src/pages/SecuritySettings.jsx
Authentication
- HTTP app
server/server.js - Auth routes
server/routes/authRoutes.js - Registration and login
server/controllers/authController.js - Session verification
server/middleware/authMiddleware.js
Security operations
- Session routes
server/routes/sessionRoutes.js - History routes
server/routes/historyRoutes.js - History review
server/controllers/historyController.js - Device routes
server/routes/deviceRoutes.js - Email service
server/utils/sendEmail.js
Connected accounts
- Account routes
server/routes/accountRoutes.js - OAuth flow
server/routes/oauthRoutes.js
Persistent data
- User records
server/models/user.js - Auth sessions
server/models/AuthSession.js - Login history
server/models/LoginHistory.js - Trusted device records
server/models/TrustedDevice.js - Connected accounts
server/models/Account.js - OAuth attempts
server/models/OAuthAttempt.js - Notifications
server/models/Notification.js
Other components
- User
- OAuth providers
Connections 48
- User → Page router: uses
client/src/App.jsx - Page router → API client: initializes auth
client/src/App.jsx - Page router → Dashboard: routes to
client/src/App.jsx - Page router → History page: routes to
client/src/App.jsx - Page router → Security settings: routes to
client/src/App.jsx - Page router → Auth state: initializes
client/src/App.jsx - API client → Auth state: clears auth
client/src/api.jsx - Dashboard → Login review: renders
client/src/pages/Dashboard.jsx - Dashboard → Session controls: renders
client/src/pages/Dashboard.jsx - Dashboard → Trusted devices: renders
client/src/pages/Dashboard.jsx - Dashboard → Account connections: renders
client/src/pages/Dashboard.jsx - Login review → API client: submits review
client/src/components/LoginReview.jsx - History page → Login review: renders
client/src/pages/History.jsx - History page → API client: loads history
client/src/pages/History.jsx - Session controls → API client: loads sessions
client/src/components/ActiveSessions.jsx - Account connections → API client: calls API
client/src/components/ConnectedAccounts.jsx - Security settings → API client: calls API
client/src/pages/SecuritySettings.jsx - HTTP app → Auth routes: mounts routes
server/server.js - HTTP app → History routes: mounts routes
server/server.js - HTTP app → Session routes: mounts routes
server/server.js - HTTP app → Device routes: mounts routes
server/server.js - HTTP app → Account routes: mounts routes
server/server.js - HTTP app → OAuth flow: mounts routes
server/server.js - Auth routes → Registration and login: dispatches
server/routes/authRoutes.js - Auth routes → Session verification: guards password change
server/routes/authRoutes.js - Registration and login → User records: reads and creates
server/controllers/authController.js - Registration and login → Auth sessions: creates sessions
server/controllers/authController.js - Registration and login → Login history: records logins
server/controllers/authController.js - Registration and login → Trusted device records: updates device
server/controllers/authController.js - Registration and login → Notifications: creates alerts
server/controllers/authController.js - Registration and login → Email service: sends alert
server/controllers/authController.js - Session verification → Auth sessions: checks session
server/middleware/authMiddleware.js - Session routes → Session verification: verifies token
server/routes/sessionRoutes.js - Session routes → Auth sessions: reads and revokes
server/routes/sessionRoutes.js - History routes → Session verification: verifies token
server/routes/historyRoutes.js - History routes → History review: dispatches
server/routes/historyRoutes.js - History review → Login history: reads and reviews
server/controllers/historyController.js - History review → Trusted device records: revokes device
server/controllers/historyController.js - History review → Auth sessions: revokes session
server/controllers/historyController.js - History review → Notifications: creates alert
server/controllers/historyController.js - History review → Email service: sends alert
server/controllers/historyController.js - Device routes → Session verification: verifies token
server/routes/deviceRoutes.js - Account routes → Session verification: verifies token
server/routes/accountRoutes.js - Account routes → Connected accounts: manages accounts
server/routes/accountRoutes.js - OAuth flow → Session verification: verifies token
server/routes/oauthRoutes.js - OAuth flow → OAuth attempts: records attempts
server/routes/oauthRoutes.js - OAuth flow → Auth sessions: checks active session
server/routes/oauthRoutes.js - OAuth flow → Connected accounts: upserts identity
server/routes/oauthRoutes.js