chore(dev): run backend with air
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-05-02 16:29:00 -04:00
parent f359471a27
commit 9b77a473b7
5 changed files with 34 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ The frontend builds to `frontend/public/dist/`, then `make frontend` copies the
make all # Build frontend + backend
make frontend # Build frontend, copy to backend/web/static/
make backend # Build Go binary (requires frontend assets)
make dev # Run both with hot-reload
make dev # Run frontend watcher + backend hot reload via air
make tests # Run Go tests
make docker # Build Docker image
```

View File

@@ -27,7 +27,7 @@ clean:
dev:
rm -rf frontend/public/dist
cd frontend && bun run build
cd backend && AETHERA_STATIC_DIR=../frontend/public go run ./cmd --listen 0.0.0.0 & \
cd backend && AETHERA_STATIC_DIR=../frontend/public air & \
backend_pid=$$!; \
trap 'kill $$backend_pid' INT TERM EXIT; \
cd frontend && bun run dev

30
backend/.air.toml Normal file
View File

@@ -0,0 +1,30 @@
root = "."
tmp_dir = "tmp"
[build]
cmd = "go build -o ./tmp/aethera ./cmd"
bin = "./tmp/aethera"
full_bin = "./tmp/aethera --listen 0.0.0.0"
delay = 1000
exclude_dir = ["data", "dist", "tmp", "web/static"]
exclude_file = []
exclude_regex = ["_test.go"]
include_dir = []
include_ext = ["go", "mod", "sum"]
kill_delay = "500ms"
log = "build-errors.log"
send_interrupt = true
stop_on_error = true
[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
[log]
time = false
[misc]
clean_on_exit = true

View File

@@ -3,6 +3,7 @@
## Stack
- **Go 1.25.5** (`reichard.io/aethera`)
- **air** (backend hot reload for `make dev`)
- **cobra** (CLI framework)
- **logrus** (structured logging)
- **openai-go/v3** (OpenAI API client)

View File

@@ -26,6 +26,7 @@
devShells.default = pkgs.mkShell {
packages = with pkgs; [
# Backend
air
go
gopls
golangci-lint