Makefile Documentation¶
This document describes all available Make targets for the Team Health Check project. The Makefile orchestrates both the frontend (Next.js/TypeScript) and backend (Go/Gin) services.
Quick Reference¶
| Command | Description |
|---|---|
make run |
Start the full application (recommended) |
make dev |
Start with hot reload for development |
make test |
Run frontend, backend, and E2E tests |
make test-e2e |
Run E2E acceptance tests |
make build |
Build for production |
make help |
Show all available commands |
Getting Started¶
First Time Setup¶
# Clone and run - that's it!
git clone https://github.com/guidewire-oss/teams360.git
cd teams360
make run
The make run command automatically:
1. Installs frontend npm dependencies (if missing)
2. Installs backend Go dependencies (if missing)
3. Starts PostgreSQL via Docker (if available and not running)
4. Kills any existing servers on ports 3000/8080
5. Builds the documentation site when MkDocs or Docker is available
6. Starts both frontend and backend servers concurrently
7. Displays demo credentials for login
Environment Variables¶
The Makefile uses these environment variables (with defaults):
| Variable | Default | Description |
|---|---|---|
DATABASE_URL |
postgres://postgres:postgres@localhost:5432/teams360?sslmode=disable |
Production database URL |
TEST_DATABASE_URL |
postgres://postgres:postgres@localhost:5432/teams360_test?sslmode=disable |
Test database URL |
Override them as needed:
Target Categories¶
Installation¶
make install¶
Install all dependencies for both frontend and backend.
What it does:
- Runs npm install in the frontend directory
- Runs go mod download in the backend directory
make install-frontend¶
Install only frontend npm dependencies.
make install-backend¶
Install only backend Go dependencies.
Running the Application¶
make run ⭐ (Recommended)¶
Start the full application locally with automatic setup.
Features: - Auto-installs dependencies if missing - Auto-starts PostgreSQL via Docker if available - Kills any existing servers on ports 3000/8080 - Starts frontend (port 3000) and backend (port 8080) concurrently - Displays demo credentials
Output:
Starting Team Health Check...
Frontend: http://localhost:3000
Backend: http://localhost:8080
Demo Credentials:
demo/demo - Team Member
teamlead1/demo - Team Lead
manager1/demo - Manager
admin/admin - Administrator
Press Ctrl+C to stop
make dev¶
Start with hot reload for active development.
Differences from make run:
- Uses air for backend hot reload (if installed)
- Automatically recompiles Go code on file changes
- Ideal for rapid iteration
Install air:
make run-frontend¶
Start only the frontend server.
make run-backend¶
Start only the backend server.
Database Management¶
make db-start¶
Start the PostgreSQL Docker container.
Behavior:
- If container exists and running: no-op
- If container exists but stopped: starts it
- If no container: creates new one with postgres:16-alpine
make db-stop¶
Stop the PostgreSQL Docker container.
make db-setup¶
Initialize the database with migrations and seed data.
What it does: 1. Ensures PostgreSQL is running 2. Starts the backend briefly to run migrations 3. Seed data (demo users, teams, dimensions) is created automatically
make db-reset¶
Reset the database (WARNING: deletes all data).
Prompts for confirmation before proceeding.
make db-test-setup¶
Setup the test database (teams360_test).
Building¶
make build¶
Build both frontend and backend for production.
Outputs:
- Frontend: .next/ directory (Next.js production build)
- Backend: backend/bin/team360-api binary
make build-frontend¶
Build only the frontend (Next.js production build).
make build-backend¶
Build only the backend Go binary.
Testing¶
make test¶
Run frontend, backend, and E2E tests.
Use make test-unit to run frontend and backend tests without E2E.
make test-backend¶
Run backend unit and integration tests.
make test-backend-verbose¶
Run backend tests with verbose output and race detection.
make test-backend-coverage¶
Run backend tests and generate HTML coverage report.
Output: backend/coverage.html
make test-backend-watch¶
Run tests in watch mode - automatically re-runs on file changes.
Ideal for TDD workflow.
make test-e2e ⭐¶
Run full E2E acceptance tests with Playwright.
What it does: 1. Ensures test database is ready 2. Kills any existing servers 3. Starts backend with test database 4. Starts frontend 5. Waits for both servers to be healthy 6. Runs Ginkgo E2E tests with Playwright 7. Cleans up servers after completion
Duration: ~2-5 minutes (includes server startup)
Logs: Available at /tmp/team360/backend.log and /tmp/team360/frontend.log
make test-frontend¶
Run frontend unit tests with Vitest.
Linting & Formatting¶
make lint¶
Run all linters (backend + frontend).
make lint-backend¶
Run Go linters (go fmt check + go vet).
make lint-frontend¶
Run ESLint on frontend code.
make fmt-backend¶
Format Go code using go fmt.
Cleanup¶
make clean¶
Clean build artifacts (keeps dependencies).
Removes:
- Frontend: .next/, out/, node_modules/.cache
- Backend: bin/, coverage files
make clean-frontend¶
Clean only frontend build artifacts.
make clean-backend¶
Clean only backend build artifacts.
make clean-all¶
Deep clean including dependencies and caches.
Removes:
- Everything from make clean
- frontend/node_modules/
- Go module cache
- Test cache
Use when: Troubleshooting dependency issues or freeing disk space.
Docker¶
make docker-build¶
Build Docker images for the backend.
make docker-run¶
Build and run the backend in a Docker container.
Status & Information¶
make status / make info¶
Show project status including dependency installation state and database status.
Output example:
Team Health Check Project Status
Frontend (Next.js 15 + TypeScript):
Location: ./frontend
Dependencies: Installed
Backend (Go 1.25 + Gin + DDD):
Location: ./backend
Dependencies: Installed
Database:
PostgreSQL: Running (Docker)
make help¶
Display all available commands with descriptions.
CI Pipeline¶
make ci / make all¶
Run full CI pipeline: clean → install → lint → test → build.
Use for: Pre-commit verification, CI/CD pipelines.
Architecture Notes¶
Monorepo Structure¶
teams360/
├── Makefile # Root orchestration (this file)
├── frontend/ # Next.js application
│ └── package.json # npm commands
├── backend/ # Go API server
│ ├── Makefile # Backend-specific targets
│ └── go.mod # Go dependencies
└── tests/ # E2E acceptance tests
└── acceptance/ # Playwright + Ginkgo tests
Internal Targets¶
Targets prefixed with _ are internal and not shown in make help:
| Target | Purpose |
|---|---|
_ensure-deps |
Install deps if missing |
_ensure-db |
Start database if needed |
_kill-servers |
Kill existing processes on 3000/8080 |
_print-banner |
Display startup info |
_start-frontend |
Start frontend server |
_start-backend |
Start backend server |
_ensure-pid-dir |
Create PID file directory |
PID Management¶
For E2E tests, process IDs are stored in /tmp/team360/:
- backend.pid - Backend server PID
- frontend.pid - Frontend server PID
- backend.log - Backend server logs
- frontend.log - Frontend server logs
Troubleshooting¶
Port Already in Use¶
# Kill processes manually
lsof -ti:3000 | xargs kill -9 # Frontend port
lsof -ti:8080 | xargs kill -9 # Backend port
# Or let make handle it
make run # Automatically kills existing servers
Docker Not Available¶
If Docker isn't installed or running:
# Install PostgreSQL manually and ensure it's running on port 5432
# Then run without Docker:
make run
The Makefile will detect if port 5432 is in use and skip Docker setup.
Dependency Issues¶
E2E Tests Failing¶
-
Check server logs:
-
Ensure test database exists:
-
Run with verbose output:
Best Practices¶
For Development¶
# Daily workflow
make run # Start the app
# Make changes...
# Ctrl+C to stop
make test # Run tests before committing