Open
Description
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
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.integrations/gdrive/connections
(multiple CRUD verbs, but same route) See a list of connected Google Drive accounts, edit permissions, or delete them.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 asspacePath
, Google drive path, and google account ID ( in case the user has multiple connected accounts)integrations/gdrive/import
, same as above, but files from the drive will be downloaded, and put into the user's space
Points to think
- should points 2 and 3 be merged into a single endpoint?
- (add challenges/design dilemmas here)
Official Google Drive API
- https://developers.google.com/drive/api/guides/about-sdk
- (add more resources/articles/libraries here)
Metadata
Metadata
Assignees
Labels
No labels