From 57d23c62e95a1627636143bd5cc79a0d89d24697 Mon Sep 17 00:00:00 2001 From: Hugh Kaznowski Date: Sat, 5 Sep 2026 13:15:39 +0100 Subject: [PATCH] Add convenience Makefile for building frontend and backend Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o --- Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ca17898 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +.PHONY: all build build-fe build-be test test-fe test-be lint lint-fe lint-be run dev clean + +all: build + +# Build the webapp first so `webapp/dist` exists for the backend to serve, +# then build the Rust binary. +build: build-fe build-be + +build-fe: + cd webapp && npm install && npm run build + +build-be: + cargo build --release + +test: test-be test-fe + +test-be: + cargo test + +test-fe: + cd webapp && npm run build + +lint: lint-be lint-fe + +lint-be: + cargo clippy --all-targets + +lint-fe: + cd webapp && npm run lint + +# Run the built binary, serving the webapp from webapp/dist. +run: build + ./target/release/ottyl + +# Frontend dev server with hot reload (proxy API calls to a separately +# running `cargo run` backend — see webapp/vite.config for the proxy setup). +dev: + cd webapp && npm run dev + +clean: + cargo clean + rm -rf webapp/dist webapp/node_modules