clipper/README.md

79 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2021-12-04 05:14:41 +00:00
# Clipper
2021-12-12 18:03:51 +00:00
[![Build Status](https://drone.netflux.io/api/badges/rob/clipper/status.svg?ref=refs/heads/main)](https://drone.netflux.io/rob/clipper)
2021-12-04 05:14:41 +00:00
Clipper is a Youtube audio clipper developed using modern web technologies.
* Go
* protobuf, grpc-web
* Typescript
* React
It is currently in early development.
## Development
2021-12-05 10:56:18 +00:00
### Dependencies
It is required that an [ffmpeg](https://ffmpeg.org/download.html) binary is available in the current path.
### Running the app
The backend requires configuration via environment variables - see `backend/.env.example`. All variables must be set unless they are marked as optional.
Then, the server can be started with:
```
cd backend/
go run cmd/clipper/main.go
```
The frontend can be launched on localhost:3000 with:
```
cd frontend/
yarn start
```
2021-12-04 05:14:41 +00:00
### Code generation
2021-12-05 10:56:18 +00:00
To regenerate protobuf code and GRPC stubs, first install [protoc](https://grpc.io/docs/protoc-installation/) and the GRPC dependencies:
2021-12-04 05:14:41 +00:00
```
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
```
2021-12-05 10:56:18 +00:00
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:
2021-12-04 05:14:41 +00:00
```
cd backend/
sqlc generate
```
Mocks require [mockery](https://github.com/vektra/mockery) to be installed, and can be regenerated with:
```
2021-12-07 19:58:11 +00:00
go generate ./...
```
2021-12-04 05:39:29 +00:00
### Migrations
2021-12-05 10:56:18 +00:00
Database migrations require [golang-migrate](https://github.com/golang-migrate/migrate).
2021-12-04 05:39:29 +00:00
```
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
```