diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cd8a1fc --- /dev/null +++ b/Makefile @@ -0,0 +1,170 @@ +.DEFAULT_GOAL := help + +COMPOSE ?= docker compose +COMPOSE_DIR := infrastructure/dev +COMPOSE_FILE := $(COMPOSE_DIR)/docker-compose.yml +ENV_FILE := $(COMPOSE_DIR)/.env +COMPOSE_CMD := $(COMPOSE) -f $(COMPOSE_FILE) --env-file $(ENV_FILE) --project-directory $(COMPOSE_DIR) + +ifneq ("$(wildcard $(ENV_FILE))","") + include $(ENV_FILE) +endif + +POSTGRES_USER ?= knowfoolery +POSTGRES_PASSWORD ?= knowfoolery +POSTGRES_PORT ?= 5432 +POSTGRES_DB ?= knowfoolery +REDIS_PORT ?= 6379 +ZITADEL_PORT ?= 8080 +PROMETHEUS_PORT ?= 9091 +GRAFANA_PORT ?= 3001 +JAEGER_UI_PORT ?= 16686 +ZITADEL_ADMIN_USERNAME ?= admin +ZITADEL_ADMIN_PASSWORD ?= AdminPassword123! +GRAFANA_ADMIN_USER ?= admin + +.PHONY: help dev dev-full dev-auth stop clean \ + backend-lint backend-test backend-build \ + frontend-dev frontend-lint frontend-test frontend-build \ + db-up db-down db-logs db-shell redis-shell \ + lint test build + +# Default target +help: + @echo "KnowFoolery Development Commands" + @echo "" + @echo "Development Environment:" + @echo " make dev - Start core infrastructure (PostgreSQL, Redis)" + @echo " make dev-full - Start core infrastructure + observability" + @echo " make dev-auth - Start core infrastructure + Zitadel auth" + @echo " make stop - Stop all containers" + @echo " make clean - Stop containers and remove volumes" + @echo "" + @echo "Backend:" + @echo " make backend-lint - Run Go linters" + @echo " make backend-test - Run Go tests" + @echo " make backend-build - Build all services" + @echo "" + @echo "Frontend:" + @echo " make frontend-dev - Start frontend dev server" + @echo " make frontend-lint - Run ESLint and Prettier" + @echo " make frontend-test - Run frontend tests" + @echo " make frontend-build - Build frontend for production" + @echo "" + @echo "Database:" + @echo " make db-up - Start PostgreSQL and Redis" + @echo " make db-down - Stop PostgreSQL and Redis" + @echo " make db-logs - Show PostgreSQL logs" + @echo " make db-shell - Open PostgreSQL shell" + @echo " make redis-shell - Open Redis CLI" + @echo "" + @echo "All:" + @echo " make lint - Run all linters" + @echo " make test - Run all tests" + @echo " make build - Build everything" + +# ============================================================================= +# Development Environment +# ============================================================================= + +dev: + @echo "Starting core infrastructure..." + @$(COMPOSE_CMD) up -d postgres redis + @echo "Waiting for services to be healthy..." + @sleep 5 + @echo "" + @echo "Infrastructure ready:" + @echo " PostgreSQL: localhost:$(POSTGRES_PORT) (user: $(POSTGRES_USER), password: $(POSTGRES_PASSWORD))" + @echo " Redis: localhost:$(REDIS_PORT)" + +dev-full: dev + @echo "Starting observability stack..." + @$(COMPOSE_CMD) --profile observability up -d + @echo "" + @echo "Observability ready:" + @echo " Prometheus: http://localhost:$(PROMETHEUS_PORT)" + @echo " Grafana: http://localhost:$(GRAFANA_PORT) (admin: $(GRAFANA_ADMIN_USER))" + @echo " Jaeger: http://localhost:$(JAEGER_UI_PORT)" + +dev-auth: dev + @echo "Starting authentication stack..." + @$(COMPOSE_CMD) --profile auth up -d + @echo "" + @echo "Zitadel ready at http://localhost:$(ZITADEL_PORT)" + @echo "Admin credentials: $(ZITADEL_ADMIN_USERNAME) / $(ZITADEL_ADMIN_PASSWORD)" + +stop: + @echo "Stopping all containers..." + @$(COMPOSE_CMD) down + +clean: + @echo "Stopping containers and removing volumes..." + @$(COMPOSE_CMD) down -v + +# ============================================================================= +# Backend +# ============================================================================= + +backend-lint: + @echo "Running Go linters..." + @cd backend && golangci-lint run ./... + +backend-test: + @echo "Running Go tests..." + @cd backend && go test -v -race -cover ./... + +backend-build: + @echo "Building all services..." + @cd backend && go build ./... + +# ============================================================================= +# Frontend +# ============================================================================= + +frontend-dev: + @echo "Starting frontend development server..." + @cd frontend && yarn dev + +frontend-lint: + @echo "Running frontend linters..." + @cd frontend && yarn lint && yarn format:check + +frontend-test: + @echo "Running frontend tests..." + @cd frontend && yarn test + +frontend-build: + @echo "Building frontend..." + @cd frontend && yarn build + +# ============================================================================= +# Database Utilities +# ============================================================================= + +db-up: + @$(COMPOSE_CMD) up -d postgres redis + +db-down: + @$(COMPOSE_CMD) stop postgres redis + +db-logs: + @$(COMPOSE_CMD) logs -f postgres + +db-shell: + @docker exec -it knowfoolery-postgres psql -U $(POSTGRES_USER) -d $(POSTGRES_DB) + +redis-shell: + @docker exec -it knowfoolery-redis redis-cli + +# ============================================================================= +# Combined Commands +# ============================================================================= + +lint: backend-lint frontend-lint + @echo "All linters passed!" + +test: backend-test frontend-test + @echo "All tests passed!" + +build: backend-build frontend-build + @echo "Build complete!" diff --git a/frontend/apps/web/node_modules/.vite/deps/_metadata.json b/frontend/apps/web/node_modules/.vite/deps/_metadata.json index cff7861..806e113 100644 --- a/frontend/apps/web/node_modules/.vite/deps/_metadata.json +++ b/frontend/apps/web/node_modules/.vite/deps/_metadata.json @@ -1,37 +1,37 @@ { - "hash": "c1a760b1", - "configHash": "c32c999b", + "hash": "eb29784f", + "configHash": "4a803860", "lockfileHash": "1449db2c", - "browserHash": "b74a13f8", + "browserHash": "ec38f4bb", "optimized": { "solid-js": { "src": "../../../../../node_modules/solid-js/dist/dev.js", "file": "solid-js.js", - "fileHash": "d4a73aa4", + "fileHash": "87122d52", "needsInterop": false }, "solid-js/web": { "src": "../../../../../node_modules/solid-js/web/dist/dev.js", "file": "solid-js_web.js", - "fileHash": "8373ac01", + "fileHash": "5c3a8ac6", "needsInterop": false }, "solid-js/store": { "src": "../../../../../node_modules/solid-js/store/dist/dev.js", "file": "solid-js_store.js", - "fileHash": "2fe5f5f7", + "fileHash": "24bb9baa", "needsInterop": false }, "solid-js/html": { "src": "../../../../../node_modules/solid-js/html/dist/html.js", "file": "solid-js_html.js", - "fileHash": "80572026", + "fileHash": "f875e3d8", "needsInterop": false }, "solid-js/h": { "src": "../../../../../node_modules/solid-js/h/dist/h.js", "file": "solid-js_h.js", - "fileHash": "054f03cf", + "fileHash": "dbb41dfd", "needsInterop": false } },