Skip to content

viraj-gavade/Secure-Valut

Repository files navigation

PassVault - Minimal, Encrypted Password Manager

PassVault Logo Next.js TypeScript License

A privacy-first, minimal password manager with client-side AES-256 encryption. Built with Next.js, TypeScript, and MongoDB.

πŸš€ Live Demo

🌐 Live Application: https://your-passvault.vercel.app

Replace the URL above with your actual Vercel deployment URL after deploying

Demo Credentials (if you want to provide a demo account):

  • Email: demo@passvault.com
  • Password: DemoPass123!@#

πŸ“Ή Video Demo

πŸŽ₯ Watch Demo (60-90 seconds)

Upload your screen recording to YouTube, Loom, or any video platform and add the link here

πŸ”’ Security & Encryption

PassVault uses client-side AES-256 encryption via the crypto-js library. This means:

  • Your passwords are encrypted in your browser before being sent to the server
  • The server only stores encrypted blobs - we never see your plaintext passwords
  • Zero-knowledge architecture - your master password is the encryption key
  • No password = No decryption - Even we can't recover your passwords

Encryption Library: crypto-js

We use crypto-js for client-side encryption:

// Encryption
const encrypted = CryptoJS.AES.encrypt(plaintext, masterPassword).toString();

// Decryption
const decrypted = CryptoJS.AES.decrypt(encrypted, masterPassword);
const plaintext = decrypted.toString(CryptoJS.enc.Utf8);

Why crypto-js?

  • Widely adopted and battle-tested
  • Pure JavaScript implementation
  • Works in both browser and Node.js
  • Simple API for AES-256 encryption
  • No external dependencies

✨ Features

Core Features

  • βœ… Password Generator - Customizable length (8-32), character types, exclude similar chars
  • βœ… Encrypted Vault - Store passwords, usernames, URLs, and notes
  • βœ… CRUD Operations - Create, read, update, delete vault items
  • βœ… Auto-Clear Clipboard - Copied passwords clear after 15 seconds
  • βœ… Search & Filter - Quickly find vault items
  • βœ… JWT Authentication - Secure email/password auth

Security Features

  • πŸ” Client-side AES-256 encryption
  • πŸ”’ Zero-knowledge architecture
  • πŸ›‘οΈ Password strength validator
  • πŸ”‘ Secure password generator
  • 🚫 No plaintext storage

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • MongoDB Atlas account (free tier works)

Installation

  1. Clone the repository
git clone <your-repo-url>
cd next-app
  1. Install dependencies
npm install
  1. Set up environment variables
cp .env.example .env.local

Edit .env.local with your configuration:

MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/passvault?retryWrites=true&w=majority
JWT_SECRET=your-super-secret-random-string-here
NEXT_PUBLIC_APP_URL=http://localhost:3000
  1. Run the development server
npm run dev
  1. Open your browser Navigate to http://localhost:3000

πŸ“ Project Structure

next-app/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/         # Authentication endpoints
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ login/
β”‚   β”‚   β”‚   β”‚   └── signup/
β”‚   β”‚   β”‚   └── vault/        # Vault CRUD endpoints
β”‚   β”‚   β”œβ”€β”€ auth/             # Auth pages
β”‚   β”‚   β”‚   β”œβ”€β”€ login/
β”‚   β”‚   β”‚   └── signup/
β”‚   β”‚   β”œβ”€β”€ dashboard/        # Main vault dashboard
β”‚   β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”‚   └── page.tsx         # Landing page
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ PasswordGenerator.tsx
β”‚   β”‚   β”œβ”€β”€ VaultItemCard.tsx
β”‚   β”‚   └── VaultItemForm.tsx
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ dbConnect.ts     # MongoDB connection
β”‚   β”‚   └── jwt.ts           # JWT utilities
β”‚   β”œβ”€β”€ Model/
β”‚   β”‚   β”œβ”€β”€ User.model.ts
β”‚   β”‚   └── Vault.model.ts
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ encryption.ts    # AES encryption utilities
β”‚   β”‚   └── passwordGenerator.ts
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── index.ts
β”‚   └── Schemas/             # Zod validation schemas
β”œβ”€β”€ public/
β”œβ”€β”€ .env.local
β”œβ”€β”€ package.json
└── README.md

🎨 Tech Stack

Frontend

  • Next.js 15 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • React Hooks - State management

Backend

  • Next.js API Routes - Serverless API endpoints
  • MongoDB Atlas - Cloud database
  • Mongoose - MongoDB ODM

