How rohatin/backoffice-fe works
Main Components
A. Frontend Layer:
• Client Application (React)
• Core Components (/src/components)
• Protected Routes (/src/routes/(protected))
• Public Routes (/src/routes/login)
• State Management (Context API - /src/store)
• Custom Hooks (/src/hooks)
B. API Layer:
• Authentication Service (Auth.js + Hono)
• API Routes (/api)
• SDK Integration Layer
C. External Services:
• Transaction Processing System
• User Management System
[Frontend Layer]
• ↓↑
[API Gateway/SDK Layer]
• ↓↑
[Backend Services]
Component Relationships to Highlight
a. Authentication Flow:
• LoginForm → Auth.js → Protected Routes
• Token Refresh Mechanism (useTokenRefresh)
• Role-based Access Control (usePermissions)
b. Data Flow:
• User Management (UserTable → API → Database)
• Transaction Processing (TransactionHistory → API → Transaction System)
• Role Management (CreateRoleForm/EditRole → API → User System)
Specific Implementation Details
• Rectangle: UI Components
• Hexagon: API Endpoints
• Diamond: Authentication Services
• Blue: Frontend Components
• Green: API Services
• Yellow: Authentication
• Purple: External Services
• Red: Critical Security Boundaries
Key Architectural Patterns to Emphasize
a. Component Architecture:
• Custom Components (/src/components/custom)
• UI Components (/src/components/ui)
• Protected Routes Pattern
b. State Management:
• Context API Implementation
• Server State (TanStack Query)
• Custom Hooks Pattern
Technical Stack Integration
Clear connections between:
• React + TypeScript
• TanStack Router
• TanStack Query
• Auth.js
• Shadcn UI Components
Security Layer
Highlight:
• Protected Routes
• Role-based Access
• Token Management
• API Key Implementation
Key Considerations:
State management flow using Context API
For this specific project, focus on showing how the frontend components interact with the API layer through the custom SDK, and how the authentication system protects various routes and functionalities.