1.9 KiB
1.9 KiB
Neah Email Application
A modern email client built with Next.js, featuring email composition, viewing, and management capabilities.
Email Processing Workflow
The application handles email processing through a centralized workflow:
-
Email Fetching: Emails are fetched through the
/api/courrierendpoints using user credentials stored in the database. -
Email Parsing: Raw email content is parsed using:
- Server-side:
simpleParserfrommailparserlibrary via/api/parse-emailAPI route - Client-side:
decodeEmailfunction inlib/mail-parser-wrapper.ts
- Server-side:
-
HTML Sanitization: Email HTML content is sanitized and processed using:
cleanHtmlfunction inlib/mail-parser-wrapper.ts(centralized implementation)- CSS styles are optionally preserved and scoped to prevent leakage
-
Email Display: Sanitized content is rendered in the UI with proper styling and security measures
-
Email Composition: The
ComposeEmailcomponent handles email creation, replying, and forwardinginitializeForwardedEmailfunction prepares forwarded email content- Email is sent through the
/api/courrier/sendendpoint
Deprecated Functions
Several functions have been marked as deprecated in favor of centralized implementations:
- Check the
DEPRECATED_FUNCTIONS.mdfile for a complete list of deprecated functions and their replacements.
Project Structure
/app- Main application routes and API endpoints/components- Reusable React components/lib- Utility functions and services/services- Domain-specific services, including email service/server- Server-side utilities
Dependencies
- Next.js 15
- React 18
- ImapFlow for IMAP interactions
- Mailparser for email parsing
- Prisma for database interactions
- Tailwind CSS for styling
Development
# Install dependencies
npm install
# Start the development server
npm run dev
# Build for production
npm run build