This is a robust, full-stack application designed to provide a centralized interface for connecting to, syncing, and processing emails from multiple IMAP accounts. The application securely stores user credentials, syncs email data to a dedicated database, and provides a clean user interface for managing accounts and viewing emails.
- Secure User Authentication: Full registration and login system using JWT (JSON Web Tokens) for secure, stateless sessions.
- Encrypted Credential Storage: User email account passwords are encrypted using AES-256 before being stored in the database.
- Email Account Management (CRUD):
- Users can add new IMAP email accounts.
- Users can view a list of all their added accounts.
- Users can delete their saved accounts with a confirmation step.
- Live IMAP Connection Testing: Ability to test the connection to an email account in real-time to verify credentials.
- Mailbox (Folder) Discovery: Fetches and displays the complete folder structure of a connected email account.
- Incremental Email Syncing:
- Performs an initial bulk sync of a selected mailbox.
- Subsequent syncs are incremental, fetching only new emails to ensure speed and efficiency.
- Saves all parsed email data (sender, subject, date, body, etc.) to a MongoDB database.
- Paginated Email Viewer: A clean UI to browse through thousands of synced emails with "Next" and "Previous" page controls.
- Email Detail View: A modal view to read the full, formatted HTML content of any synced email.
- Backend: Node.js, NestJS, Mongoose, Passport.js (for JWT), node-imap, mailparser
- Frontend: React.js, Vite, TypeScript, Tailwind CSS, Axios, React Router
- Database: MongoDB
-
Navigate to the email-processor-backend directory.
-
Install dependencies:
npm install -
Create a .env file in the root of the backend project and add the following variables:
# A secure, random string for signing JWTs
JWT_SECRET=YOUR_VERY_SECRET_KEY
# A 64-character hex string (crypto.randomBytes(32).toString('hex'))
ENCRYPTION_KEY=YOUR_ENCRYPTION_KEY
# A 32-character hex string (crypto.randomBytes(16).toString('hex'))
ENCRYPTION_IV=YOUR_ENCRYPTION_IV
# Your MongoDB connection string (e.g., from MongoDB Atlas)
DATABASE_URL=mongodb+srv://...- Run the development server:
npm run start:devThe backend will be running at http://localhost:8080.
-
Navigate to the email-processor-frontend directory.
-
Install dependencies:
npm install -
Run the development server:
npm run devThe frontend will be running at http://localhost:5173.