This repository was archived by the owner on Feb 1, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathMakefile
More file actions
143 lines (126 loc) · 4.72 KB
/
Makefile
File metadata and controls
143 lines (126 loc) · 4.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
.PHONY: help setup dev test test-coverage test-fast test-watch lint format clean build docs
help:
@echo "Emergent Learning Framework - Development Commands"
@echo ""
@echo "Setup:"
@echo " make setup Install all dependencies (first-time setup)"
@echo ""
@echo "Development:"
@echo " make dev Start all development servers (backend + frontend + dashboard)"
@echo " make dev-backend Start just the backend API"
@echo " make dev-frontend Start just the frontend dev server"
@echo ""
@echo "Testing:"
@echo " make test Run all tests"
@echo " make test-coverage Run tests with coverage report"
@echo " make test-fast Run fast tests (skip slow ones)"
@echo " make test-watch Run tests in watch mode (re-run on file changes)"
@echo " make test-backend Run backend tests only"
@echo " make test-frontend Run frontend tests only"
@echo ""
@echo "Code Quality:"
@echo " make lint Check code style and types"
@echo " make format Auto-format code (Black + Prettier)"
@echo " make type-check Run strict type checking"
@echo ""
@echo "Build & Docs:"
@echo " make build Build frontend for production"
@echo " make docs Generate documentation"
@echo ""
@echo "Cleanup:"
@echo " make clean Remove build artifacts and cache"
@echo ""
# Setup and installation
setup:
@echo "Setting up Emergent Learning Framework..."
@echo ""
@echo "Step 1: Checking prerequisites..."
@python -c "import sys; print(f'Python {sys.version}')"
@command -v node >/dev/null 2>&1 && echo "Node.js found" || echo "Warning: Node.js not found"
@echo ""
@echo "Step 2: Installing Python dependencies..."
@python -m pip install --upgrade pip setuptools
@pip install -r requirements.txt
@echo ""
@echo "Step 3: Installing backend dependencies..."
@cd apps/dashboard/backend && pip install -r requirements.txt
@echo ""
@echo "Step 4: Installing frontend dependencies..."
@cd apps/dashboard/frontend && npm ci
@echo ""
@echo "Step 5: Verifying setup..."
@python -m pytest tests/ --collect-only -q
@echo ""
@echo "✅ Setup complete! Run 'make dev' to start developing."
# Development servers
dev: dev-backend dev-frontend
@echo "✅ All development servers running"
@echo " Backend: http://localhost:8888"
@echo " Frontend: http://localhost:5173"
@echo " Dashboard: http://localhost:3001"
dev-backend:
@echo "Starting backend API server..."
@cd apps/dashboard/backend && python -m uvicorn main:app --reload --host 0.0.0.0 --port 8888
dev-frontend:
@echo "Starting frontend dev server..."
@cd apps/dashboard/frontend && npm run dev
# Testing
test:
@pytest tests/ -v
test-coverage:
@pytest tests/ -v --cov=src --cov-report=html --cov-report=term-missing
@echo ""
@echo "Coverage report generated: htmlcov/index.html"
test-fast:
@pytest tests/ -v -m "not slow"
test-watch:
@pytest-watch tests/ -- -v
test-backend:
@cd apps/dashboard/backend && pytest tests/ -v
test-frontend:
@cd apps/dashboard/frontend && npm run test
# Code quality
lint:
@echo "Running linters..."
@echo " Python type checking (mypy)..."
@mypy src/ --strict --no-implicit-reexport 2>/dev/null || echo " (Fix type hints with errors above)"
@echo " Python linting (pylint)..."
@pylint src/ --exit-zero 2>/dev/null || true
@echo " Shell script checking (shellcheck)..."
@shellcheck scripts/*.sh 2>/dev/null || echo " (Install shellcheck: brew install shellcheck)"
@echo ""
@echo "Tip: Fix issues with 'make format'"
format:
@echo "Auto-formatting code..."
@echo " Black (Python)..."
@black src/ tests/ scripts/ --quiet 2>/dev/null || echo " (Install black: pip install black)"
@echo " Prettier (JavaScript/YAML)..."
@cd apps/dashboard/frontend && npx prettier --write . 2>/dev/null || true
@echo "✅ Formatting complete"
type-check:
@echo "Strict type checking..."
@mypy src/ tests/ scripts/ --strict --pretty --show-error-codes
# Building
build:
@echo "Building frontend for production..."
@cd apps/dashboard/frontend && npm run build
@echo "✅ Build complete: apps/dashboard/frontend/dist/"
# Documentation
docs:
@echo "Documentation files are in docs/ directory"
@echo ""
@echo "Key files:"
@ls -lh docs/*.md | awk '{print " " $$9 " (" $$5 ")"}'
@echo ""
@echo "To view:"
@echo " - ARCHITECTURE.md - System overview"
@echo " - TESTING.md - Testing guide"
@echo " - TROUBLESHOOTING.md - Common issues"
# Cleanup
clean:
@echo "Cleaning up build artifacts and cache..."
@find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
@rm -rf htmlcov/ .coverage
@cd apps/dashboard/frontend && rm -rf dist/ node_modules/.vite 2>/dev/null || true
@echo "✅ Cleanup complete"