How aayushmaan-54/authn-mern-app works
Component Details
A. Frontend Section (Top):
• React Components (group by features: Auth, Profile, Users)
• Redux Store (show slices: auth, email, search)
• Router Configuration
B. Backend Section (Middle):
• Express Server
• Middleware (authMiddleware)
• Controllers (userController)
• Route Handlers
C. Database & Services Section (Bottom):
• MongoDB (with User and Token collections)
• External Services:
• Google OAuth 2.0
• Cloudinary
• Gmail/Nodemailer
Connection Flows
• Authentication flows:
• Regular login flow
• OAuth flow
• Device verification flow
• API requests between frontend and backend
• Data flow between backend and database
• External service interactions
Specific Implementation Details
Frontend Architecture:
React App
• Components (Auth, Layout, UI)
• Pages (Auth, Profile, Users)
• Redux Store
• Auth Slice
• Email Slice
• Search Slice
• Router
Backend Architecture:
Express Server
• Middleware (Auth, Validation)
• Controllers
• Models (User, Token)
• Routes
• Utils (JWT, Email)
Important Flows to Highlight
Authentication Flows:
• Registration with email verification
• Login with device recognition
• Password reset flow
• OAuth authentication
Data Flows:
• User profile updates
• Role management
• Session handling