Vault is a full-stack, open-source password and TOTP (Time-based One-Time Password) manager. It features strong cryptography, a modern web frontend, and a robust Node.js/Express backend. The project is designed for both personal and small team use, with a focus on security and usability.
- Secure password storage (AES-GCM encryption)
- TOTP (2FA) secret management
- User authentication (JWT-based)
- Master password for client-side encryption
- Role-based access (admin/user, optional)
- Audit logging (optional, can be removed for MVP)
- Modern React/Next.js frontend
- Responsive UI with Tailwind CSS
[User] ⇄ [Frontend (Next.js)] ⇄ [Backend (Express.js)] ⇄ [PostgreSQL (Prisma ORM)]
- Frontend: Next.js (React), communicates with backend via REST API
- Backend: Express.js, handles authentication, API, and database
- Database: PostgreSQL, managed via Prisma ORM
- Client-side encryption: All sensitive data (passwords, TOTP secrets) are encrypted in the browser using AES-GCM before being sent to the backend.
- Master Password: Never leaves the client. Used to derive encryption keys (PBKDF2 or similar).
- Backend: Stores only encrypted blobs and metadata. No plaintext secrets are ever stored.
- TOTP: Secrets are encrypted and stored, never exposed in plaintext to the backend.
- Password Hashing: User passwords are hashed with bcrypt before storage.
- Framework: Node.js with Express.js
- Authentication: JWT tokens, with middleware for protected routes
- ORM: Prisma for PostgreSQL
- API Endpoints: User registration, login, credential CRUD, TOTP CRUD
- Environment Variables: Uses dotenv for config (see
.env.example) - Audit Logging: (Optional) Logs key events for admin review
- Framework: Next.js (React)
- UI: Tailwind CSS for styling
- State Management: React Context for auth and master password
- Encryption: Uses WebCrypto API for AES-GCM encryption/decryption
- Features: Add/edit/delete credentials, TOTP management, master password modal, responsive design
- User: Stores user info, hashed password, and role
- Credential: Stores encrypted username/password blobs and metadata
- TOTP: Stores encrypted TOTP secrets and metadata
- AuditLog: (Optional) Stores audit events for admin review
- Clone the repo
- Install dependencies in both
backend/andfrontend/ - Set up PostgreSQL and configure
.envfiles - Run migrations:
npm run migratein backend - Start backend:
npm run devin backend - Start frontend:
npm run devin frontend
- Deploy backend to AWS Lambda or EC2
- Use Amazon RDS for PostgreSQL
- Store secrets in AWS Secrets Manager
- Set environment variables for production
- Use a CDN (CloudFront) for frontend
- Master password is never sent to the server
- All sensitive data is encrypted client-side
- JWT tokens are used for session management
- Audit logging and admin roles are optional and can be removed for MVP
- Regularly update dependencies and review security best practices
Pull requests and issues are welcome! Please see CONTRIBUTING.md for guidelines.
MIT