File size: 5,359 Bytes
61d29fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
.PHONY: help install install-frontend install-docs build-frontend build-docs clean test run dev dev-frontend dev-docs start-all stop-all dev-full docker-up docker-down deploy-databricks

help:
	@echo "🦷 Open Navigator - Makefile Commands"
	@echo "===================================================="
	@echo ""
	@echo "πŸš€ Quick Start:"
	@echo "  make start-all         - Start ALL services (API + Dashboard + Docs) with tmux"
	@echo "  make stop-all          - Stop all running services"
	@echo ""
	@echo "🐍 Python Backend:"
	@echo "  make install           - Install Python dependencies in venv"
	@echo "  make dev               - Start backend with auto-reload"
	@echo "  make run               - Start backend (production)"
	@echo ""
	@echo "βš›οΈ  React Dashboard:"
	@echo "  make install-frontend  - Install dashboard npm dependencies"
	@echo "  make build-frontend    - Build React dashboard for production"
	@echo "  make dev-frontend      - Start dashboard dev server"
	@echo ""
	@echo "πŸ“š Documentation Site:"
	@echo "  make install-docs      - Install Docusaurus dependencies"
	@echo "  make build-docs        - Build documentation for production"
	@echo "  make dev-docs          - Start documentation dev server"
	@echo ""
	@echo "☁️  Deployment:"
	@echo "  make deploy-databricks - Deploy to Databricks Apps"
	@echo ""
	@echo "🐳 Docker:"
	@echo "  make docker-up         - Start Docker containers"
	@echo "  make docker-down       - Stop Docker containers"
	@echo ""
	@echo "πŸ§ͺ Testing:"
	@echo "  make test              - Run test suite"
	@echo "  make clean             - Remove build artifacts"
	@echo ""

install:
	@echo "πŸ“¦ Creating virtual environment and installing dependencies..."
	@chmod +x install.sh
	@./install.sh

install-frontend:
	@echo "πŸ“¦ Installing dashboard dependencies..."
	@cd frontend && npm install
	@echo "βœ… Dashboard dependencies installed!"

install-docs:
	@echo "πŸ“¦ Installing documentation dependencies..."
	@cd website && npm install
	@echo "βœ… Documentation dependencies installed!"

build-frontend:
	@echo "πŸ”¨ Building React dashboard..."
	@cd frontend && npm run build
	@echo "βœ… Dashboard built to api/static/"

build-docs:
	@echo "πŸ”¨ Building documentation site..."
	@cd website && npm run build
	@echo "βœ… Documentation built to website/build/"

clean:
	@echo "🧹 Cleaning up..."
	@rm -rf .venv venv
	@rm -rf frontend/node_modules frontend/dist
	@rm -rf website/node_modules website/build website/.docusaurus
	@rm -rf api/static
	@rm -rf __pycache__
	@find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
	@find . -type f -name "*.pyc" -delete
	@find . -type f -name "*.pyo" -delete
	@rm -rf .pytest_cache
	@rm -rf .coverage
	@rm -rf htmlcov
	@rm -rf dist
	@rm -rf build
	@rm -rf *.egg-info
	@rm -rf logs/*.pid logs/*.log
	@echo "βœ… Cleanup complete"

test:
	@echo "πŸ§ͺ Running tests..."
	@. venv/bin/activate && pytest tests/ -v

run: build-frontend
	@echo "πŸš€ Starting application (production mode)..."
	@. venv/bin/activate && uvicorn api.app:app --host 0.0.0.0 --port 8000

dev:
	@echo "πŸ”§ Starting backend with auto-reload..."
	@echo "πŸ“‘ Backend running at http://localhost:8000"
	@. venv/bin/activate && uvicorn api.app:app --reload

dev-frontend:
	@echo "βš›οΈ  Starting dashboard dev server..."
	@echo "πŸ“‘ Dashboard running at http://localhost:5173"
	@cd frontend && npm run dev

dev-docs:
	@echo "πŸ“š Starting documentation dev server..."
	@echo "πŸ“‘ Documentation running at http://localhost:3000"
	@cd website && npm start

start-all:
	@echo "πŸš€ Starting all services with tmux..."
	@chmod +x start-all.sh
	@./start-all.sh

stop-all:
	@echo "πŸ›‘ Stopping all services..."
	@chmod +x stop-all.sh
	@./stop-all.sh

dev-full:
	@echo "πŸš€ Use 'make start-all' for better experience with tmux!"
	@echo ""
	@echo "Starting backend and frontend (manual)..."
	@echo "πŸ“‘ Backend:   http://localhost:8000"
	@echo "πŸ“‘ Dashboard: http://localhost:5173"
	@echo "πŸ“‘ Docs:      http://localhost:3000 (run 'make dev-docs' in another terminal)"
	@echo ""
	@. venv/bin/activate && uvicorn api.app:app --reload & \
	cd frontend && npm run dev

deploy-databricks:
	@echo "☁️  Deploying to Databricks Apps..."
	@chmod +x scripts/deploy-databricks-app.sh
	@./scripts/deploy-databricks-app.sh

docker-up:
	@echo "Starting Docker containers..."
	@docker-compose up -d
	@echo "βœ“ Containers started"
	@echo "  API: http://localhost:8000"
	@echo "  Docs: http://localhost:8000/docs"

docker-down:
	@echo "Stopping Docker containers..."
	@docker-compose down
	@echo "βœ“ Containers stopped"

example:
	@echo "Running example workflow..."
	@. venv/bin/activate && python examples/example_workflow.py

heatmap:
	@echo "Generating example heatmap..."
	@. venv/bin/activate && python main.py generate-heatmap --output example_heatmap.html
	@echo "βœ“ Heatmap saved to example_heatmap.html"

init:
	@echo "Initializing system..."
	@. venv/bin/activate && python main.py init

status:
	@echo "Checking system status..."
	@. venv/bin/activate && python main.py status

format:
	@echo "Formatting code..."
	@. venv/bin/activate && black .
	@. venv/bin/activate && ruff check . --fix
	@echo "βœ“ Code formatted"

lint:
	@echo "Linting code..."
	@. venv/bin/activate && ruff check .
	@. venv/bin/activate && mypy agents/ pipeline/ visualization/ api/