Skip to content

Commit 6944735

Browse files
committed
change
1 parent b8e2a1f commit 6944735

85 files changed

Lines changed: 2554 additions & 63981 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ go.work
3232
*.o
3333
*.a
3434

35+
# Frontend build output
36+
web/static/
37+
web/ui/dist/
38+
web/ui/node_modules/
39+
3540
# Data directory (contains game data)
3641
data/
3742
!data/.gitkeep

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

Makefile

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help build run server cli clean test test-go test-react fmt vet deps install dev
1+
.PHONY: help build frontend-build run run-dev server cli clean test test-go test-react fmt vet deps install dev
22

33
# Variables
44
BINARY_NAME=shadowmaster-server
@@ -28,6 +28,11 @@ deps: ## Download and install dependencies
2828
@go mod tidy
2929
@echo "$(GREEN)✓ Dependencies installed$(NC)"
3030

31+
frontend-build: ## Build the frontend
32+
@echo "$(CYAN)Building frontend...$(NC)"
33+
@cd web/ui && npm run build
34+
@echo "$(GREEN)✓ Frontend built$(NC)"
35+
3136
build: frontend-build ## Build the server binary
3237
@echo "$(CYAN)Building server...$(NC)"
3338
@go build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o bin/$(BINARY_NAME) ./cmd/shadowmaster-server
@@ -41,16 +46,20 @@ build-cli: ## Build the CLI binary
4146
build-all: build build-cli ## Build both server and CLI binaries
4247
@echo "$(GREEN)✓ All binaries built$(NC)"
4348

44-
run: test server ## Alias for server target that also runs tests
45-
46-
server: frontend-build ## Run the server
49+
run: build ## Run the server in production mode (serves built static files)
4750
@echo "$(CYAN)Starting ShadowMaster server...$(NC)"
48-
@echo "$(YELLOW)Port: $(PORT)$(NC)"
49-
@echo "$(YELLOW)Data directory: $(DATA_DIR)$(NC)"
50-
@echo "$(YELLOW)Web directory: $(WEB_DIR)$(NC)"
51-
@echo ""
5251
@mkdir -p $(DATA_DIR)
53-
@go run ./cmd/shadowmaster-server -port $(PORT) -data $(DATA_DIR) -web $(WEB_DIR)
52+
@./bin/$(BINARY_NAME) -port $(PORT) -data $(DATA_DIR) -web $(WEB_DIR)
53+
54+
run-dev: ## Run both API server and frontend dev server
55+
@echo "$(CYAN)Starting ShadowMaster in development mode...$(NC)"
56+
@echo "$(YELLOW)API server will run on port $(PORT)$(NC)"
57+
@echo "$(YELLOW)Frontend dev server will run on port 5173$(NC)"
58+
@echo "$(YELLOW)Press Ctrl+C to stop both servers$(NC)"
59+
@mkdir -p $(DATA_DIR)
60+
@(trap 'kill 0' EXIT; \
61+
go run ./cmd/shadowmaster-server -port $(PORT) -data $(DATA_DIR) -web $(WEB_DIR) & \
62+
cd web/ui && npm run dev)
5463

5564
dev: ## Run the server in development mode (with auto-reload if available)
5665
@echo "$(CYAN)Starting ShadowMaster server in development mode...$(NC)"
@@ -79,10 +88,9 @@ test-go: ## Run Go tests
7988
@go test -v ./...
8089

8190
test-react: ## Run React tests
82-
@echo "$(CYAN)Running React smoke test...$(NC)"
83-
@cd web/app && npm test -- --watch=false
84-
@echo "$(CYAN)Running React unit tests...$(NC)"
85-
@cd web/app && npm run test:unit
91+
@echo "$(CYAN)Running React lint checks...$(NC)"
92+
@cd web/ui && npm install
93+
@cd web/ui && npm run lint
8694

8795
test-coverage: ## Run tests with coverage
8896
@echo "$(CYAN)Running tests with coverage...$(NC)"
@@ -141,10 +149,5 @@ watch: ## Watch for file changes and rebuild (requires fswatch or similar)
141149
echo "$(YELLOW)Please install fswatch or entr for file watching$(NC)"; \
142150
fi
143151

144-
frontend-build: ## Build the React frontend bundle
145-
@echo "$(CYAN)Building React frontend...$(NC)"
146-
@cd web/app && npm run build
147-
@echo "$(GREEN)✓ Frontend bundle built$(NC)"
148-
149152
.DEFAULT_GOAL := help
150153

web/app/.eslintrc.cjs

Lines changed: 0 additions & 23 deletions
This file was deleted.

web/app/.prettierrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

web/app/package.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

web/app/src/App.tsx

Lines changed: 0 additions & 67 deletions
This file was deleted.

web/app/src/__tests__/AttributesAllocation.test.tsx

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)