Fast, privacy‑first password manager. Generate strong passwords, store credentials encrypted client‑side, and manage them in a clean UI.
- Password generator (length slider, include upper/lower/numbers/symbols, exclude look‑alikes)
- Simple auth (email + password, JWT)
- Vault items: title, username, password, URL, notes
- Client‑side encryption (PBKDF2 + AES‑CBC). Server never sees plaintext
- Copy to clipboard with auto‑clear (~15s)
- Basic search/filter by title/URL
- Optional dark mode toggle
- Frontend: Next.js 15 + React 19 + Tailwind
- Backend: Express + Mongoose (TypeScript, compiled to JS)
- DB: MongoDB Atlas
- Crypto: CryptoJS (PBKDF2 + AES‑CBC)
- Clone and install
git clone git@github.com:imshubham07/Password-Generator-Secure-Vault-.git
cd Password-Generator-Secure-Vault-
npm install
- Configure environment variables
cp .env.example .env.local
# Edit .env.local and set values:
# MONGODB_URI=mongodburl
# JWT_SECRET=example
# NEXTAUTH_URL=http://localhost:3000
# PORT=3001
Notes:
- Provide a database name in the URI (e.g., /securevault). If omitted, Mongo defaults to
test. - Secrets are ignored via
.gitignore. Do not commit.env.local.
- Run in development
# Build and start backend (compiled JS; no nodemon needed)
npm run build:backend
node dist-backend/server.js
# In another terminal: start Next.js dev server
node node_modules/next/dist/bin/next dev --turbopack
Or run both with simple scripts (two terminals):
# Terminal A
npm run dev:backend
# Terminal B
npm run dev:frontend
- Sign up or log in
- Generate a password, add an item (only title/url are plaintext on server)
- Copy username/password (clipboard auto‑clears after ~15s)
- Search by title/URL, edit, delete
Health:
curl -sS http://localhost:3001/api/health
Use the web UI for register/login to avoid shell JSON quirks.
- Server stores
title,urlin plaintext for UX/search - Sensitive fields (
username,password,notes) are encrypted intoencryptedData - Models:
users,vaultitems(MongoDB)
Recommended: deploy backend to a free host, then proxy /api from Vercel.
Option A – Proxy /api via vercel.json:
- Deploy backend elsewhere (Render/Railway/Fly)
- Build:
npm run build:backend - Start:
node dist-backend/server.js - Env:
MONGODB_URI,JWT_SECRET,NEXTAUTH_URL=https://<your-vercel>.vercel.app,PORT=3001
- Build:
- Add
vercel.json:
{
"rewrites": [
{ "source": "/api/:path*", "destination": "https://your-backend-host.example.com/api/:path*" }
]
}
- Push to GitHub, import into Vercel, set env if needed.
Option B – Frontend calls external backend URL:
- Set
NEXT_PUBLIC_BACKEND_URLon Vercel (e.g.,https://your-backend-host.example.com/api) - Ensure
src/utils/api.tsuses it in production
- Client‑side key derivation: PBKDF2 (10k iterations) → 256‑bit key; AES‑CBC with random IV per item
- For production hardening, consider Web Crypto API with AES‑GCM and higher KDF cost
- Clipboard is cleared after ~15 seconds if it still contains the copied value
- Added backend TS build target (
tsconfig.backend.json) and scripts:npm run build:backend→ outputsdist-backend/node dist-backend/server.jsto run backend without ts-node/nodemon
- Updated
package.jsonscripts to allow Node‑invoked Next (dev:frontend) and Node‑run backend (dev:backend:node) - Improved env loading in
backend/server.ts(fallback to project‑root.env.local) - Added stricter
.gitignorerules to keep all env files out of Git (root andbackend/) - README now documents env, run steps, deployment, and privacy model
MIT