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.
frontend : Link
Backend : Link
API documentation build with postman documentation - Link
- Node.js
- Express.js
- OpenAI
- Google APIs
- Microsoft Graph API
- dotenv
- Axios
- bullMQ
- google-auth-library
- ioredis
- @microsoft/microsoft-graph-client
- @azure/msal-node
- Clone the repository to your local machine
git clone https://github.com/shraddha-gawde/reachInbox-assignment.git
- Navigate to the root directory of the project directory :
cd server
- Run
npm install
to install all the dependencies - Create a
.env
file in the root directory with the same IDs as specified in the documentation.
- 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.
- To start the worker.js file, run the following command in your terminal
npm run server
https://reachinbox-assignment-4rf9.onrender.com/auth/google
- GET for google authenticationhttps://reachinbox-assignment-4rf9.onrender.com/api/mail/userInfo/:email
- GET request to view user profilehttps://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.
{
"from":"[email protected]",
"to":"[email protected]"
}
-
https://reachinbox-assignment-4rf9.onrender.com/api/mail/sendMultiple/:id
- POST request to send a single mail for particular ID.
{
"from":"[email protected]",
"to":["[email protected]","[email protected]", "[email protected]"]
}
https://reachinbox-assignment-4rf9.onrender.com/outlook/signin
- GET for micosoft azur authentication for outlookhttps://reachinbox-assignment-4rf9.onrender.com/outlook/callbak
- GET for micosoft azur getting access tokenhttps://reachinbox-assignment-4rf9.onrender.com/outlook/profile
- GET request to get profile data for particular userhttps://reachinbox-assignment-4rf9.onrender.com/outlook/all-Mails/{email}
- GET request for get ist of all mails of outllok userhttps://reachinbox-assignment-4rf9.onrender.com/outlook/{email}/read-Msg/{:message}
= GET request to read partivcular mail using messange idhttps://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 usingbullmq
{
"from":"[email protected]",
"to":"[email protected]"
}
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 = ***