This is the project that powers scrimpton.com. It is split into two areas:
Backend (/server
):
- Written in Go
- Uses Protobuff/Grpc for the API.
- Static data is stored in Sqlite, Bluge (formerly Bleve) or just flat files (see
var/data
). - Dynamic data (e.g. in-progress contributions) is stored in Postgres.
- Audio files are stored on the server file system (no CDN or cloud storage).
Frontend (/gui
):
- Written in Typescript (Angular)
- Styles are based on Bootstrap.
- Icons are Bootstrap Icons.
There are also some files to give an example of how the service can be deployed in /deploy
.
From the gui directory:
- Install dependencies
npm install
. - Start the development server with
npm run start-prod
. This will not require any local server and will use the live scrimpton.com API.
If the local server is running you can use npm run start
to proxy the
API to the local running API.
From the server directory:
Prerequisites:
- docker.io, docker-compose (
apt install docker.io docker-compose
) - direnv (
apt install direnv
- remember to install shell hook e.g.direnv hook bash > ~/.bashrc
)
Setup:
- Install tools
make setup
- Build CLI with
make build
. - Create the DB and index with
make init.all
(only needs to be done once, or after the raw data is changed) - Start a local postgres instance
make dev.services.start
- Run local server with
make run
.
Note that invalid API keys will be used (see .envrc). These may cause some things not to work correctly.
More info: server README
- Edit proto file e.g.
proto/search.proto
. - Run
make generate
. - Update code to reflect changes in proto file e.g.
pkg/service/grpc/search.go
. - In
gui
directory runnpm run generate-api-client
to sync the GUI client with the latest API definitions.
More info: GUI README
(requires access to warmans
docker hub account)
- Create a new git tag
git tag x.x.x
. cd gui && npm run release
.cd server && make release
.- Re-up docker compose file on server.
(this is done using github actions)
- Build and push docker images with your own namespace.
- Update
./deploy/docker-compose.yaml
with correct image names/versions and credentials. - Copy docker-compose file to your server.
- Run
docker-compose up -d