-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
159 lines (134 loc) Β· 4.71 KB
/
Makefile
File metadata and controls
159 lines (134 loc) Β· 4.71 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
# Echo Mind Backend Makefile
# Phase 1.1: Backend Architecture Setup
.PHONY: help build dev prod test clean logs shell health stop restart
# Default target
help:
@echo "Echo Mind Backend - Available Commands:"
@echo ""
@echo "Development:"
@echo " make dev - Start development environment with auto-reload"
@echo " make dev-build - Build and start development environment"
@echo " make logs - View development logs"
@echo " make shell - Shell into development container"
@echo ""
@echo "Production:"
@echo " make prod - Start production environment"
@echo " make prod-build - Build and start production environment"
@echo " make prod-logs - View production logs"
@echo ""
@echo "Testing:"
@echo " make test - Run tests"
@echo " make health - Check service health"
@echo " make test-ws - Test WebSocket connection"
@echo ""
@echo "Monitoring:"
@echo " make monitoring - Start with monitoring stack"
@echo " make grafana - Open Grafana dashboard"
@echo " make prometheus - Open Prometheus dashboard"
@echo ""
@echo "Utilities:"
@echo " make clean - Clean up containers and volumes"
@echo " make stop - Stop all services"
@echo " make restart - Restart services"
@echo " make build - Build Docker images"
@echo ""
# Development commands
dev:
@echo "π Starting Echo Mind Backend in development mode..."
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
dev-build:
@echo "π¨ Building and starting development environment..."
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build
dev-daemon:
@echo "π Starting Echo Mind Backend in development mode (daemon)..."
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
# Production commands
prod:
@echo "π Starting Echo Mind Backend in production mode..."
docker-compose up -d
prod-build:
@echo "π¨ Building and starting production environment..."
docker-compose up --build -d
prod-logs:
@echo "π Viewing production logs..."
docker-compose logs -f echo-mind-backend
# Testing commands
test:
@echo "π§ͺ Running tests..."
docker-compose exec echo-mind-backend python -m pytest
health:
@echo "π₯ Checking service health..."
@curl -f http://localhost:8000/api/v1/health || echo "β Service is not healthy"
@echo "β
Health check completed"
test-ws:
@echo "π Testing WebSocket connection..."
@echo "Use a WebSocket client to connect to: ws://localhost:8000/api/v1/audio-stream"
test-config:
@echo "βοΈ Testing configuration endpoint..."
@curl -s http://localhost:8000/api/v1/config | python -m json.tool || echo "β Config endpoint failed"
# Monitoring commands
monitoring:
@echo "π Starting with monitoring stack..."
docker-compose --profile monitoring up -d
grafana:
@echo "π Opening Grafana dashboard..."
@open http://localhost:3000 || echo "Open http://localhost:3000 in your browser"
prometheus:
@echo "π Opening Prometheus dashboard..."
@open http://localhost:9090 || echo "Open http://localhost:9090 in your browser"
# Utility commands
build:
@echo "π¨ Building Docker images..."
docker-compose build
logs:
@echo "π Viewing logs..."
docker-compose logs -f echo-mind-backend
shell:
@echo "π Opening shell in container..."
docker-compose exec echo-mind-backend bash
stop:
@echo "π Stopping all services..."
docker-compose down
restart:
@echo "π Restarting services..."
docker-compose restart
clean:
@echo "π§Ή Cleaning up containers and volumes..."
docker-compose down -v --remove-orphans
docker system prune -f
# Environment setup
setup:
@echo "βοΈ Setting up environment..."
@if [ ! -f .env ]; then \
echo "π Copying .env.example to .env..."; \
cp .env.example .env; \
echo "β
Please edit .env with your API keys"; \
else \
echo "β
.env file already exists"; \
fi
# Documentation
docs:
@echo "π Opening API documentation..."
@open http://localhost:8000/docs || echo "Open http://localhost:8000/docs in your browser"
# Quick start for new developers
quickstart: setup
@echo "π Echo Mind Backend Quick Start"
@echo ""
@echo "1. β
Environment file created (.env)"
@echo "2. π Edit .env with your API keys:"
@echo " - DEEPGRAM_API_KEY"
@echo " - OPENAI_API_KEY"
@echo " - ELEVENLABS_API_KEY"
@echo " - HEYGEN_API_KEY"
@echo ""
@echo "3. π Run 'make dev' to start development server"
@echo "4. π Open http://localhost:8000/docs for API documentation"
@echo ""
# Status check
status:
@echo "π Echo Mind Backend Status:"
@echo ""
@docker-compose ps
@echo ""
@echo "π₯ Health Check:"
@curl -s http://localhost:8000/api/v1/health 2>/dev/null | python -m json.tool 2>/dev/null || echo "β Service not responding"