feat: scaffold Go project with flake.nix and directory structure #9
Reference in New Issue
Block a user
Delete Branch "feature/scaffold-project"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>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-mobilematches the ROADMAP specification. Go 1.22.0 is appropriate since the server uses the Go 1.22+ enhancedServeMuxpattern routing ("GET /health").cmd/server/main.go
Solid minimal server:
http.ServeMuxwith Go 1.22 method-pattern routing -- good, no unnecessary dependencies.LISTEN_ADDRenv var with:8080default matches the ROADMAP config table./healthendpoint returns 200 with"ok"-- ready for K8s liveness/readiness probes./returns a placeholder HTML page with correctContent-Typeheader.log.Fatalfon server error for clean failure.No issues found.
flake.nix
Well-structured:
flake-utils.lib.eachDefaultSystemfor cross-platform support.go,gopls,gotools,go-tools, andairas specified in the ROADMAP.Note: There is no
flake.lockcommitted. This is acceptable for a scaffold PR -- it will be generated on firstnix developinvocation. Consider committing it in the next PR for reproducible builds.Directory Structure
All directories from the ROADMAP are present via
.gitkeepfiles:internal/config/-- for env-based configurationinternal/gitea/-- for SDK wrapper / aggregation layerinternal/handlers/-- for HTTP handlersinternal/middleware/-- for auth and logging middlewareinternal/templates/-- for Go html/template filesstatic/-- for CSS, JS, icons, PWA manifestThis matches the project structure in the ROADMAP exactly.
Suggestions for follow-up (not blocking)
.gitignore-- should ignore at minimum the built binary (e.g.,/gitea-mobile),/tmp/(air uses this), and any IDE files.flake.lockonce generated -- ensures all developers get the same toolchain versions.go.sumnote -- currently no dependencies so nogo.sumis needed, but the first dependency addition will create one.