Skip to content

Idansss/ReplyNowAI-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“§ Reply-Now Inbox

AI-Powered Email Triage for SMEs β€” Transform your inbox into a revenue engine

Reply-Now Inbox is an intelligent email management platform that helps founders and sales teams prioritize what matters. With AI-driven classification, personalized triage rules, and seamless Gmail/Outlook integration, you'll never miss an important email again.


πŸš€ Key Features

✨ Smart Email Triage

  • AI Priority Scoring (0-100): Automatically ranks emails by urgency and importance
  • Category Classification: Urgent, Important, Normal, Low Priority, Newsletter, Promotional, Spam
  • Sentiment Analysis: Positive, Neutral, Negative, Angry
  • Intent Detection: Request, Question, Information, Sales, Meeting, Follow-up

🎯 Personalization Engine

  • VIP Senders: Always prioritize emails from key contacts
  • Priority Keywords: Boost emails containing specific terms
  • Auto-Archive Rules: Automatically triage newsletters and low-priority domains
  • Learning System: Gets smarter with every interaction (defensibility!)

πŸ”— Email Integrations

  • Gmail via OAuth 2.0
  • Outlook via Microsoft Graph API
  • Automatic background sync every 5 minutes
  • Support for multiple email accounts

πŸ€– AI Features

  • Email Summaries: 1-2 sentence TL;DR of each email
  • Suggested Responses: AI-generated reply drafts
  • Entity Extraction: Automatically identifies people, companies, dates, and amounts
  • Tone Customization: Professional, Casual, or Friendly

πŸ“‹ Tech Stack

Component Technology
Backend FastAPI (Python 3.11+)
Database PostgreSQL 15
Cache/Queue Redis 7
Task Queue Celery
AI OpenAI GPT-4 / Anthropic Claude
Email APIs Gmail API, Microsoft Graph
Deployment Docker + Docker Compose

πŸ—οΈ Project Structure

ReplyNowAI/
β”œβ”€β”€ backend/
β”‚   └── app/
β”‚       β”œβ”€β”€ api/
β”‚       β”‚   └── v1/
β”‚       β”‚       └── endpoints/
β”‚       β”‚           β”œβ”€β”€ auth.py          # Authentication (register/login)
β”‚       β”‚           β”œβ”€β”€ users.py         # User management & preferences
β”‚       β”‚           β”œβ”€β”€ emails.py        # Email triage endpoints
β”‚       β”‚           └── integrations.py  # Gmail/Outlook OAuth
β”‚       β”œβ”€β”€ core/
β”‚       β”‚   β”œβ”€β”€ config.py               # Settings & configuration
β”‚       β”‚   β”œβ”€β”€ database.py             # SQLAlchemy setup
β”‚       β”‚   └── security.py             # JWT & password hashing
β”‚       β”œβ”€β”€ models/
β”‚       β”‚   β”œβ”€β”€ user.py                 # User model
β”‚       β”‚   β”œβ”€β”€ email_account.py        # Connected email accounts
β”‚       β”‚   β”œβ”€β”€ email.py                # Email records with AI data
β”‚       β”‚   β”œβ”€β”€ email_label.py          # Email labels/tags
β”‚       β”‚   └── user_preferences.py     # Personalization data
β”‚       β”œβ”€β”€ schemas/                    # Pydantic schemas
β”‚       β”œβ”€β”€ services/
β”‚       β”‚   β”œβ”€β”€ gmail_service.py        # Gmail API integration
β”‚       β”‚   β”œβ”€β”€ outlook_service.py      # Outlook API integration
β”‚       β”‚   └── ai_service.py           # AI classification engine
β”‚       β”œβ”€β”€ workers/
β”‚       β”‚   β”œβ”€β”€ celery_app.py           # Celery configuration
β”‚       β”‚   └── tasks.py                # Background tasks (email sync)
β”‚       └── main.py                     # FastAPI application
β”œβ”€β”€ alembic/                            # Database migrations
β”œβ”€β”€ docker-compose.yml                  # Local development setup
β”œβ”€β”€ Dockerfile                          # Production Docker image
β”œβ”€β”€ requirements.txt                    # Python dependencies
└── README.md                           # You are here!

πŸ› οΈ Installation & Setup

Prerequisites

  • Python 3.11+
  • PostgreSQL 15+
  • Redis 7+
  • Docker & Docker Compose (recommended)
  • OpenAI API Key
  • Google OAuth Credentials (for Gmail)
  • Microsoft OAuth Credentials (for Outlook)

