-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
170 lines (143 loc) Β· 5.02 KB
/
Makefile
File metadata and controls
170 lines (143 loc) Β· 5.02 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
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
# Omni Multi-Agent Development Makefile
.PHONY: help install start stop clean test lint format docker-build docker-up docker-down
# Default target
help:
@echo "π Omni Multi-Agent Development Commands"
@echo ""
@echo "Setup & Installation:"
@echo " install Install all dependencies (backend + frontend)"
@echo " install-backend Install backend dependencies"
@echo " install-frontend Install frontend dependencies"
@echo ""
@echo "Development:"
@echo " start Start both backend and frontend in development mode"
@echo " start-backend Start only the backend server"
@echo " start-frontend Start only the frontend development server"
@echo " stop Stop all running services"
@echo ""
@echo "Testing & Quality:"
@echo " test Run all tests"
@echo " test-backend Run backend tests"
@echo " test-frontend Run frontend tests"
@echo " lint Run linting on all code"
@echo " format Format all code"
@echo ""
@echo "Docker:"
@echo " docker-build Build all Docker images"
@echo " docker-up Start all services with Docker Compose"
@echo " docker-down Stop all Docker services"
@echo " docker-logs View Docker container logs"
@echo ""
@echo "Maintenance:"
@echo " clean Clean all build artifacts and caches"
@echo " reset Reset development environment (clean + install)"
# Installation targets
install: install-backend install-frontend
@echo "β
All dependencies installed successfully!"
install-backend:
@echo "π¦ Installing backend dependencies..."
cd backend && pip install -r requirements.txt
install-frontend:
@echo "π¦ Installing frontend dependencies..."
cd frontend && npm install
# Development targets
start:
@echo "π Starting development environment..."
@echo "Backend will be available at: http://localhost:8000"
@echo "Frontend will be available at: http://localhost:5173"
@echo "API Documentation: http://localhost:8000/docs"
@(cd backend && uvicorn main:app --reload --host 0.0.0.0 --port 8000) & \
(cd frontend && npm run dev)
start-backend:
@echo "π§ Starting backend server..."
cd backend && uvicorn main:app --reload --host 0.0.0.0 --port 8000
start-frontend:
@echo "β‘ Starting frontend development server..."
cd frontend && npm run dev
stop:
@echo "π Stopping all services..."
@pkill -f "uvicorn main:app" || true
@pkill -f "npm run dev" || true
# Testing targets
test: test-backend test-frontend
@echo "β
All tests completed!"
test-backend:
@echo "π§ͺ Running backend tests..."
cd backend && python -m pytest test_memory.py -v
test-frontend:
@echo "π§ͺ Running frontend tests..."
cd frontend && npm test
# Code quality targets
lint:
@echo "π Running linting..."
cd backend && python -m flake8 . --max-line-length=88 --extend-ignore=E203,W503
cd frontend && npm run lint
format:
@echo "β¨ Formatting code..."
cd backend && python -m black . --line-length=88
cd backend && python -m isort . --profile=black
cd frontend && npm run format
# Docker targets
docker-build:
@echo "π³ Building Docker images..."
docker-compose build
docker-up:
@echo "π³ Starting services with Docker Compose..."
docker-compose up -d
@echo "β
Services started!"
@echo "Frontend: http://localhost"
@echo "Backend: http://localhost:8000"
@echo "API Docs: http://localhost:8000/docs"
docker-down:
@echo "π³ Stopping Docker services..."
docker-compose down
docker-logs:
@echo "π Viewing Docker container logs..."
docker-compose logs -f
# Maintenance targets
clean:
@echo "π§Ή Cleaning build artifacts and caches..."
# Python
find . -type d -name "__pycache__" -delete
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} + || true
# Node.js
rm -rf frontend/node_modules/.cache || true
rm -rf frontend/dist || true
rm -rf frontend/build || true
# Docker
docker system prune -f || true
@echo "β
Cleanup completed!"
reset: clean install
@echo "π Development environment reset completed!"
# Database targets
init-db:
@echo "ποΈ Initializing database..."
cd backend && python init_db.py
reset-db:
@echo "ποΈ Resetting database..."
rm -f backend/database/app.db || true
cd backend && python init_db.py
# Health check
health:
@echo "π₯ Checking service health..."
@curl -f http://localhost:8000/health && echo "β
Backend is healthy!" || echo "β Backend is down!"
@curl -f http://localhost:5173 && echo "β
Frontend is healthy!" || echo "β Frontend is down!"
# Development utilities
logs:
@echo "π Following application logs..."
tail -f backend/*.log frontend/*.log || echo "No log files found"
shell-backend:
@echo "π Opening backend Python shell..."
cd backend && python -i -c "from main import app; print('Backend shell ready!')"
deps-update:
@echo "π¦ Updating dependencies..."
cd backend && pip-review --auto
cd frontend && npm update
# Git helpers
commit-check:
@echo "β
Running pre-commit checks..."
$(MAKE) lint
$(MAKE) test
@echo "β
All checks passed! Ready to commit."