-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
186 lines (145 loc) · 3.92 KB
/
justfile
File metadata and controls
186 lines (145 loc) · 3.92 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Call for Papers - Just Commands
# https://github.com/casey/just
# Default recipe to display help information
default:
@just --list
# Setup development environment
setup:
@echo "Setting up development environment..."
rustup target add wasm32-unknown-unknown
cargo install trunk --version 0.18.8
cargo install sqlx-cli --no-default-features --features postgres
cp .env.example .env
@echo "Setup complete! Edit .env with your configuration."
# Start PostgreSQL using podman-compose
db-start:
podman-compose up -d postgres
# Stop PostgreSQL
db-stop:
podman-compose down
# View database logs
db-logs:
podman-compose logs -f postgres
# Run database migrations
migrate:
sqlx migrate run
# Create a new migration
migrate-create name:
sqlx migrate add {{name}}
# Revert last migration
migrate-revert:
sqlx migrate revert
# Build backend (debug)
build:
cargo build
# Build backend (release)
build-release:
cargo build --release
# Build frontend (debug)
build-frontend:
cd frontend && trunk build
# Build frontend (release)
build-frontend-release:
cd frontend && trunk build --release
# Build both backend and frontend (release)
build-all: build-frontend-release build-release
# Run backend server
run:
cargo run
# Run backend with watch (auto-reload on changes)
watch:
cargo watch -x run
# Run frontend dev server
run-frontend:
cd frontend && trunk serve
# Run frontend dev server on specific port
run-frontend-port port:
cd frontend && trunk serve --port {{port}}
# Run both backend and frontend in development mode
dev:
@echo "Start backend in one terminal: just run"
@echo "Start frontend in another terminal: just run-frontend"
# Run tests
test:
cargo test
# Run tests with output
test-verbose:
cargo test -- --nocapture
# Run frontend tests
test-frontend:
cd frontend && cargo test --target wasm32-unknown-unknown
# Run all tests (backend + frontend)
test-all: test test-frontend
# Format code
fmt:
cargo fmt --all
# Check code formatting
fmt-check:
cargo fmt --all -- --check
# Run clippy linter
lint:
cargo clippy --all-targets --all-features -- -D warnings
# Run security audit
audit:
cargo audit
# Clean build artifacts
clean:
cargo clean
cd frontend && trunk clean
# Full check (format, lint, test)
check: fmt-check lint test
# Build Docker image
docker-build:
podman build -t call-for-papers:latest .
# Build Docker image with cache
docker-build-cached:
podman build --cache-from call-for-papers:latest -t call-for-papers:latest .
# Run Docker container (requires PostgreSQL)
docker-run:
podman run -d \
--name cfp-app \
-p 8080:8080 \
-e DATABASE_URL=postgres://postgres:postgres@host.containers.internal:5432/call_for_papers \
call-for-papers:latest
# Stop Docker container
docker-stop:
podman stop cfp-app
podman rm cfp-app
# View Docker logs
docker-logs:
podman logs -f cfp-app
# Start full stack with Docker Compose
up:
podman-compose up -d
# Stop full stack
down:
podman-compose down
# Restart full stack
restart:
podman-compose restart
# View all logs
logs:
podman-compose logs -f
# Create uploads directory
create-uploads:
mkdir -p uploads
# Initialize project (setup + db + migrations + uploads)
init: setup create-uploads db-start
@echo "Waiting for PostgreSQL to be ready..."
@sleep 5
just migrate
@echo "Initialization complete! Run 'just dev' to start developing."
# Production build check
prod-check: clean check build-all
@echo "Production build successful!"
# Show project status
status:
@echo "=== Git Status ==="
@git status --short
@echo ""
@echo "=== Docker Containers ==="
@podman-compose ps
@echo ""
@echo "=== Build Artifacts ==="
@ls -lh target/release/call-for-papers 2>/dev/null || echo "No release binary"
@ls -lh frontend/dist/index.html 2>/dev/null || echo "No frontend build"