{"id":23236783,"url":"https://github.com/pratikpc/google-mail-oauth-rest-api","last_synced_at":"2025-04-05T21:17:38.902Z","repository":{"id":125288667,"uuid":"299074861","full_name":"pratikpc/google-mail-oauth-rest-api","owner":"pratikpc","description":"Created a Node.JS Express based App to use GMail and OAuth2 using REST APIs instead of libraries","archived":false,"fork":false,"pushed_at":"2020-09-27T19:16:52.000Z","size":250,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T00:38:49.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pratikpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-27T16:41:15.000Z","updated_at":"2020-09-27T19:16:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"e978c428-7c3f-4983-862b-b54d1a38f597","html_url":"https://github.com/pratikpc/google-mail-oauth-rest-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fgoogle-mail-oauth-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fgoogle-mail-oauth-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fgoogle-mail-oauth-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fgoogle-mail-oauth-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pratikpc","download_url":"https://codeload.github.com/pratikpc/google-mail-oauth-rest-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399897,"owners_count":20932881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-19T04:12:44.987Z","updated_at":"2025-04-05T21:17:38.895Z","avatar_url":"https://github.com/pratikpc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Mail Oauth Rest API\n\n1. No Google/OAuth Library used\n    - Instead we are using API calls to do the same thing that\n    - The Library handles for us\n    - Refer to [controller](/controller) directory for more information\n2. Used ESLint and Prettier to improve Code Formatting and Maintainability\n3. Used GitHub Actions to make it easier to verify\n4. Realistically I would prefer [TSED](https://tsed.io/) because of it's integration with OpenAPI and usage of TypeScript Generators\n    1. Using OpenAPI would improve Code Documentation Massively.\n5. Libraries used Additional\n\n    1. http-status-codes\n        - Makes Code Easier to Follow Especially if one does not remember all HTTP Status Codes\n        - And most of us do not remember any of them except the famous ones\n    2. Node-Fetch\n        - Used Node-Fetch to make API Requests\n        - Provides same API as Browser Fetch\n\n6. Usage\n    1. Run `npm install`\n    2. Run `npm run build` to generate our JavaScript Code\n    3. Run `npm start` to start the server\n    4. By Default runs on Port 8000\n7. Automated Deployment to Heroku\n8. File generated is api.json\n    - Stores all the User Metadata\n9. Realistically we would\n    - Issue a JWT Token on Sign In to User\n    - Ask user to use this JWT Token on each and every attempt\n    - Only if JWT Token Is Accepted to be user's own\n    - Do we let user Send an EMail\n    - But this is a Proof of Concept\n\n# ROUTES\n\n1.  URL GET /  \n    [Homepage](/): [/](/) Log into Google  \n    ![Homepage](docs/SignIn.png)\n2.  POST Mail [/email/:sender](/email/:sender)  \n    Send Email in specified format  \n    Your GMail ID is Assumed from the Params  \n     ![Send EMail](docs/SendMail.png)\n3.  POST Mail. [/email/](/email)  \n    Assume Sender from Header  \n     Send Email in specified format  \n     ![Send EMail](docs/SendMailNoParams.png)\n4.  POST MAIL RFC2822 [/email/RFC2822/:sender](/email/RFC2822)  \n    Specify Sender EMail ID as Param  \n     Send EMail with RFC2822 format\n    ![Send RFC2822 EMail](docs/RFC2822Mail.png)\n5.  GET Users [/users](/users) Lists all Users  \n    ![List Registered Local Users](docs/Users.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpc%2Fgoogle-mail-oauth-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpratikpc%2Fgoogle-mail-oauth-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpc%2Fgoogle-mail-oauth-rest-api/lists"}