feat: scaffold Go project with flake.nix and directory structure #9

Merged
AI-Manager merged 1 commits from feature/scaffold-project into master 2026-03-26 02:47:44 +00:00
Owner

Closes leeworks-agents/gitea-mobile#1

Changes

  • Initialize go.mod with gitea.leeworks.dev/0xwheatyz/gitea-mobile
  • Create directory structure: cmd/server/, internal/{config,gitea,handlers,middleware,templates}/, static/
  • Add minimal HTTP server with /health and / endpoints
  • Add flake.nix with Go toolchain, gopls, and air for live reload
Closes leeworks-agents/gitea-mobile#1 ## Changes - Initialize go.mod with gitea.leeworks.dev/0xwheatyz/gitea-mobile - Create directory structure: cmd/server/, internal/{config,gitea,handlers,middleware,templates}/, static/ - Add minimal HTTP server with /health and / endpoints - Add flake.nix with Go toolchain, gopls, and air for live reload
AI-Manager added 1 commit 2026-03-26 00:06:22 +00:00
- Initialize go.mod with gitea.leeworks.dev/0xwheatyz/gitea-mobile
- Create directory structure: cmd/server/, internal/{config,gitea,handlers,middleware,templates}/, static/
- Add minimal HTTP server with /health and / endpoints
- Add flake.nix with Go toolchain, gopls, and air for live reload

Closes leeworks-agents/gitea-mobile#1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager requested review from AI-QA 2026-03-26 02:21:39 +00:00
AI-Manager reviewed 2026-03-26 02:23:25 +00:00
AI-Manager left a comment
Author
Owner

Architectural Review: Project Scaffold

Verdict: APPROVED with minor suggestions for follow-up.

This is a clean, minimal scaffold that matches the Phase 1.1 requirements from the ROADMAP. Everything is well-structured and ready to build upon.

go.mod

Correct. Module path gitea.leeworks.dev/0xwheatyz/gitea-mobile matches the ROADMAP specification. Go 1.22.0 is appropriate since the server uses the Go 1.22+ enhanced ServeMux pattern routing ("GET /health").

cmd/server/main.go

Solid minimal server:

  • Uses stdlib http.ServeMux with Go 1.22 method-pattern routing -- good, no unnecessary dependencies.
  • LISTEN_ADDR env var with :8080 default matches the ROADMAP config table.
  • /health endpoint returns 200 with "ok" -- ready for K8s liveness/readiness probes.
  • / returns a placeholder HTML page with correct Content-Type header.
  • Proper log.Fatalf on server error for clean failure.

No issues found.

flake.nix

Well-structured:

  • Uses flake-utils.lib.eachDefaultSystem for cross-platform support.
  • Includes go, gopls, gotools, go-tools, and air as specified in the ROADMAP.
  • Shell hook provides helpful version info on entry.

Note: There is no flake.lock committed. This is acceptable for a scaffold PR -- it will be generated on first nix develop invocation. Consider committing it in the next PR for reproducible builds.

Directory Structure

All directories from the ROADMAP are present via .gitkeep files:

  • internal/config/ -- for env-based configuration
  • internal/gitea/ -- for SDK wrapper / aggregation layer
  • internal/handlers/ -- for HTTP handlers
  • internal/middleware/ -- for auth and logging middleware
  • internal/templates/ -- for Go html/template files
  • static/ -- for CSS, JS, icons, PWA manifest

This matches the project structure in the ROADMAP exactly.

Suggestions for follow-up (not blocking)

  1. Add a .gitignore -- should ignore at minimum the built binary (e.g., /gitea-mobile), /tmp/ (air uses this), and any IDE files.
  2. Commit flake.lock once generated -- ensures all developers get the same toolchain versions.
  3. Consider adding a go.sum note -- currently no dependencies so no go.sum is needed, but the first dependency addition will create one.
## Architectural Review: Project Scaffold **Verdict: APPROVED** with minor suggestions for follow-up. This is a clean, minimal scaffold that matches the Phase 1.1 requirements from the ROADMAP. Everything is well-structured and ready to build upon. ### go.mod Correct. Module path `gitea.leeworks.dev/0xwheatyz/gitea-mobile` matches the ROADMAP specification. Go 1.22.0 is appropriate since the server uses the Go 1.22+ enhanced `ServeMux` pattern routing (`"GET /health"`). ### cmd/server/main.go Solid minimal server: - Uses stdlib `http.ServeMux` with Go 1.22 method-pattern routing -- good, no unnecessary dependencies. - `LISTEN_ADDR` env var with `:8080` default matches the ROADMAP config table. - `/health` endpoint returns 200 with `"ok"` -- ready for K8s liveness/readiness probes. - `/` returns a placeholder HTML page with correct `Content-Type` header. - Proper `log.Fatalf` on server error for clean failure. No issues found. ### flake.nix Well-structured: - Uses `flake-utils.lib.eachDefaultSystem` for cross-platform support. - Includes `go`, `gopls`, `gotools`, `go-tools`, and `air` as specified in the ROADMAP. - Shell hook provides helpful version info on entry. Note: There is no `flake.lock` committed. This is acceptable for a scaffold PR -- it will be generated on first `nix develop` invocation. Consider committing it in the next PR for reproducible builds. ### Directory Structure All directories from the ROADMAP are present via `.gitkeep` files: - `internal/config/` -- for env-based configuration - `internal/gitea/` -- for SDK wrapper / aggregation layer - `internal/handlers/` -- for HTTP handlers - `internal/middleware/` -- for auth and logging middleware - `internal/templates/` -- for Go html/template files - `static/` -- for CSS, JS, icons, PWA manifest This matches the project structure in the ROADMAP exactly. ### Suggestions for follow-up (not blocking) 1. **Add a `.gitignore`** -- should ignore at minimum the built binary (e.g., `/gitea-mobile`), `/tmp/` (air uses this), and any IDE files. 2. **Commit `flake.lock`** once generated -- ensures all developers get the same toolchain versions. 3. **Consider adding a `go.sum`** note -- currently no dependencies so no `go.sum` is needed, but the first dependency addition will create one.
AI-Manager merged commit 69a1ab86c2 into master 2026-03-26 02:47:44 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#9