This document outlines the complete user flows within the NextJS starter application with Better Auth v1.4+ and Drizzle ORM v0.45+, including dashboard navigation, user management, data operations, and feature interactions.
| SUPERADMIN | C[System Administration] B --> | ADMIN | D[Organization Management] B --> | USER | E[Standard User Access] C --> F[User Management] D --> I[Organization Dashboard] E --> L[Personal Dashboard] F --> O[Data Operations] 1. Dashboard Navigation FlowDashboard Navigation Structureflowchart TD A[Dashboard Layout] --> B[Sidebar Navigation] A --> C[Top Navigation Bar] A --> D[Main Content Area] B --> E[Dashboard Home] C --> J[User Menu] D --> N[Page Content] Navigation Permission FlowsequenceDiagram participant User participant Dashboard participant API participant Router User->>Dashboard: Access dashboard User->>Dashboard: Click navigation item alt Authorized Role-Based Navigation2. User Management FlowUser Management Interfaceflowchart TD A[User Management Page] --> B[User List Component] B --> C[Data Table] C --> D[Search & Filter] G --> H[View User Details] H --> M[User Details Modal] User List Data FlowsequenceDiagram participant Admin participant UserTable participant API participant Database Admin->>UserTable: Access user management Admin->>UserTable: Apply search/filter User CRUD OperationsCreate User FlowsequenceDiagram participant Admin participant UserForm participant API participant Auth participant Database Admin->>UserForm: Click "Add User" Edit User FlowsequenceDiagram participant Admin participant EditForm participant API participant Database Admin->>EditForm: Click edit user Delete User FlowsequenceDiagram participant Admin participant UserTable participant ConfirmDialog participant API participant Database Admin->>UserTable: Click delete user 3. Data Table Interaction FlowData Table Component Structureflowchart TD A[Data Table] --> B[Table Header] A --> C[Table Body] A --> D[Table Toolbar] A --> E[Pagination] B --> F[Column Sorting] D --> I[Search Bar] C --> L[Row Selection] E --> O[Page Navigation] Data Table Interaction FlowsequenceDiagram participant User participant DataTable participant API participant Database User->>DataTable: Load data table User->>DataTable: Apply sort/filter Data Export FlowsequenceDiagram participant User participant DataTable participant API participant FileService User->>DataTable: Click export button 4. Kanban Board FlowKanban Board Layoutflowchart TD A[Kanban Board] --> B[Task Columns] A --> C[Task Cards] A --> D[Board Controls] B --> E[To Do] C --> I[Task Title] D --> L[Add Task] Task Drag and Drop FlowsequenceDiagram participant User participant TaskCard participant Board participant StateStore User->>TaskCard: Start dragging task Task Management OperationssequenceDiagram participant User participant KanbanBoard participant TaskDialog participant StateStore User->>KanbanBoard: Click "Add Task" User->>KanbanBoard: Click edit task 5. Profile Management FlowUser Profile Settingsgraph TD A[Profile Page] --> B[Profile Information] A --> C[Account Settings] A --> D[Security Settings] A --> E[Preferences] B --> F[Name & Email] C --> I[Email Notifications] D --> L[Password Change] E --> O[Theme Preferences] Profile Update FlowsequenceDiagram participant User participant ProfilePage participant ProfileForm participant API participant DB participant FileService User->>ProfilePage: Navigate to profile Note over User,FileService: Profile Picture Update Note over User,DB: Profile Information Update Password Change FlowsequenceDiagram participant User participant ProfilePage participant PasswordForm participant API participant BetterAuth participant DB User->>ProfilePage: Navigate to security settings 6. Organization Management FlowOrganization Dashboardgraph TD A[Organization Dashboard] --> B[Organization Info] A --> C[Team Members] A --> D[Invitations] A --> E[Organization Settings] B --> F[Organization Details] C --> H[Member List] D --> K[Pending Invitations] E --> N[General Settings] Team Invitation FlowsequenceDiagram participant Owner participant OrgDashboard participant InviteForm participant API participant DB participant EmailService participant Invitee Owner->>OrgDashboard: Navigate to team management Invitation Acceptance FlowsequenceDiagram participant Invitee participant EmailClient participant InvitationLink participant API participant BetterAuth participant DB Invitee->>EmailClient: Open invitation email 7. Theme and Preferences FlowTheme Switching FlowsequenceDiagram participant User participant ThemeSwitcher participant PreferenceStore participant LocalStorage participant CSSVariables User->>ThemeSwitcher: Click theme toggle Note over User,PreferenceStore: Theme Preset Selection Language Switching FlowsequenceDiagram participant User participant LocaleSwitcher participant Router participant API participant TranslationService User->>LocaleSwitcher: Click language switcher 8. Error Handling and User FeedbackApplication Error Statesgraph TD A[User Action] --> B{Success?} B --> | Yes | C[Show Success Feedback] B --> | No | D[Show Error Message] C --> E[Update UI State] D --> G{Error Type} | Validation Error | H[Show Field Errors] G --> | Network Error | I[Show Retry Option] G --> | Permission Error | J[Redirect or Show Access Denied] G --> | Server Error |
H --> L[Highlight Invalid Fields]
I --> M[Retry Action on Request]
J --> N[Contact Admin Option]
K --> O[Try Again Later Message]
interface LoadingStates {
initial: "Initial loading state";
loading: "Action in progress";
success: "Action completed successfully";
error: "Action failed";
validating: "Form validation in progress";
uploading: "File upload in progress";
saving: "Saving changes";
deleting: "Deleting item";
refreshing: "Refreshing data";
}interface FeedbackPatterns {
success: {
toast: "Brief success notification";
banner: "Persistent success message";
inline: "Success state within form";
modal: "Success confirmation dialog";
};
error: {
field: "Field-specific error message";
form: "Form-level error summary";
toast: "Brief error notification";
page: "Full-page error state";
};
progress: {
spinner: "Loading spinner";
skeleton: "Content skeleton loader";
progress: "Progress bar";
steps: "Multi-step progress indicator";
};
}---
Document Version: 1.1
Last Updated: December 8, 2024
Next Review: January 31, 2025