1.0 KiB
1.0 KiB
Dashboard + Dev Server Plan
Focus
- Protected dashboard (server-side session check + redirect)
- Confirm dev server setup for live reload of UI + API routes
Goals
- Prevent unauthenticated access to the dashboard.
- Keep auth validation server-side.
- Ensure local dev server supports hot reload for frontend and backend (API routes).
Proposed changes
Backend/session
- Add a server helper to fetch the current user from the session cookie.
Dashboard
- Update
apps/web/app/page.tsxto:- Load current user on the server.
- Redirect to
/loginif no valid session. - Show a minimal dashboard once authenticated.
Dev server
- Use
npm run devat repo root (already mapped toapps/webdev). - Next.js dev server hot reloads both UI and API routes automatically.
Files impacted
apps/web/lib/session.ts(new)apps/web/app/page.tsxpackage.json(optional script alias)
Status
- Implemented
Notes
- Run
npm run devornpm run dev:webfor hot reload of UI + API routes.