QryptMail is a secure, modern webmail client built with a progressive loading architecture matching standard enterprise mail applications (like Gmail and Outlook).
The project is structured as a monorepo containing two decoupled packages:
- qrypt.mail.server: A Node.js and Express backend API service managing OAuth credentials, database connections, and Google/Microsoft mail provider integrations.
- qrypt.mail.frontend: A React and Vite single-page application (SPA) rendering a neumorphic desktop dashboard interface.
To maintain a fast and light payload footprint, data is retrieved lazily on demand:
- Level 1 — Inbox listing: Fetches lightweight email metadata ONLY (Subject, Sender, Date, Unread status, Starred status, and Attachment presence).
- Level 2 — Email Details: Fetches complete email body details (HTML/Text) and attachment structures dynamically when the conversation is clicked.
- Level 3 — Streaming Downloads: Streams attachment binaries directly from external mail providers to client HTTP/2 responses. Avoids loading large files in-memory on the backend.
- Provider Pattern: Abstract interfaces for email synchronization (
MailProvider). Allows hot-swapping providers (Gmail, Outlook) transparently. - Factory Pattern:
AuthFactoryresolves authentication providers based on account scopes.ProviderFactoryresolves active mail providers at runtime.DatabaseFactoryhandles connection routing between MongoDB Atlas and PostgreSQL relational client pools.
- Sandboxed HTML Rendering: Detects and displays HTML email bodies inside isolated, sandboxed
<iframe>panels with dynamic height resizers to isolate email CSS styles and secure auth tokens from CSRF.
- Node.js (v18+)
- MongoDB (Local instance or MongoDB Atlas)
-
Start the Backend Server:
cd qrypt.mail.server npm install npm run dev -
Start the Frontend Dev Server:
cd qrypt.mail.frontend npm install npm run dev -
Open your browser and navigate to
http://localhost:5175.
- Backend (Jest): Run
npm testinsideqrypt.mail.server/ - Frontend (Vitest): Run
npx vitest runinsideqrypt.mail.frontend/
From the workspace root directory, run:
npm install
npm run test:e2ePlaywright will automatically launch both the backend API and frontend Vite servers, run E2E scenarios inside a system Chrome instance headlessly, and tear down the processes cleanly.