A modern authentication and onboarding flow built with Next.js 16, React 19, TypeScript, and Tailwind CSS. Features manual form validation, dark mode support, and a polished user interface.
- Sign Up - Full form validation with password requirements
- Login - Email/password authentication
- Forgot Password - Email-based password recovery flow
- Reset Password - Secure password reset functionality
- Protected Routes - Dashboard requires authentication
Multi-step form with manual validation:
- Company details (name and role)
- Team information (size and industry)
- Goal selection (multi-select checkboxes)
- User profile display with avatar
- Organization details from onboarding
- Analytics cards with trend indicators
- Recent activity feed
- Dark/Light theme toggle
- Responsive design
- Clean, modern UI with vibrant colors
- Seamless dark mode support
- Smooth animations and transitions
- Mobile-first responsive layout
- Professional typography (Geist Sans, Geist Mono)
- Framework: Next.js 16.0.3 (App Router)
- React: 19.2.0
- TypeScript: Strict mode enabled
- Styling: Tailwind CSS 4.1.9
- UI Components: Radix UI primitives
- Icons: Lucide React 0.454.0
- Theme: Custom dark/light mode implementation
- Notifications: Sonner for toast notifications
- Analytics: Vercel Analytics
``` ├── app/ │ ├── layout.tsx # Root layout with theme support │ ├── page.tsx # Landing page │ ├── login/page.tsx # Login page │ ├── signup/page.tsx # Sign up page │ ├── onboarding/page.tsx # Multi-step onboarding │ ├── dashboard/page.tsx # Protected dashboard │ ├── forgot-password/page.tsx # Password recovery │ ├── reset-password/page.tsx # Password reset │ └── globals.css # Global styles and theme tokens ├── components/ │ ├── ui/ # Reusable UI components │ ├── theme-toggle.tsx # Dark/Light mode toggle │ └── theme-provider.tsx # Theme context provider ├── types/ │ └── index.ts # TypeScript interfaces └── package.json ```
| Route | Description | Protection |
|---|---|---|
/ |
Landing page with sign up/sign in options | Public |
/signup |
User registration with validation | Public |
/login |
User authentication | Public |
/onboarding |
3-step onboarding wizard | Protected |
/dashboard |
User dashboard with analytics | Protected |
/forgot-password |
Password recovery initiation | Public |
/reset-password |
Password reset completion | Public |
- Node.js 18+ or later
- pnpm, npm, or yarn
-
Clone the repository ```bash git clone https://github.com/YeeshaDev/auth-test ```
-
Install dependencies ```bash npm install
pnpm install (currently used)
yarn install ```
- Run the development server ```bash npm run dev
pnpm dev
yarn dev ```
- Open http://localhost:3000 in your browser
```bash npm run build npm start ```
This project uses localStorage for data persistence for the purpose of this assessment. This approach is NOT production-ready and should not be used for real-world applications handling sensitive user information.
```typescript // User data localStorage.setItem('user', JSON.stringify({ name: string, email: string, password: string, createdAt: string }))
// Onboarding data localStorage.setItem('onboarding', JSON.stringify({ company: string, role: string, teamSize: string, industry: string, goals: string[] }))
// Authentication status localStorage.setItem('isAuthenticated', 'true') ```
For a real-world application, implement proper security measures:
- Backend Authentication: Use secure authentication services (Supabase, Auth0, NextAuth.js)
- Password Hashing: Never store plain text passwords (use bcrypt, argon2)
- Secure Sessions: Implement JWT tokens or secure session cookies
- Database Storage: Store user data in secure databases with encryption
- HTTPS Only: Always use secure connections
- Rate Limiting: Prevent brute force attacks
- Input Sanitization: Validate and sanitize all user inputs server-side
- CSRF Protection: Implement cross-site request forgery protection
This demo focuses on the UI/UX flow and form validation logic rather than backend security implementation.
All types are defined in types/index.ts:
```typescript interface User { name: string email: string password: string createdAt: string }
interface OnboardingData { company: string role: string teamSize: string industry: string goals: string[] }
interface StatCard { title: string value: string change: string trend: 'up' | 'down' icon: string }
interface Activity { id: string type: string message: string timestamp: string icon: string } ```
The application supports both light and dark modes with a custom theme implementation:
- Toggle button in the top-right corner on all pages
- Dashboard header includes theme toggle
- Persistent theme preference via localStorage
- System preference detection on first load
- Smooth transitions between themes
Defined in app/globals.css using CSS variables:
Light Mode:
- Primary: Blue (#3b82f6)
- Secondary: Purple (#8b5cf6)
- Accent: Pink (#ec4899)
- Success: Emerald (#10b981)
Dark Mode:
- Optimized colors for better contrast
- Reduced brightness for comfort
- Accessible color ratios
- Name: Required, minimum 2 characters
- Email: Required, valid email format
- Password: Minimum 8 characters, must contain uppercase, lowercase, and number
- Confirm Password: Must match password
- Email: Required, valid email format
- Password: Required
- Step 1: Company name (min 2 chars), Role (required)
- Step 2: Team size (required), Industry (required)
- Step 3: At least one goal selected
- Manual form validation (no external libraries)
- Type-safe TypeScript throughout
- Responsive design (mobile-first)
- Smooth page transitions
- Loading states on form submissions
- Error handling with user-friendly messages
- Protected route checking
- Clean, maintainable code structure
- Note: Uses mock localStorage for demo purposes only
Edit theme variables in app/globals.css:
```css
@theme inline {
--color-primary: ...;
--color-secondary: ...;
}
```
Modify fonts in app/layout.tsx:
```tsx
import { Cute_Font as YourFont } from 'next/font/google'
```
All UI components are in components/ui/ and can be customized individually.
- Push code to GitHub
- Import project in Vercel
- Deploy automatically
```bash
npm run build
```
Deploy the .next folder to any Node.js hosting platform.
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
MIT
Built with Next.js, React, Tailwind CSS, and Radix UI.