A modern, secure password manager built with Next.js, TypeScript, and MongoDB. Generate strong passwords and store them securely with client-side encryption.
π Live Application: https://assignment-hvg6kh20q-ayushdev2s-projects.vercel.app
π Vercel Dashboard: https://vercel.com/ayushdev2s-projects/assignment
- Visit: Live Demo
- Sign Up: Create account with email/password
- Generate: Create secure passwords with custom options
- Save: Store passwords in encrypted vault
- Search: Find passwords instantly
- Copy: One-click copy with auto-clear
- Password Generator: Customizable length, character types, exclude similar characters
- Simple Authentication: Email/password registration and login
- Secure Vault: Store title, username, password, URL, and notes
- Client-Side Encryption: All passwords encrypted before sending to server
- Copy to Clipboard: Auto-clear after 15 seconds
- Search & Filter: Real-time search across vault items
- Dark Mode: Toggle between light and dark themes
- Tags/Folders: Organize vault items with custom tags
- Responsive Design: Works seamlessly on desktop and mobile
- Password Strength Indicator: Real-time feedback on password quality
- Frontend: Next.js 15 with App Router, TypeScript, Tailwind CSS
- Backend: Next.js API Routes, NextAuth.js
- Database: MongoDB with Mongoose ODM
- Encryption: CryptoJS for client-side AES encryption
- Authentication: NextAuth.js with Credentials provider
- Styling: Tailwind CSS with dark mode support
- All passwords are encrypted using AES encryption before being sent to the server
- Server never stores plaintext passwords
- Encryption key is stored as environment variable
- Database only contains encrypted blobs
- Passwords hashed with bcryptjs (12 rounds)
- JWT sessions with secure cookies
- Input validation and sanitization
- Protection against common attacks (XSS, CSRF)
- Node.js 18+ and npm
- MongoDB instance (local or cloud)
git clone <repository-url>
cd assignmentnpm installcp .env.example .env.localUpdate .env.local with your values:
# MongoDB Connection
MONGODB_URI=mongodb://localhost:27017/password-vault
# NextAuth Configuration
NEXTAUTH_SECRET=your-very-long-secure-secret-key-at-least-32-characters
NEXTAUTH_URL=http://localhost:3000
# Encryption Key (32+ characters)
ENCRYPTION_KEY=your-32-character-encryption-key-change-in-productionMake sure MongoDB is running locally or use a cloud service like MongoDB Atlas.
npm run devOpen http://localhost:3000 in your browser.
npm run build
npm startsrc/
βββ app/ # Next.js App Router pages
β βββ api/ # API routes
β β βββ auth/ # Authentication endpoints
β β βββ vault/ # Vault CRUD operations
β βββ dashboard/ # Dashboard page
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ providers.tsx # Context providers
βββ components/ # React components
β βββ Dashboard.tsx # Main dashboard
β βββ LoginForm.tsx # Auth form
β βββ PasswordGenerator.tsx
β βββ VaultList.tsx # Vault items display
β βββ VaultItemForm.tsx # Add/edit form
βββ contexts/ # React contexts
β βββ ThemeContext.tsx # Dark mode
βββ lib/ # Utilities
β βββ auth.ts # NextAuth config
β βββ crypto.ts # Encryption utilities
β βββ mongodb.ts # DB connection
βββ models/ # MongoDB models
β βββ User.ts # User schema
β βββ VaultItem.ts # Vault item schema
βββ types/ # TypeScript types
βββ next-auth.d.ts # NextAuth types
POST /api/auth/register- User registrationPOST /api/auth/signin- User login (NextAuth)
GET /api/vault- Fetch user's vault itemsPOST /api/vault- Create new vault itemPUT /api/vault/[id]- Update vault itemDELETE /api/vault/[id]- Delete vault item
Library Used: CryptoJS
Algorithm: AES encryption
Why CryptoJS?
- Battle-tested library with wide adoption
- Simple API for AES encryption/decryption
- Good performance for client-side operations
- Supports various encryption algorithms
The crypto implementation includes:
- Secure password generation with customizable options
- Client-side AES encryption before data transmission
- Password strength analysis with detailed feedback
- Protection against similar-looking characters
[60-90 second screen recording showing: register β generate password β save to vault β search β edit β delete]
- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push to main branch
- Netlify: Use
npm run buildand deployout/folder - Railway: Connect GitHub and add environment variables
- Render: Set build command to
npm run build
- Sign Up: Create account with email/password
- Sign In: Login with credentials
- Dashboard: Access password generator and vault
- Generate: Create strong password with options
- Save: Store password with metadata
- Search: Filter vault items
- Edit/Delete: Manage existing items
- Copy: Copy passwords with auto-clear
Check MongoDB to confirm passwords are encrypted:
// In MongoDB shell or Compass
db.vaultitems.find({}, {encryptedPassword: 1, title: 1})
// Should show encrypted blobs, not plaintext passwords- Status: π’ Live and Running
- URL: https://assignment-hvg6kh20q-ayushdev2s-projects.vercel.app
- Build: Successful
- Database: MongoDB Atlas Connected
- SSL: Automatic HTTPS Enabled
- CI/CD: Auto-deploy from GitHub
- Build Time: ~15 seconds
- First Load JS: 102 kB (shared)
- Page Load: Optimized for speed
- Mobile: Fully responsive
- TypeScript for type safety and better development experience
- ESLint configuration for code quality enforcement
- Responsive design with Tailwind CSS v4
- Dark mode with system preference detection
- Accessibility considerations (ARIA labels, keyboard navigation)
- Comprehensive error handling and loading states
- Input validation on both client and server sides
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License.
- π Live Demo: https://assignment-hvg6kh20q-ayushdev2s-projects.vercel.app
- π GitHub Repository: https://github.com/ayushdev2/assignment
- π Vercel Dashboard: https://vercel.com/ayushdev2s-projects/assignment
- LinkedIn Company: Web Development Company
- Founder: Setu Agrawal
π SecureVault MVP - Successfully Deployed & Ready for Use!
Built with β€οΈ using Next.js 15, TypeScript, MongoDB & Vercel