This is a full stack app for responding to your gmail mailbox while you are out on vacation.
-
Check for new emails in a giver user's gmail mailbox. ( Login using Google Account)
-
App sends a reply automatically to threads threads with no prior replies.
-
App adds a custom 'Me_On_Vacation' label to email and move email to the label.
-
repeat sequence of 1-3 in random intervals of 45 to 120 seconds.
Runs the frontend server. Open [http://localhost:8000] to view it in your browser.
Runs the backend server. Open [http://localhost:5000] to use it in your project.
📦BackEnd
┣ 📂routes
┃ ┗ 📜routes //main computations and GMAIL API intergration
┗ 📜server //Backend server file
📦frontEnd
┣ 📂views
┃ ┗ 📜login.ejs // layout structure and responsive component.
┗ 📜app //Frontend entry point file.
Googleapis for Gmail API
-
It is a Node.js client library for using Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT tokens is included.
-
Used in this project for using GMAIL API and all related methods to
-
I have implemented Point 4 and 5 from these integration docs for google sign in on my app.
-
Callback function handleAuth is used to handle credential responses. Make yours here
- OAuth2 client allows you to retrieve an access token, refresh it, and retry the request seamlessly. Documentation here
- Scope to add testing of the app in future.
- Creating just one application and using files to store and retrieve the credential token is another approach but in large scale application using files with data storage is not preferred for bigger amounts of data.
- Better error handling of login or authorization errors and inform users on frontend to retry login.
- Take user input on frontend about what label they want on their replies if needed.
- User Sign out should be implemented and it must stops setInterval at the backend when trigerred.
- App backend crashes sometimes in case of large number of unread emails on user account, this should be handled for efficiently.