forked from pingwu/maca
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
141 lines (125 loc) Β· 5.07 KB
/
Makefile
File metadata and controls
141 lines (125 loc) Β· 5.07 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
# Google OAuth Task Tracker - Development Commands
# Team collaboration with Google OAuth authentication and audit trails
.PHONY: help up down logs clean rebuild test health status services
# Default target
help:
@echo "ποΈ Google OAuth Task Tracker - Team Collaboration Platform"
@echo ""
@echo "π Available commands:"
@echo " make up - Start all services (frontend + api + crew)"
@echo " make down - Stop all services"
@echo " make logs - View logs from all services"
@echo " make status - Check service health status"
@echo " make check-oauth - Verify OAuth env configuration"
@echo " make services - List running services"
@echo " make rebuild - Rebuild and restart all services"
@echo " make clean - Clean up containers and images"
@echo " make test - Run tests across all services"
@echo ""
@echo "π§ Individual services:"
@echo " make crew - Start only crew-service"
@echo " make api - Start only api-service"
@echo " make frontend - Start only frontend"
@echo ""
@echo "π Monitoring:"
@echo " make health - Check all service health endpoints"
# Main development commands
up:
@echo "π Starting Task Tracker microservices..."
@if [ ! -f .env ]; then \
echo "β οΈ Creating .env from template..."; \
cp .env.example .env; \
echo "π Please edit .env with your configuration"; \
fi
docker compose up -d
@echo "β
All services started!"
@echo ""
@echo "π Access points:"
@echo " Frontend: http://localhost:3000"
@echo " API Gateway: http://localhost:8000"
@echo " API Docs: http://localhost:8000/docs"
@echo " Crew Service: http://localhost:8001"
@echo ""
@echo "π Next steps:"
@echo " 1. Configure Google OAuth (see README.md for setup)"
@echo " 2. Configure Google Sheets (see setup/google-sheets-setup-guide.md)"
@echo " 3. Verify OAuth config: make check-oauth"
@echo " 4. Test with: make status"
down:
@echo "π Stopping all services..."
docker compose down
@echo "β
All services stopped"
logs:
@echo "π Viewing logs from all services (Ctrl+C to exit)..."
docker compose logs -f
# Service health and status
status:
@echo "π Checking service health..."
@echo ""
@echo "π Service Status:"
@curl -s http://localhost:8001/health | jq '.' 2>/dev/null || echo "β Crew Service (8001) - Not responding"
@echo ""
@curl -s http://localhost:8000/health | jq '.' 2>/dev/null || echo "β API Service (8000) - Not responding"
@echo ""
@curl -s http://localhost:3000 >/dev/null 2>&1 && echo "β
Frontend (3000) - Running" || echo "β Frontend (3000) - Not responding"
health:
@echo "π₯ Health check endpoints:"
@echo ""
@echo "Crew Service Health:"
@curl -s http://localhost:8001/health || echo "Service not available"
@echo ""
@echo "API Gateway Health:"
@curl -s http://localhost:8000/health || echo "Service not available"
services:
@echo "π³ Docker services status:"
docker compose ps
# Verify OAuth configuration variables
check-oauth:
@echo "π Checking OAuth configuration..."
@echo "GOOGLE_CLIENT_ID: $${GOOGLE_CLIENT_ID:+set}${GOOGLE_CLIENT_ID:+' (redacted)'}"
@echo "GOOGLE_CLIENT_SECRET: $${GOOGLE_CLIENT_SECRET:+set}${GOOGLE_CLIENT_SECRET:+' (redacted)'}"
@echo "GOOGLE_REDIRECT_URI: $${GOOGLE_REDIRECT_URI:+set}${GOOGLE_REDIRECT_URI:+' (redacted)'}"
@echo "JWT_SECRET_KEY: $${JWT_SECRET_KEY:+set}${JWT_SECRET_KEY:+' (redacted)'}"
@echo "JWT_ALGORITHM: ${JWT_ALGORITHM}"
@echo "SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE}"
@echo "SESSION_COOKIE_HTTPONLY: ${SESSION_COOKIE_HTTPONLY}"
@echo "SESSION_COOKIE_SAMESITE: ${SESSION_COOKIE_SAMESITE}"
@echo ""
@echo "β
If above values are set, OAuth endpoints should function."
# Development helpers
rebuild:
@echo "π Rebuilding all services..."
docker compose down
docker compose build --no-cache
docker compose up -d
@echo "β
Rebuild complete!"
clean:
@echo "π§Ή Cleaning up containers and images..."
docker compose down --rmi all --volumes --remove-orphans
docker system prune -f
@echo "β
Cleanup complete!"
# Individual services
crew:
@echo "π€ Starting only CrewAI service..."
docker compose up -d crew-service
api:
@echo "π Starting only API Gateway..."
docker compose up -d api-service
frontend:
@echo "βοΈ Starting only Frontend..."
docker compose up -d frontend
# Testing
test:
@echo "π§ͺ Running tests across all services..."
@echo "Testing Crew Service..."
docker compose exec crew-service python -m pytest tests/ || echo "No tests found in crew-service"
@echo "Testing API Service..."
docker compose exec api-service python -m pytest tests/ || echo "No tests found in api-service"
@echo "Testing Frontend..."
docker compose exec frontend npm test --watchAll=false || echo "No tests configured in frontend"
# Quick development workflow
dev: up
@echo "π§ Development mode started!"
@echo "π Logs will follow (Ctrl+C to stop logs, services keep running)..."
@sleep 3
make logs