forked from ponbac/toki2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
97 lines (72 loc) · 1.85 KB
/
justfile
File metadata and controls
97 lines (72 loc) · 1.85 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
# Toki2 justfile - common development commands
# Run `just` to see available recipes
# Default recipe shows help
default:
@just --list
# === Backend (Rust) ===
# Run the backend
run:
cd toki-api && cargo run
# Check backend compiles
check:
cargo check
# Run cargo clippy
clippy:
cargo clippy
# Build backend in release mode
build:
cargo build --release
# Initialize the database (requires Docker)
init-db:
cd toki-api && ./scripts/init_db.sh
# Pull production Fly Postgres DB and restore into local DB
db-prod-pull *args:
cd toki-api && ./scripts/db_prod_pull.sh {{args}}
# Prepare SQLx offline query data (run after changing SQL queries)
sqlx-prepare:
cargo sqlx prepare --workspace
# === Frontend (React/TS) ===
# Run frontend dev server
app:
cd app && bun dev
# TypeScript check
tsc:
cd app && bun tsc
# Lint frontend
lint:
cd app && bun lint
# Build frontend for production
build-app:
cd app && bun run build
# Preview production build
preview:
cd app && bun preview
# === Combined ===
# Run both backend and frontend
dev:
#!/usr/bin/env bash
trap 'kill 0' EXIT
(cd toki-api && cargo run) &
(cd app && bun dev) &
wait
# Verify all code compiles/passes checks
check-all: check clippy tsc lint
# Format frontend code with prettier
fmt:
cd app && bunx prettier --write src/
# === TUI ===
# Run the TUI (requires login — run `just tui-login` first if needed)
tui:
cd toki-tui && cargo run -- run
# Run the TUI in dev mode (no login required, mock data)
tui-dev:
cd toki-tui && cargo run -- dev
# Authenticate the TUI via browser OAuth
tui-login:
cd toki-tui && cargo run -- login
# Log out (clear saved session)
tui-logout:
cd toki-tui && cargo run -- logout
# Print TUI config path and create default config if missing
tui-config:
cd toki-tui && cargo run -- config-path