GithubHelp home page GithubHelp logo

shraddha-gawde / reachinbox-assignment Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 5.0 126 KB

The assignment is to 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.

Home Page: https://reach-inbox-assignment.vercel.app/

JavaScript 95.24% HTML 1.68% CSS 3.08%
bullmq express-js google-gmail-api google-oauth2 html-css-javascript node-js outlook queue azure-oauth openai

reachinbox-assignment's Introduction

ReachInBox Assignment

Server

The assignment is to 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 This is a server-based application built with Node.js and Express. It uses various packages such as openai for AI functionalities, googleapis for Google APIs, and axios for HTTP requests and bullMQ to process queues. image

deployed links :

frontend : Link
Backend : Link
API documentation build with postman documentation - Link

technologies used:

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

npm packages used

  • dotenv
  • Axios
  • bullMQ
  • google-auth-library
  • ioredis
  • @microsoft/microsoft-graph-client
  • @azure/msal-node

Installation setup

  1. Clone the repository to your local machine
git clone https://github.com/shraddha-gawde/reachInbox-assignment.git
  1. Navigate to the root directory of the project directory :
cd server
  1. Run npm install to install all the dependencies
  2. Create a .env file in the root directory with the same IDs as specified in the documentation.

Running the server

  1. To start the server, run the following command in your terminal
npm start

This will start the server at localhost:5000 (or whatever port you have specified). or we can use backend deployed link also.

  1. To start the worker.js file, run the following command in your terminal
npm run server

API Endpoints

For Google's OAuth2.0:

  • https://reachinbox-assignment-4rf9.onrender.com/auth/google - GET for google authentication
  • https://reachinbox-assignment-4rf9.onrender.com/api/mail/userInfo/:email - GET request to view user profile
  • https://reachinbox-assignment-4rf9.onrender.com/api/mail/allDrafts/:email - GET request to view all drafts mail.
  • https://reachinbox-assignment-4rf9.onrender.com/api/mail/read/:email/message/:message - GET request to read a specific email(using id).
  • https://reachinbox-assignment-4rf9.onrender.com/api/mail/list/:email - GET request to get a list of mails.
  • https://reachinbox-assignment-4rf9.onrender.com/api/mail/sendMail - POST request send mail with label.
{
    "from":"[email protected]",
    "to":"[email protected]",
    "label":"interested/not-interested/more-information"
}
  • https://reachinbox-assignment-4rf9.onrender.com/api/mail/sendone/:id - POST request to send a single mail for particular ID.
    • https://reachinbox-assignment-4rf9.onrender.com/api/mail/sendMultiple/:id - POST request to send a single mail for particular ID.

image

For microsoft azur's OAuth2.0:

  • https://reachinbox-assignment-4rf9.onrender.com/outlook/signin - GET for micosoft azur authentication for outlook
  • https://reachinbox-assignment-4rf9.onrender.com/outlook/callbak - GET for micosoft azur getting access token
  • https://reachinbox-assignment-4rf9.onrender.com/outlook/profile - GET request to get profile data for particular user
  • https://reachinbox-assignment-4rf9.onrender.com/outlook/all-Mails/{email} - GET request for get ist of all mails of outllok user
  • https://reachinbox-assignment-4rf9.onrender.com/outlook/{email}/read-Msg/{:message} = GET request to read partivcular mail using messange id
  • https://reachinbox-assignment-4rf9.onrender.com/outlook/{email}/send-Mail - post request for sending mail to another user using outlook
{
    "from":"[email protected]",
    "to":"[email protected]"
     "label":"interested/not-interested/more-information"
}
  • https://reachinbox-assignment-4rf9.onrender.com/outlook/sendone/:email/:id - post request for sending mail to another user using outlook using bullmq

Sample .env sample:

PORT = ***
GOOGLE_CLIENT_ID = ***
GOOGLE_CLIENT_SECRET = ***
GOOGLE_REDIRECT_URI = ***
GOOGLE_REFRESH_TOKEN = ***
OPENAI_SECRECT_KEY = ***
redis_port = ***
redis_host = ***
redis_pass = ***
AZURE_CLIENT_ID = ***
AZURE_CLIENT_SECRET = *** 
AZURE_TENANT_ID = ***

reachinbox-assignment's People

Contributors

shraddha-gawde avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

reachinbox-assignment's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.