Skip to content

Jasonwill2004/ReachInBoxAI

Repository files navigation

ReachInBox AI - Email Synchronization & AI Categorization Platform

A real-time email synchronization platform with AI-powered categorization, Elasticsearch search, and Slack/webhook notifications.

🚀 Quick Start Guide - Phase 1: Real-Time Email Synchronization

Prerequisites

  1. Node.js (v18 or higher) - Download here
  2. Docker Desktop - Download here
  3. At least 2 email accounts (Gmail, Outlook, Yahoo, etc.)

Step 1: Setup Email Accounts

You'll need app-specific passwords for your email accounts:

For Gmail:

  1. Go to Google Account Security
  2. Enable 2-Step Verification (if not already enabled)
  3. Go to App Passwords
  4. Select Mail and Other (Custom name)
  5. Name it "ReachInBox" and click Generate
  6. Copy the 16-character password (remove spaces)

For Outlook/Hotmail:

For Yahoo:

Step 2: Install Dependencies

cd backend
npm install

Step 3: Configure Environment Variables

Copy the example env file and fill in your credentials:

cp .env.example .env

Now open .env and fill in:

# Email Account 1
EMAIL_1_ADDRESS=your-email-1@gmail.com
EMAIL_1_PASSWORD=your-16-char-app-password
EMAIL_1_IMAP_HOST=imap.gmail.com
EMAIL_1_IMAP_PORT=993

# Email Account 2
EMAIL_2_ADDRESS=your-email-2@gmail.com
EMAIL_2_PASSWORD=your-16-char-app-password
EMAIL_2_IMAP_HOST=imap.gmail.com
EMAIL_2_IMAP_PORT=993

Step 4: Start Elasticsearch (Docker)

Make sure Docker Desktop is running, then:

# From the project root directory
docker-compose up -d

Verify Elasticsearch is running:

curl http://localhost:9200

Step 5: Run the Email Sync Service

cd backend
npm run dev

You should see:

✓ Connected to your-email-1@gmail.com
✓ Connected to your-email-2@gmail.com
✓ Server is running on http://localhost:3001
👀 Watching for new emails in real-time...

🧪 Testing Phase 1

1. Check Service Health

curl http://localhost:3001/api/health

2. Check Sync Status

curl http://localhost:3001/api/sync/status

3. View Synced Emails

curl http://localhost:3001/api/emails

4. Test Real-Time Sync

  1. Keep the backend running
  2. Send a NEW email to one of your configured accounts
  3. Watch the console - you should see the new email notification
  4. Check the API again to see your new email

✅ Phase 1 Completion Checklist

  • At least 2 email accounts configured in .env
  • Docker Desktop running with Elasticsearch container
  • Backend server starts without errors
  • All accounts show "connected: true" in /api/health
  • Emails from last 30 days are synced
  • Real-time sync works (send test email and see it appear)
  • API endpoints return expected data

📋 API Endpoints

Endpoint Method Description
/api/health GET Health check & connection status
/api/sync/status GET Detailed sync status
/api/emails GET Get all emails (paginated)
/api/emails?account=email@example.com GET Filter by account
/api/emails/:id GET Get single email by ID
/api/accounts GET List all configured accounts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published