Makefile
1GRAPHHOPPER := $(shell command -v graphhopper)
2
3build: pages/static/css/style.css
4 @mkdir -p result/bin
5 go tool templ generate
6 go build -o result/bin/server ./cmd/server/*.go
7
8test:
9 go test ./...
10
11lint:
12 golangci-lint run ./...
13.PHONY: lint
14
15dev:
16 @concurrently --color 6 "server" "find . -name '*.go' -o -name '*.templ' | entr -r sh -c 'go tool templ generate && go run cmd/rtw/server.go cmd/rtw/config.go -c config.toml'" \
17 "ysweet" "../result/bin/y-sweet serve --port 9000 --checkpoint-freq-seconds 90" \
18 "router" "java -Xmx6g -jar $(shell dirname $(GRAPHHOPPER))/graphhopper-web-*.jar server ../osm-data/nepal-india.yml" \
19 "geocoder" "~/projects/waldo/bin/waldo data/world.parquet" \
20 "tailwind" "find pages/ -name '*.templ' | entr tailwindcss -m --cwd pages/ -i index.css -o static/css/style.css" \
21 "pmtiles" "pmtiles serve --port 9090 --cors=http://localhost:5173,* data/"
22.PHONY: dev
23
24preview:
25 @concurrently --color 6 "server" "result/bin/server -c config.toml" \
26 "ysweet" "../result/bin/y-sweet serve --port 9000 --checkpoint-freq-seconds 90" \
27 "router" "java -Xmx6g -jar $(shell dirname $(GRAPHHOPPER))/graphhopper-web-*.jar server ../osm-data/nepal-india.yml" \
28 "geocoder" "~/projects/waldo/bin/waldo data/world.parquet" \
29 "tailwind" "find pages/ -name '*.templ' | entr tailwindcss -m --cwd pages/ -i index.css -o static/css/style.css" \
30 "pmtiles" "pmtiles serve --port 9090 --cors=http://localhost:5173,* data/"
31.PHONY: preview
32
33vibe:
34 vibe --allow ~/projects/ygo --allow ~/projects/waldo
35.PHONY: vibe
36
37clean:
38 rm -rf data/route/
39 rm -f data/users.db*
40 rm -f data/documents.db*
41.PHONY: clean
42
43pages/static/css/style.css: pages/index.css $(wildcard pages/*.templ)
44 tailwindcss -m --cwd pages/ -i index.css -o static/css/style.css