Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import/Export to Google Drive #108

Open
aahnik opened this issue May 19, 2024 · 0 comments
Open

Import/Export to Google Drive #108

aahnik opened this issue May 19, 2024 · 0 comments
Assignees

Comments

@aahnik
Copy link
Contributor

aahnik commented May 19, 2024

As we plan to do integrations with several external services, we can write all our integrations inside the same folder.

Let's start by creating a new nest js module integrations (suggest a better name ?)

Folder structure

We can create an integrations module and structure it by having folders like controllers, services

Inside them, we can have gdrive.controller.ts and gdrive.service.ts, and in the future a controller and service for every integration we do.

API endpoints

  1. integrations/gdrive/authorize to authorize our application (via Google OAuth consent screen + Google Drive access scope, so we are authorized on behalf of a user. We need to save the tokens, and brainstorm about a secure token storage strategy, or one-time permissions ? This would add a new Google Drive connection. The user might not give us access to their entire drive, but a specific folder of their drive, and our work will be under that folder.
  2. integrations/gdrive/connections (multiple CRUD verbs, but same route) See a list of connected Google Drive accounts, edit permissions, or delete them.
  3. integrations/gdrive/export to initiate the process of writing files in space to the user's Google Drive. this is a long-running task and should be added to our bullmq. This API endpoint should accept parameters such as spacePath, Google drive path, and google account ID ( in case the user has multiple connected accounts)
  4. integrations/gdrive/import, same as above, but files from the drive will be downloaded, and put into the user's space

Points to think

  1. should points 2 and 3 be merged into a single endpoint?
  2. (add challenges/design dilemmas here)

Official Google Drive API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants