https://github.com/bcc-code/brunstadtv-lite-api
[BCC Media]
https://github.com/bcc-code/brunstadtv-lite-api
bcc-media
Last synced: 12 months ago
JSON representation
[BCC Media]
- Host: GitHub
- URL: https://github.com/bcc-code/brunstadtv-lite-api
- Owner: bcc-code
- Created: 2022-11-02T05:23:33.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-02T05:29:15.000Z (over 3 years ago)
- Last Synced: 2024-06-20T23:56:03.671Z (almost 2 years ago)
- Topics: bcc-media
- Language: Go
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# BTV Lite API
BTV Lite API is a GQL api that share the GraphQL schema with the main BTVPlatform API.
It is backed by a readonly sqlite database that ban be obtained from the main API.
**WARNING**: This is experimental and not stable!
## Goals
The goal is to provide a lightweight system for making BTVPlatform clients work offline
# Development
## Requirements
* [GoLang >=1.18](https://go.dev/)
* [gqlgen >=0.17.20](https://github.com/99designs/gqlgen)
* [sqlc >=1.15](https://github.com/kyleconroy/sqlc)
### Optional stuff
* `make` if you want to use the `Makefile` commands
* [fresh](https://github.com/pilu/fresh) for automatic rebuilds
## Run dev
Note: requires `fresh`
```shell
make run DB_PATH=/path/to/db.sqlite3
```
## Generate code for updated GQL schema
This command assumes that you have the [BTV Platform repository](https://github.com/bcc-code/brunstadtv) checked out at
`../brunstadtv/` relative to this readme file.
If you need to change the source of the GQL schema definition files, look in `./gqlgen.yml` file in this directory.
```shell
make gqlgen
```
## Update SQL statements
```shell
make sqlc
```
## Compile
```shell
make build # <-- Current arch
make build_all # <-- Cross compile for all specified OSs and architectures
```
Results are in the `./dist` folder
# Getting the DB
Send the following GQL query to the BTV Platform
```graphql
query {
export {
dbVersion
url
}
}
```
The returned URL will be valid for 1 hour.
Note that the information is filtered based on the requesting user. This means that without a valid bearer token you
will only receive public data.