Option 1: Docker (Recommended)

  1. Clone the repository
git clone <your-repo-url>
cd ReplyNowAI
  1. Create .env file
cp .env.example .env

Edit .env and add your credentials:

# Required
SECRET_KEY=your-secret-key-here-change-in-production
JWT_SECRET_KEY=your-jwt-secret-here

# OpenAI
OPENAI_API_KEY=sk-...

# Google OAuth (Gmail)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_REDIRECT_URI=http://localhost:8000/api/v1/integrations/gmail/callback

# Microsoft OAuth (Outlook)
MICROSOFT_CLIENT_ID=your-microsoft-client-id
MICROSOFT_CLIENT_SECRET=your-microsoft-client-secret
MICROSOFT_REDIRECT_URI=http://localhost:8000/api/v1/integrations/outlook/callback
  1. Start all services
docker-compose up -d
  1. Run database migrations
docker-compose exec backend alembic upgrade head
  1. Access the application

Option 2: Local Development

  1. Install dependencies
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
  1. Start PostgreSQL and Redis
# Using Docker
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=replynow postgres:15
docker run -d -p 6379:6379 redis:7-alpine
  1. Run database migrations
alembic upgrade head
  1. Start the application
# Terminal 1: FastAPI backend
uvicorn backend.app.main:app --reload --port 8000

# Terminal 2: Celery worker
celery -A backend.app.workers.celery_app worker --loglevel=info

# Terminal 3: Celery beat (scheduler)
celery -A backend.app.workers.celery_app beat --loglevel=info

πŸ“š API Documentation

Authentication

Register

POST /api/v1/auth/register
Content-Type: application/json

{
  "email": "founder@startup.com",
  "password": "SecurePass123!",
  "full_name": "Jane Founder"
}

Login

POST /api/v1/auth/login
Content-Type: application/json

{
  "email": "founder@startup.com",
  "password": "SecurePass123!"
}

Response:
{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
  "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
  "token_type": "bearer"
}

Connect Email Accounts

Gmail OAuth Flow

# Step 1: Get authorization URL
GET /api/v1/integrations/gmail/auth-url
Authorization: Bearer <access_token>

Response:
{
  "auth_url": "https://accounts.google.com/o/oauth2/auth?...",
  "state": "random-state-string"
}

# Step 2: User authorizes in browser, then callback
GET /api/v1/integrations/gmail/callback?code=<auth_code>
Authorization: Bearer <access_token>

Outlook OAuth Flow

# Step 1: Get authorization URL
GET /api/v1/integrations/outlook/auth-url
Authorization: Bearer <access_token>

# Step 2: Callback after authorization
GET /api/v1/integrations/outlook/callback?code=<auth_code>
Authorization: Bearer <access_token>

Sync Emails

POST /api/v1/integrations/accounts/{account_id}/sync
Authorization: Bearer <access_token>

Response:
{
  "message": "Successfully synced 47 new emails",
  "total_fetched": 50,
  "new_emails": 47
}

Manage Emails

Get Inbox (Smart Triage)

GET /api/v1/emails?page=1&page_size=50&min_priority=70&is_read=false
Authorization: Bearer <access_token>

Response:
{
  "emails": [
    {
      "id": "uuid",
      "subject": "Urgent: Customer issue needs attention",
      "from_email": "customer@example.com",
      "from_name": "Important Customer",
      "priority_score": 95,
      "category": "urgent",
      "sentiment": "negative",
      "intent": "request",
      "ai_summary": "Customer experiencing critical bug affecting production system.",
      "is_read": false,
      "received_at": "2025-11-02T10:30:00Z"
    }
  ],
  "total": 150,
  "page": 1,
  "page_size": 50,
  "has_more": true
}

Update Email (Mark as Read, Star, Override Priority)

PATCH /api/v1/emails/{email_id}
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "is_read": true,
  "is_starred": true,
  "user_priority_override": 90
}

Archive Email

POST /api/v1/emails/{email_id}/archive
Authorization: Bearer <access_token>

Get Email Statistics

GET /api/v1/emails/stats/overview
Authorization: Bearer <access_token>

Response:
{
  "total_emails": 487,
  "unread_count": 142,
  "urgent_count": 23,
  "important_count": 67,
  "by_category": {
    "urgent": 23,
    "important": 67,
    "normal": 298,
    "low_priority": 99
  }
}

