Add auth, rest api, svelte frontend, build structure

This commit is contained in:
2025-06-02 08:44:10 +02:00
parent 97be451306
commit 17ab7c4929
222 changed files with 3057 additions and 136 deletions

View File

@@ -1,27 +1,17 @@
.PHONY: dev build
TARGET = ./tmp/server
FRONTEND = ./web/frontend
dev:
@if command -v $(HOME)/go/bin/air > /dev/null; then \
AIR_CMD="$(HOME)/go/bin/air"; \
elif command -v air > /dev/null; then \
AIR_CMD="air"; \
else \
read -p "air is not installed. Install it? [Y/n] " choice; \
if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
echo "Installing..."; \
go install github.com/air-verse/air@latest; \
AIR_CMD="$(HOME)/go/bin/air"; \
else \
echo "Exiting..."; \
exit 1; \
fi; \
fi; \
echo "Starting Air..."; \
$$AIR_CMD
SVELTE_COMPONENTS = status
build:
@echo "Generate Tailwind CSS..."
go generate
@echo "Building Go server..."
go build -o tmp/server main.go
@echo "Build complete."
SVELTE_TARGETS = $(addprefix $(FRONTEND)/public/build/,$(addsuffix .ts, $(SVELTE_COMPONENTS)))
.PHONY: $(TARGET)
.NOTPARALLEL:
$(TARGET): $(SVELTE_TARGETS)
$(info ===> BUILD Go server)
@go build -o $(TARGET) main.go
$(SVELTE_TARGETS): $(SVELTE_SRC)
$(info ===> BUILD frontend)
cd $(FRONTEND) && npm install && npm run build