Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.81 KB

File metadata and controls

29 lines (20 loc) · 1.81 KB

Sheets API

This project is a simple API for a Google Sheet. It is built upon Nest.js in the backend and Nuxt in the frontend. Configuration is stored in MySQL. Authentication is handled by Google OAUTH2.

Write commands are queued in Redis and executed sequentially to avoid rate limit issues. Therefore this service is not suitable for high volume use with realtime read consistency. In other words, a write command will not be reflected in the read command until the write command is executed, which may take a few seconds.

Setup

  1. Clone this repo.
  2. Set up a Google Cloud project. Set user type to Internal in OAuth consent screen if you want to restrict access to a specific domain.
  3. Create a Google service account and download the JSON file.
  4. Leave the JSON file in the root of the repo so that the docker-compose.yml file can copy it into the backend container.
  5. Edit the .env file with your MySQL credentials and Google Cloud project credentials and other settings.
  6. Run docker compose up -d to start the service, which will automatically build the container and start MySQL and Redis.

Usage

  1. Visit the frontend at http://localhost:3000.
  2. Log in with your Google account. Add a new sheet.
  3. Give it a descriptive name.
  4. Enter the exact sheet id. You can find it in the url of the Google Sheet: httpw://docs.google.com/spreadsheets/d/1OIoMOgtddeREFeDenx2b2BQnIsLeHa6yQm37eBhQEX8/edit?gid=0#gid=0
  5. Recommended: enter a random string to protect read access.
  6. Recommended: enter a random string to protect write access.
  7. Click "Submit".

API

See https://localhost:3000/app/docs