User Preferences (Personalization)

Get Preferences

GET /api/v1/users/me/preferences
Authorization: Bearer <access_token>

Update Preferences

PUT /api/v1/users/me/preferences
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "triage_rules": {
    "vip_senders": ["ceo@bigclient.com", "investor@vc.com"],
    "priority_keywords": ["urgent", "asap", "revenue", "churn"],
    "low_priority_domains": ["newsletter.com", "marketing.io"],
    "auto_archive_patterns": ["unsubscribe"]
  },
  "ai_preferences": {
    "enable_summaries": true,
    "enable_suggested_responses": true,
    "tone": "professional",
    "summary_length": "medium"
  },
  "notification_settings": {
    "priority_threshold": 75,
    "quiet_hours_start": "22:00",
    "quiet_hours_end": "07:00"
  }
}

πŸ” Security Features

  • JWT Authentication: Secure token-based auth with refresh tokens
  • Password Hashing: Bcrypt with salt
  • OAuth 2.0: Industry-standard for Gmail/Outlook
  • Token Encryption: Access tokens encrypted at rest (production)
  • Rate Limiting: Prevent abuse (configurable)
  • CORS: Configurable allowed origins

🎯 Business Model

Pricing Tiers

Tier Price Features
Trial Free (14 days) Full access, 1 email account
Basic $49/user/month 3 email accounts, 5k emails/month
Pro $99/user/month Unlimited accounts, advanced AI

Key Metrics

  • ACV: $588 - $1,188/user/year
  • Buyer: Founder, Sales Lead, Ops Manager
  • Single-seat win β†’ Team expansion: Low friction
  • Churn defense: Personalization data creates lock-in

πŸ§ͺ Testing

# Run tests
pytest

# With coverage
pytest --cov=backend/app --cov-report=html

# Run specific test file
pytest backend/tests/test_ai_service.py

🚒 Deployment

Production Checklist

  1. Environment Variables

    • Change SECRET_KEY and JWT_SECRET_KEY
    • Use production database URL
    • Set ENVIRONMENT=production
    • Set DEBUG=False
    • Configure CORS_ORIGINS
    • Add SENTRY_DSN for error tracking
  2. Database

    • Use managed PostgreSQL (AWS RDS, Google Cloud SQL)
    • Enable backups
    • Set up connection pooling
  3. Redis

    • Use managed Redis (AWS ElastiCache, Redis Cloud)
    • Enable persistence
  4. Security

    • Enable HTTPS
    • Set up rate limiting
    • Encrypt tokens at rest
    • Regular security audits
  5. Monitoring

    • Set up Sentry for error tracking
    • Configure log aggregation
    • Set up uptime monitoring
    • Create alerts for critical errors

Deploy to Cloud

Option 1: Docker + AWS ECS/Fargate

  • Build image: docker build -t replynow:latest .
  • Push to ECR
  • Deploy via ECS task definition

Option 2: Kubernetes

  • Create K8s manifests
  • Use Helm charts for deployment
  • Configure autoscaling

Option 3: Platform-as-a-Service

  • Heroku, Render, Railway
  • Push code and platform handles deployment

🀝 Contributing

We welcome contributions! Please:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“„ License

This project is proprietary. All rights reserved.


πŸ†˜ Support


πŸ—ΊοΈ Roadmap

Q1 2025

  • Browser extension (Chrome/Firefox)
  • Mobile apps (iOS/Android)
  • Slack integration
  • Advanced analytics dashboard

Q2 2025

  • Team collaboration features
  • Custom AI training on company data
  • Email scheduling & reminders
  • CRM integrations (Salesforce, HubSpot)

Q3 2025

  • Multi-language support
  • Voice-to-email responses
  • Advanced automations & workflows
  • API for third-party integrations

πŸ’‘ Why Reply-Now Wins

  1. Direct Revenue Impact: Helps founders/sales teams respond to high-value opportunities faster
  2. Clear Buyer: Decision-maker is the user (no 10-person committee)
  3. Viral Expansion: "Why don't you have this?" spreads within teams
  4. Defensible Moat: Personalization data improves with use (switching cost)
  5. Triage Ritual: Becomes the morning routine (high engagement = low churn)

Built with ❀️ for busy founders who refuse to let their inbox control their day.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors