Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (41 loc) · 1.87 KB
/
Copy pathMakefile
File metadata and controls
54 lines (41 loc) · 1.87 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
.PHONY: install dev test lint docker-up docker-build reset-db seed help
APP_VERSION := $(shell cat VERSION 2>/dev/null || echo "0.7.0")
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install all dependencies
cd backend && pip install -r requirements.txt
cd frontend && npm install
dev: ## Start both backend and frontend dev servers
@echo "Starting OpenS2P v$(APP_VERSION) development environment..."
@echo ""
@echo " Backend: http://localhost:8000"
@echo " Frontend: http://localhost:5173"
@echo " API Docs: http://localhost:8000/docs"
@echo ""
cd backend && uvicorn app.main:app --reload --port 8000 &
cd frontend && npm run dev
test: ## Run all tests
cd backend && pytest ../tests/ -v
lint: ## Lint backend code
cd backend && pip install -q ruff && ruff check app/ && echo "✅ Backend lint passed"
docker-up: ## Start full stack with Docker Compose
docker compose up --build -d
@echo "OpenS2P v$(APP_VERSION) running at http://localhost:80"
docker-down: ## Stop Docker Compose stack
docker compose down
reset-db: ## Drop, recreate, migrate, and seed the database
@echo "Resetting database..."
psql -U opens2p -d postgres -c "DROP DATABASE IF EXISTS opens2p_dev" 2>/dev/null || true
psql -U opens2p -d postgres -c "CREATE DATABASE opens2p_dev" 2>/dev/null || true
cd backend && alembic upgrade head
cd backend && python -m app.db.seed
@echo "✅ Database reset complete"
seed: ## Re-run seed data
cd backend && python -m app.db.seed
migrate: ## Run pending migrations
cd backend && alembic upgrade head
migration: ## Create a new migration (usage: make migration msg="description")
cd backend && alembic revision --autogenerate -m "$(msg)"
version: ## Show application version
@echo "OpenS2P v$$(cat VERSION 2>/dev/null || echo '0.1.0')"