Your task is to develop a core system for an email client with essential functionalities. This system will connect with user email accounts (initially focusing on Outlook) and manage email data efficiently.
Continuously monitor for changes in user email data (e.g., moved emails, read/unread status, flags, deletions, new emails) even during the initial sync.
Go to Azure Portal:
- Navigate to the Azure Portal
- Go to "Azure Active Directory" > "App registrations" > Press New Registration button for app registration
- Set Delegated type API Permissions:
Mail.Read
,offline_access
,openid
,profile
,User.Read
Clone the repository:
git clone https://github.com/tasmidur/email-engine-core.git
The backend API is exposed on port 3000.
Navigate to api directory and copy .env.example to .env and modify the .env
according to the below
# Application URL
APP_URL=http://localhost:3000
# Server Port
PORT=3000
# Socket Port
SOCKET_PORT=3019
# Frontend App URL
FRONTEND_APP_URL=http://localhost:3001
# Outlook OAuth Credentials
OUTLOOK_CLIENT_ID=your_outlook_client_id
OUTLOOK_CLIENT_SECRET=your_outlook_client_secret
OUTLOOK_TENANT_ID=your_outlook_tenant_id
OUTLOOK_TENANT=common
OUTLOOK_REDIRECT_URL=http://localhost:8080/auth/outlook/callback
# Session Secret Key
SESSION_SECRET_KEY=your_session_secret_key
# JWT Secret Key
JWT_SECRET=your_jwt_secret
# Encryption Key
ENCRYPTION_KEY=your_encryption_key
# Token Expiry Durations
ACCESS_TOKEN_EXPIRY=1d
REFRESH_TOKEN_EXPIRY=1d
# Notification Handler URL
NOTIFICATION_HANDLER_URL=https://your-notification-handler-url.com
# Elasticsearch Host
ELASTICSEARCH_HOST=http://elasticsearch:9200
For local environments, you can use Ngrok to set a real IP address for the notification handler:
docker run -it -e NGROK_AUTHTOKEN=<token> ngrok/ngrok http 3000
cd email-engine-core/api
yarn
yarn run build
The frontend is exposed on port 3001.
Navigate to frontend directory and copy .env.example to .env and modify the .env
according to the below
# Application Name
NEXT_PUBLIC_APP_NAME=MailBox
# Application Version
NEXT_PUBLIC_APP_VERSION=1.0.0
# Application Environment
NEXT_PUBLIC_APP_ENV=local
# API Base URL
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000
cd email-engine-core/frontend
yarn
yarn run build
init To run the project using Docker:
docker-compose up --build