Koito/Makefile
Gabe Farrell d4ac96f780
feat: Rewind (#116)
* wip

* chore: update counts to allow unix timeframe

* feat: add db functions for counting new items

* wip: endpoint working

* wip

* wip: initial ui done

* add header, adjust ui

* add time listened toggle

* fix layout, year param

* param fixes
2025-12-31 18:44:55 -05:00

56 lines
1.4 KiB
Makefile

.PHONY: all test clean client
postgres.schemadump:
docker run --rm --network=host --env PGPASSWORD=secret -v "./db:/tmp/dump" \
postgres pg_dump \
--schema-only \
--host=localhost \
--port=5432 \
--username=postgres \
-v --dbname="koitodb" -f "/tmp/dump/schema.sql"
postgres.run:
docker run --name koito-db -p 5432:5432 -e POSTGRES_PASSWORD=secret -d postgres
postgres.run-scratch:
docker run --name koito-scratch -p 5433:5432 -e POSTGRES_PASSWORD=secret -d postgres
postgres.start:
docker start koito-db
postgres.stop:
docker stop koito-db
postgres.remove:
docker stop koito-db && docker rm koito-db
postgres.remove-scratch:
docker stop koito-scratch && docker rm koito-scratch
api.debug: postgres.start
KOITO_ALLOWED_HOSTS=* KOITO_LOG_LEVEL=debug KOITO_CONFIG_DIR=test_config_dir KOITO_DATABASE_URL=postgres://postgres:secret@localhost:5432?sslmode=disable go run cmd/api/main.go
api.scratch: postgres.run-scratch
KOITO_ALLOWED_HOSTS=* KOITO_LOG_LEVEL=debug KOITO_CONFIG_DIR=test_config_dir/scratch KOITO_DATABASE_URL=postgres://postgres:secret@localhost:5433?sslmode=disable go run cmd/api/main.go
api.test:
go test ./... -timeout 60s
api.build:
CGO_ENABLED=1 go build -ldflags='-s -w' -o koito ./cmd/api/main.go
client.dev:
cd client && yarn run dev
docs.dev:
cd docs && yarn dev
client.deps:
cd client && yarn install
client.build: client.deps
cd client && yarn run build
test: api.test
build: api.build client.build