A production-style authentication and user account system built with Next.js App Router, focused on clean separation of concerns, extensibility, and real-world patterns.
- A frontend-first authentication system
- Covers login, registration, email verification, password reset, profile
- Built using Next.js App Router architecture
- ❌ Not a toy demo
- ❌ Not backend-heavy
- ❌ Not framework-locked to auth providers like Firebase/Auth0
- Next.js (App Router)
- React
- Redux Toolkit
- Yup (Validation)
- Custom Auth Services (API abstraction)
-
Next.js App Router
- Modern routing model
- Server + client separation
- Future-proof
-
Redux Toolkit
- Predictable global state
- Scales better than Context for auth
- Dev-friendly debugging
-
Yup
- Declarative schema validation
- Single source of truth for forms
- Layered Frontend Architecture
- Clear separation between:
- UI
- State
- Business logic
- API layer
- UI Components
- Validation Layer
- Redux Store
- Service Layer (API)
- Backend (external)
menn/ ├── src/ ├── public/ ├── middleware.js ├── package.json
src/app/ ├── layout.js ├── page.jsx ├── globals.css ├── account/ │ ├── login/ │ ├── register/ │ ├── verify-email/ │ ├── reset-password-link/ │ └── reset-password-confirm/ ├── user/ │ ├── profile/ │ └── change-password/
- Mirrors real product URLs
- Keeps auth flows isolated
- Easier feature ownership
components/ ├── Navbar.jsx ├── UserSidebar.jsx ├── LoadingIndicator.jsx
Why
- No page-specific logic
- Pure presentation components
- Reusable across routes
lib/ ├── store.js ├── services/ │ └── auth.js
- Redux store configuration
- API communication
- Zero UI concerns
validation/ └── schemas.js
Why
- Centralized validation
- Prevents duplication
- Easy schema evolution
- Route-level protection
- Authentication checks
- Redirect logic
Why
- Prevents unauthorized access early
- Cleaner page components
- Login
- Registration
- Email verification
- Password reset (link + confirm)
- Profile access
- Password change
- Token handling abstracted
- UI never talks directly to APIs
- Stateless frontend assumption
- Global auth state
- User session handling
- Async request tracking
- Predictable updates
- Easier debugging
- Scales with app complexity
- Email format
- Password rules
- Form-level constraints
Why
- Keeps components clean
- One change updates all forms
- Global styles in
globals.css - Component-scoped styles where needed
Why
- Simple
- Maintainable
- No over-engineering
npm install
npm run dev
