Create account management features#6
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds account management capabilities to the admin app, including admin API routes and UI pages for listing, creating, editing, and deleting accounts, plus a dashboard widget for recently created accounts.
Changes:
- Added
/api/admin/*endpoints for account CRUD and dashboard “recent accounts”. - Implemented new
/system/accountspages/components for list/create/edit flows. - Updated server-side fetch behavior and navigation/layout wiring; bumped a couple dev dependencies.
Reviewed changes
Copilot reviewed 40 out of 44 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Updates lockfile for dependency bumps. |
| apps/admin/package.json | Bumps globals and postcss versions. |
| apps/admin/src/styles/globals.css | Tweaks theme CSS variables (incl. destructive foreground). |
| apps/admin/src/server/domains/account.ts | Updates AccountSummary type import path. |
| apps/admin/src/proxy.ts | Adjusts auth handling behavior + matcher paths (intended for request protection). |
| apps/admin/src/lib/server/private-api.ts | Forwards cookies in server-side internal API calls. |
| apps/admin/src/app/api/admin/dashboard/recent-accounts/route.ts | New API to fetch accounts created since start of month. |
| apps/admin/src/app/api/admin/accounts/route.ts | New admin API for account list + account creation. |
| apps/admin/src/app/api/admin/accounts/[id]/route.ts | New admin API for account detail + update + delete. |
| apps/admin/src/app/api/accounts/create-first-account/route.ts | Prevents creating “first account” if an active account already exists. |
| apps/admin/src/app/(auth)/firstuser/_lib/actions.ts | Aligns “active account exists” response shape to boolean. |
| apps/admin/src/app/(app)/system/accounts/page.tsx | Server-renders account list with query params + initial data fetch. |
| apps/admin/src/app/(app)/system/accounts/new/page.tsx | Adds “new account” page. |
| apps/admin/src/app/(app)/system/accounts/new/layout.tsx | Adds metadata/layout wrapper for “new account” route. |
| apps/admin/src/app/(app)/system/accounts/new/_lib/schemas.ts | Adds Zod schema for create-account form. |
| apps/admin/src/app/(app)/system/accounts/new/_lib/actions.ts | Adds server action to create accounts via admin API. |
| apps/admin/src/app/(app)/system/accounts/new/_components/schemas.ts | Removes old create-account schema file. |
| apps/admin/src/app/(app)/system/accounts/new/_components/create-account.tsx | Adds create-account form UI. |
| apps/admin/src/app/(app)/system/accounts/_lib/types.ts | Introduces shared account types for list/detail. |
| apps/admin/src/app/(app)/system/accounts/_lib/schemas.ts | Adds schema for listing accounts (query/sort/paging). |
| apps/admin/src/app/(app)/system/accounts/_lib/constants.ts | Adds account privilege constants. |
| apps/admin/src/app/(app)/system/accounts/_lib/actions.ts | Adds server actions for list + delete. |
| apps/admin/src/app/(app)/system/accounts/_components/types.ts | Removes old account component types. |
| apps/admin/src/app/(app)/system/accounts/_components/delete-account-dialog.tsx | Adds delete confirmation dialog component. |
| apps/admin/src/app/(app)/system/accounts/_components/account-search.tsx | Adds search + sort UI with debounce. |
| apps/admin/src/app/(app)/system/accounts/_components/account-list/index.ts | Removes old re-export index. |
| apps/admin/src/app/(app)/system/accounts/_components/account-list/condition/index.ts | Removes old condition re-export index. |
| apps/admin/src/app/(app)/system/accounts/_components/account-list/condition/condition.tsx | Removes legacy list condition component. |
| apps/admin/src/app/(app)/system/accounts/_components/account-list/condition/condition.module.scss | Removes legacy SCSS for condition UI. |
| apps/admin/src/app/(app)/system/accounts/_components/account-list/account-list.tsx | Removes legacy account list component. |
| apps/admin/src/app/(app)/system/accounts/_components/account-list/account-list.module.scss | Removes legacy SCSS for account list. |
| apps/admin/src/app/(app)/system/accounts/_components/account-list.tsx | Adds new account list table UI with pagination + delete action. |
| apps/admin/src/app/(app)/system/accounts/[id]/edit/page.tsx | Adds account edit page (server fetch + 404 on missing). |
| apps/admin/src/app/(app)/system/accounts/[id]/edit/layout.tsx | Adds metadata/layout wrapper for edit route. |
| apps/admin/src/app/(app)/system/accounts/[id]/edit/_lib/schemas.ts | Adds Zod schema for editing accounts. |
| apps/admin/src/app/(app)/system/accounts/[id]/edit/_lib/actions.ts | Adds server actions for get/update/delete via admin API. |
| apps/admin/src/app/(app)/system/accounts/[id]/edit/_components/edit-account.tsx | Adds edit-account form UI + delete dialog. |
| apps/admin/src/app/(app)/layout.tsx | Switches to new AppLayout component + renames navigation constant. |
| apps/admin/src/app/(app)/dashboard/page.tsx | Implements dashboard server-render with recent-accounts widget. |
| apps/admin/src/app/(app)/dashboard/_lib/actions.ts | Adds server action to fetch recent accounts. |
| apps/admin/src/app/(app)/dashboard/_components/recent-accounts.tsx | Adds dashboard table for recently created accounts. |
| apps/admin/src/app/(app)/_layout/navigation.ts | Renames NAVIGATION to NAVIGATIONS. |
| apps/admin/src/app/(app)/_layout/breadcrumb.tsx | Improves breadcrumb generation for dynamic routes + disabled states. |
| apps/admin/src/app/(app)/_layout/app-layout.tsx | Adds new sidebar-based application layout component. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.