feat: Day 1 template readiness - #65
Conversation
Backend: - CORS allowed origins moved from hardcoded localhost:3000 to CORS_ALLOWED_ORIGINS env var (#44) - Standardized API response envelope: JSON[T], JSONStatus[T], JSONError helpers; all handlers updated (#46) - Request ID middleware: reads/generates X-Request-ID, propagates to logs and response header (#47) Web: - web/.env.example: added BACKEND_URL, NEXT_PUBLIC_BACKEND_URL, SENTRY_ORG, SENTRY_PROJECT (#45) - Error pages: app/not-found.tsx, app/error.tsx, app/global-error.tsx with tests (#48) Mobile: - HTTP client: data/network/ package with OkHttp AuthInterceptor (Firebase token), envelope types, UserApi.getMe() (#49) - BACKEND_URL build config field (defaults to http://10.0.2.2:8080 for emulator) - network_security_config.xml: allow cleartext to 10.0.2.2/localhost in dev builds Docs: - Updated backend/docs: environment.md, routing.md, middleware.md, error-handling.md - Updated web/docs/routing.md with error page conventions - Updated mobile/docs/architecture.md; created mobile/docs/http-client.md
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughBackend config now reads CORS origins from env and adds request IDs to middleware and logs. Shared JSON response helpers are introduced and adopted across handlers. Mobile code adds a Firebase-authenticated API client and ChangesBackend CORS and request IDs
Backend response envelopes and handlers
Mobile HTTP client and profile flow
Web error pages and docs
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Closes #44, #45, #46, #47, #48, #49
Six Day 1 blocker issues that prevented the template from being used as a project starter.
Backend
localhost:3000toCORS_ALLOWED_ORIGINSenv var (comma-separated, defaults tohttp://localhost:3000)JSON[T],JSONStatus[T],JSONErrorhelpers inresponse.go; all handlers and their tests updatedX-Request-ID, propagates to every log line and echo back in the response header; registered as the first middlewareWeb
web/.env.examplecompleted: addedBACKEND_URL,NEXT_PUBLIC_BACKEND_URL,SENTRY_ORG,SENTRY_PROJECTapp/not-found.tsx(Server Component),app/error.tsxandapp/global-error.tsx(Client Components with retry button); 5 Vitest tests addedMobile
data/network/package:ApiClient(OkHttp + Firebase ID token interceptor),ApiResponse<T>/ApiErrorResponseenvelope types matching the backend shape,UserApi.getMe()suspend function with injectable params for testability;UserApiTestcovers success + 401 paths via MockWebServerBACKEND_URLbuild config field (defaults tohttp://10.0.2.2:8080for emulator)network_security_config.xml: allows cleartext HTTP to10.0.2.2andlocalhostin dev builds only — fixes the "CLEARTEXT not permitted" error when calling the local backend from an emulatorDocs
backend/docs:environment.md,routing.md,middleware.md,error-handling.mdweb/docs/routing.mdwith error page conventionsmobile/docs/architecture.md; createdmobile/docs/http-client.mdTest plan
go vet ./...— passespnpm lint && pnpm build— passes./gradlew lint && ./gradlew test— passesSummary by CodeRabbit
New Features
Bug Fixes
Documentation