Overview
The frontend is a React 18 single-page application built with TypeScript, using modern patterns and best practices.Application Entry Point
The application initializes through a standard React 18 setup:- Error boundary wraps entire app for graceful error handling
- Root-level CSS imports for Tailwind and global styles
- No React.StrictMode to avoid double-rendering in development
App Component Structure
- QueryClientProvider - Tanstack Query for server state
- TooltipProvider - Radix UI tooltip context
- Toaster + Sonner - Dual notification systems
- BrowserRouter - Client-side routing
Routing Structure
Component Architecture
Directory Structure
Component Patterns
- Data Fetching
- Animation
- Forms
- Modal Viewer
Components fetch data directly using native API URL Configuration:
fetch API, not React Query hooks.State Management
Local Component State
Most state is managed locally withuseState:
No Global State
The application doesn’t use Redux, Zustand, or other global state libraries. State is either:- Local to components
- Fetched from API on mount
- Passed via props when needed
Authentication State
Admin token stored in localStorage:Styling Architecture
TailwindCSS Configuration
Component Styling Patterns
- Utility-First: Tailwind classes directly in JSX
- CSS Variables: Theme colors defined in
:rootand[data-theme] - Class Variance Authority: Used in UI components for variant props
- Tailwind Merge:
cn()utility prevents class conflicts
TypeScript Types
Project Interface
Type Safety
- Vite env types:
src/vite-env.d.tsforimport.meta.env - Strict mode: Enabled in
tsconfig.json - Path aliases:
@/→./src/configured in both Vite and TSConfig
Build Configuration
- React SWC plugin for fast refresh
- Component tagger in development only
- API proxy to backend during dev
- Path alias resolution
Testing Setup
Next Steps
Backend Architecture
Explore Express server structure and API endpoints
Component Reference
Detailed guide for each component
