Opinionated Next.js App Router starter integrated with Go Fiber backend authentication.
- Access Token: In-memory only via non-persisted Zustand store (
useAuthStore). - Refresh Token: Managed via
HttpOnlysecure cookies sent directly by the Go Fiber backend. JavaScript cannot access the refresh token. - Session Bootstrap: On application mount,
SessionProvidertriggersPOST /api/v1/auth/refreshusingauthClient(withCredentials: true) to restore the in-memory access token. - Single-Flight Refresh: Concurrent
401 ACCESS_TOKEN_EXPIREDrequests are merged into a single shared refresh promise viarefreshAccessToken(). - Axios Clients:
authClient(for auth endpoints with credentials) andapiClient(for business endpoints with Bearer tokens).
pnpm install
cp .env.example .env.local
pnpm devpnpm lint
pnpm type-check
pnpm docs:check
pnpm build
pnpm verify:all - Documentation index - Architecture, API, security, conventions, development, and more.
- A pre-commit hook runs
pnpm verify:fast(lint + type-check + docs:check) automatically on commit. - GitHub Actions CI runs lint, type-check, docs, build, and risk classification on every push/PR.