From 75e09c05cf914ddb478de2887a80d2393143847f Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Sun, 5 Dec 2021 11:56:18 +0100 Subject: [PATCH] Update README.md and gitignore --- .gitignore | 4 --- README.md | 73 ++++++++++++++++++++++++++++-------------------------- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index ceeabbc..c50247e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ /backend/.env /backend/debug/ - -# generated files: -/backend/generated -/frontend/src/generated diff --git a/README.md b/README.md index edfc138..5e50878 100644 --- a/README.md +++ b/README.md @@ -11,42 +11,9 @@ It is currently in early development. ## Development -### Code generation +### Dependencies -To generate protobuf code and GRPC stubs, first install [protoc](https://grpc.io/docs/protoc-installation/) and the GRPC dependencies: - -``` -go install google.golang.org/protobuf/cmd/protoc-gen-go@latest -go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest -``` - -Then generate the code with: - -``` -./protogen.sh -``` - -To generate the database access layer, first install [sqlc](https://sqlc.dev/). - -``` -cd backend/ -sqlc generate -``` - -### Migrations - -Database migrations require `golang-migrate`. - -``` -go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest -``` - -Migrations then can be run with: - -``` -cd backend/ -migrate -path sql/migrations -database $DATABASE_URL up -``` +It is required that an [ffmpeg](https://ffmpeg.org/download.html) binary is available in the current path. ### Running the app @@ -65,3 +32,39 @@ The frontend can be launched on localhost:3000 with: cd frontend/ yarn start ``` +### Code generation + +To regenerate protobuf code and GRPC stubs, first install [protoc](https://grpc.io/docs/protoc-installation/) and the GRPC dependencies: + +``` +go install google.golang.org/protobuf/cmd/protoc-gen-go@latest +go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +``` + +Then generate the code with: + +``` +./protogen.sh +``` + +To regenerate the database access layer, first install [sqlc](https://sqlc.dev/). New queries can be added to `backend/sql/queries.sql`, and code regenerated with: + +``` +cd backend/ +sqlc generate +``` + +### Migrations + +Database migrations require [golang-migrate](https://github.com/golang-migrate/migrate). + +``` +go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest +``` + +Migrations then can be run with: + +``` +cd backend/ +migrate -path sql/migrations -database $DATABASE_URL up +```