Security & Auth

  • crypto-js - Client-side AES-256 encryption
  • bcryptjs - Password hashing (server-side)
  • jsonwebtoken - JWT authentication
  • Zod - Schema validation

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/signup - Register new user
  • POST /api/auth/login - Login and get JWT token

Vault

  • GET /api/vault - Get all vault items (requires auth)
  • POST /api/vault - Create vault item (requires auth)
  • PUT /api/vault/[id] - Update vault item (requires auth)
  • DELETE /api/vault/[id] - Delete vault item (requires auth)

πŸ§ͺ Usage Flow

  1. Sign Up - Create account with email, username, and master password
  2. Login - Authenticate with email and master password
  3. Generate Password - Use the generator to create strong passwords
  4. Add Item - Store credentials with encryption
  5. Manage Vault - Search, edit, delete, and copy passwords
  6. Logout - Secure logout clears local storage

🌐 Deployment

Quick Deploy to Vercel

Deploy with Vercel

Manual Deployment Steps

1. Prepare MongoDB Atlas

  1. Create a free account at MongoDB Atlas
  2. Create a new cluster (free M0 tier available)
  3. Create a database user with read/write permissions
  4. Network Access: Add your IP or 0.0.0.0/0 (allow from anywhere)
  5. Get your connection string:
    mongodb+srv://username:password@cluster0.xxxxx.mongodb.net/passvault?retryWrites=true&w=majority
    

2. Deploy to Vercel

  1. Push to GitHub:

    git init
    git add .
    git commit -m "Initial commit - PassVault"
    git remote add origin https://github.com/yourusername/passvault.git
    git push -u origin main
  2. Import to Vercel:

    • Go to Vercel Dashboard
    • Click "Add New" β†’ "Project"
    • Import your GitHub repository
    • Configure project settings:
      • Framework Preset: Next.js
      • Root Directory: ./
      • Build Command: npm run build
      • Output Directory: .next
  3. Add Environment Variables:

    MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/passvault?retryWrites=true&w=majority
    JWT_SECRET=your-super-secret-random-string-min-32-chars
    NEXT_PUBLIC_APP_URL=https://your-app.vercel.app

    Generate JWT_SECRET:

    # On Linux/Mac/Git Bash
    openssl rand -base64 32
  4. Deploy:

    • Click "Deploy"
    • Wait 2-3 minutes
    • Your app will be live at https://your-app.vercel.app

3. Post-Deployment

  1. Update NEXT_PUBLIC_APP_URL with your actual Vercel URL
  2. Test the application:
    • Sign up with a test account
    • Add a vault item
    • Verify encryption in MongoDB
  3. Update README with your live URL

Alternative Deployment Options

Deploy to Netlify

npm run build
# Upload .next folder to Netlify

Deploy to Railway

  • Connect GitHub repository
  • Add environment variables
  • Deploy automatically

Docker Deployment

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
CMD ["npm", "start"]

For detailed deployment instructions, see DEPLOYMENT.md

πŸ›‘οΈ Security Best Practices

  • βœ… Use a strong, unique master password
  • βœ… Never share your master password
  • βœ… Enable 2FA on your email account
  • βœ… Regularly update your passwords
  • βœ… Use the password generator for new accounts
  • βœ… Log out when using shared devices

πŸ“ Encryption Note

How PassVault Protects Your Data:

  1. Client-Side Encryption: When you save a password, it's encrypted in your browser using your master password as the key
  2. Server Storage: Only the encrypted blob is stored in MongoDB - never plaintext
  3. Decryption: When you view your vault, items are decrypted locally using your master password
  4. Zero-Knowledge: The server has no way to decrypt your data without your master password

Important: If you forget your master password, your data cannot be recovered. This is by design for maximum security


πŸ”— Links


πŸ“Š Project Status

  • βœ… Core Features: Complete
  • βœ… Security: Client-side AES-256 encryption implemented
  • βœ… Authentication: JWT-based auth working
  • βœ… Documentation: Complete with guides
  • ⏳ Deployment: Ready to deploy to Vercel
  • ⏳ Demo Video: To be recorded

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ“§ Contact & Support


πŸ™ Acknowledgments


πŸ” PassVault - Your secrets, encrypted and safe.

About

A privacy-first, minimal password manager with client-side AES-256 encryption. Built with Next.js, TypeScript, and MongoDB.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages