Full-Stack Security · MERN Application · May 27, 2023
PasswordDepot
A full-stack credential vault built on Node.js, Express, MongoDB, and React, featuring stateless JWT authentication, bcrypt password hashing, server-side input validation, and protected CRUD workflows.
Problem Statement
Building a private credential organizer requires strict per-user authorization boundaries on every API route, resilient request validation, and clean client-side state management.
Architecture & Design Decisions
Decoupled MERN stack: React SPA client communicating with an Express REST backend using custom JWT auth middleware, express-validator guards, bcryptjs hashing, and Mongoose document schemas.
Overview
PasswordDepot is a full-stack web application built with Node.js, Express, MongoDB, and React that allows authenticated users to securely store, search, and manage private account entries.
React Client
Protected Vault UI
Auth Middleware
JWT Verification + Validator
Express Routes
Ownership-Scoped CRUD
MongoDB
Mongoose Models + Bcrypt
Key Implementation Details
- Authentication & Access Control: Stateless JSON Web Tokens (
jsonwebtoken) verified on every private endpoint via custom Express middleware, paired withbcryptjspassword hashing. - Defensive Input Validation: Every mutation route validates request payloads through
express-validatorbefore touching persistence models. - Clean Modular Structure: Organized into dedicated
routes/,middleware/,models/,config/, andclient/layers with concurrent dev tooling.
Engineering Challenges
- Enforcing strict ownership checks in Express route middleware so authenticated users can only read or mutate their own vault records.
- Coordinating token persistence, protected client routes, and clean error states between the React frontend and Express API.
What I Learned
- Layered middleware (validation -> authentication -> ownership verification -> controller) keeps Express APIs auditable and predictable.
- Clear separation between client state and REST resources simplifies debugging and deployment.