The tapes API is responsible for encapsulating information about the tapes that are available in the Golden VCR library.
The source of truth for tapes is the Golden VCR Inventory spreadsheet on Google Sheets. This application uses the Google Sheets API in order to access the data contained in that spreadsheet.
The tapes API is also responsible for knowing which images are available for any given tape, and where they can be found. Tape images are stored in an S3-compatible bucket in DigitalOcean Spaces: this application uses the AWS SDK to query that bucket for a listing of image files.
On a Linux or WSL system:
- Install Go 1.21
- Clone the terraform repo alongside
this one, and from the root of that repo:
- Ensure that the module is initialized (via
terraform init
) - Ensure that valid terraform state is present
- Run
terraform output -raw env_tapes_local > ../tapes/.env
to populate an.env
file. - Run
./local-db.sh up
to ensure that a Postgres server is running locally (requires Docker).
- Ensure that the module is initialized (via
- Ensure that the auth server is running locally.
- From the root of this repository:
- Run
./db-migrate.sh
to apply database migrations. - Run
go run ./cmd/sync
to sync tape data from the spreadsheet to the local database. - Run
go run ./cmd/server
to start up the server.
- Run
Once done, the tapes server will be running at http://localhost:5000.
If you modify the SQL code in db/queries
, you'll need to generate
new Go code to gen/queries
. To do so, simply run:
./db-generate-queries.sh