1- .PHONY : help go-test rust-test go-run rust-run go-lint rust-lint go-fmt rust-fmt test-all lint-all fmt-all pre-push
1+ .PHONY : help go-test rust-test go-run rust-run go-lint rust-lint go-fmt rust-fmt frontend-test frontend-run frontend-docker-build frontend-docker-run frontend-docker-down frontend-setup test-all lint-all fmt-all pre-push
22
33# Default target
44help :
1111 @echo " make rust-lint - Run Rust linter and formatter check"
1212 @echo " make go-fmt - Format Go code"
1313 @echo " make rust-fmt - Format Rust code"
14- @echo " make test-all - Run all tests (Go + Rust)"
14+ @echo " make frontend-test - Run Python/Frontend tests"
15+ @echo " make frontend-run - Run Frontend server (without Docker)"
16+ @echo " make frontend-setup - Setup Python virtual environment and install dependencies"
17+ @echo " make frontend-docker-build - Build Frontend Docker image"
18+ @echo " make frontend-docker-run - Run Frontend using Docker Compose"
19+ @echo " make frontend-docker-down - Stop Frontend Docker containers"
20+ @echo " make test-all - Run all tests (Go + Rust + Frontend)"
1521 @echo " make lint-all - Run all linters (Go + Rust)"
1622 @echo " make fmt-all - Format all code (Go + Rust)"
1723 @echo " make pre-push - Run fmt, lint, and test (use before pushing)"
@@ -29,7 +35,6 @@ go-test-coverage:
2935 @echo " Running Go tests with coverage..."
3036 cd src/Backend/opti-sql-go && go test -v -coverprofile=coverage.out ./...
3137 cd src/Backend/opti-sql-go && go tool cover -func=coverage.out
32-
3338go-run :
3439 @echo " Running Go application..."
3540 cd src/Backend/opti-sql-go && go run main.go
@@ -71,8 +76,47 @@ rust-fmt-check:
7176 @echo " Checking Rust formatting..."
7277 cd src/Backend/opti-sql-rs && cargo fmt --check
7378
79+ # Frontend targets
80+ frontend-setup :
81+ @echo " Setting up Python virtual environment..."
82+ rm -rf src/FrontEnd/venv
83+ cd src/FrontEnd && python3.12 -m venv --without-pip venv
84+ @echo " Installing pip..."
85+ cd src/FrontEnd && . venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python
86+ @echo " Installing dependencies..."
87+ cd src/FrontEnd && . venv/bin/activate && pip install --upgrade pip && pip install -r requirements.txt
88+ @echo " Frontend setup completed! Activate with: cd src/FrontEnd && source venv/bin/activate"
89+
90+ frontend-test : frontend-setup
91+ @echo " Running Frontend/Python tests..."
92+ cd src/FrontEnd && . venv/bin/activate && pytest -m " not integration"
93+
94+ frontend-run :
95+ @echo " Running Frontend server..."
96+ cd src/FrontEnd && . venv/bin/activate && python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8005
97+
98+ frontend-docker-build :
99+ @echo " Building Frontend Docker image..."
100+ @if [ ! -f src/FrontEnd/.env ]; then \
101+ echo " Creating .env file from root .env..." ; \
102+ cp .env src/FrontEnd/.env; \
103+ fi
104+ cd src/FrontEnd && docker compose build
105+
106+ frontend-docker-run :
107+ @echo " Running Frontend with Docker Compose..."
108+ @if [ ! -f src/FrontEnd/.env ]; then \
109+ echo " Creating .env file from root .env..." ; \
110+ cp .env src/FrontEnd/.env; \
111+ fi
112+ cd src/FrontEnd && docker compose up -d
113+
114+ frontend-docker-down :
115+ @echo " Stopping Frontend Docker containers..."
116+ cd src/FrontEnd && docker compose down
117+
74118# Combined targets
75- test-all : go-test rust-test
119+ test-all : go-test rust-test frontend-test
76120 @echo " All tests completed!"
77121
78122lint-all : go-lint rust-lint
0 commit comments