Skip to content

Build a tool that will parse and check the emails in a Google and Outlook email ID, and respond to the e-mails based on the context using AI. Use BullMQ as the tasks scheduler. Earn brownie points by building using typescript

Notifications You must be signed in to change notification settings

Tech-Spookezz/ReachInbox.AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

ReachInBox Assignment

Overview

The ReachInBox assignment aims to build a tool that parses and manages emails from Google and Outlook accounts, using AI to categorize and respond to emails based on their context. This server-based application is built with Node.js and Express, leveraging various APIs and AI services.

image

Technologies Used

  • Node.js
  • Express.js
  • OpenAI
  • Google APIs
  • Microsoft Graph API

npm Packages Used

  • dotenv: For managing environment variables.
  • axios: For making HTTP requests.
  • bullMQ: For task scheduling and processing queues.
  • google-auth-library: For integrating Google OAuth2.0.
  • ioredis: Redis client for Node.js.
  • @microsoft/microsoft-graph-client: Microsoft Graph API client library.
  • @azure/msal-node: Microsoft Authentication Library (MSAL) for Node.js.

Installation and Setup

  1. Clone the Repository:

    git clone https://github.com/shraddha-gawde/reachInbox-assignment.git
    cd reachInbox-assignment/server
  2. Install Dependencies:

    npm install
  3. Set Environment Variables: Create a .env file in the root directory with the following environment variables:

    PORT=***
    GOOGLE_CLIENT_ID=***
    GOOGLE_CLIENT_SECRET=***
    GOOGLE_REDIRECT_URI=***
    GOOGLE_REFRESH_TOKEN=***
    OPENAI_API_KEY=***
    redis_port=***
    redis_host=***
    redis_pass=***
    AZURE_CLIENT_ID=***
    AZURE_CLIENT_SECRET=***
    AZURE_TENANT_ID=***
    
  4. Run the Server:

    npm start
  5. Start the Worker:

    npm run server

API Endpoints

Google's OAuth2.0:

  • GET /auth/google: Google authentication.

  • GET /api/mail/userInfo/:email: Retrieve user profile information.

  • GET /api/mail/allDrafts/:email: Get all draft emails.

  • GET /api/mail/read/:email/message/:message: Read a specific email by ID.

  • GET /api/mail/list/:email: Get a list of emails.

  • POST /api/mail/sendMail: Send an email with a specified label.

    {
        "from": "sender@example.com",
        "to": "recipient@example.com",
        "label": "interested/not-interested/more-information"
    }
  • POST /api/mail/sendone/:id: Send a single email by ID.

    {
        "from": "sender@example.com",
        "to": "recipient@example.com"
    }
  • POST /api/mail/sendMultiple/:id: Send an email to multiple recipients by ID.

    {
        "from": "sender@example.com",
        "to": ["recipient1@example.com", "recipient2@example.com"]
    }

Microsoft Azure's OAuth2.0:

  • GET /outlook/signin: Microsoft Azure authentication for Outlook.

  • GET /outlook/callback: Callback for obtaining access tokens.

  • GET /outlook/profile: Get user profile data.

  • GET /outlook/all-Mails/:email: Get all mails of a user.

  • GET /outlook/:email/read-Msg/:message: Read a specific mail by message ID.

  • POST /outlook/:email/send-Mail: Send an email using Outlook.

    {
        "from": "sender@example.com",
        "to": "recipient@example.com",
        "label": "interested/not-interested/more-information"
    }
  • POST /outlook/sendone/:email/:id: Send a single email using Outlook with BullMQ.

    {
        "from": "sender@example.com",
        "to": "recipient@example.com"
    }

Additional Links

About

Build a tool that will parse and check the emails in a Google and Outlook email ID, and respond to the e-mails based on the context using AI. Use BullMQ as the tasks scheduler. Earn brownie points by building using typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published