Introduction
The Auction Platform Frontend follows a feature-based architecture organized around domain-specific modules. The application is built with React, TypeScript, TanStack Router, and Zustand for state management.Project Structure
The source code is organized into the following top-level directories:Core Directories
App Layer (src/app/)
The application layer contains the core infrastructure:
api/- API client and request handlingstore/- Global state management with Zustandhooks/- Custom React hooksproviders/- Context providers (Theme, etc.)config.ts- Application configurationErrorBoundary.tsx- Global error handling
Features Layer (src/features/)
Feature modules encapsulate domain-specific logic:
Shared Layer (src/shared/)
Reusable code shared across features:
ui/- Generic UI components (Button, TextField, Typography, etc.)styles/- Global styles (tokens, themes, reset)validation-engine/- Form validation utilities
Widgets Layer (src/widgets/)
Complex, reusable components that combine multiple UI elements:
Navbar/- Navigation bar componentSidebar/- Sidebar navigationCreate-auction/- Auction creation widget
Routes Layer (src/routes/)
TanStack Router file-based routing structure with layout routes:
__root.tsx- Root route component_with-navbar/- Routes with navbar layout_with-sidebar/- Routes with sidebar layout_without-navbar/- Routes without navigation (auth pages)
Design Patterns
Feature-Sliced Design
The architecture follows principles inspired by Feature-Sliced Design:Layers
Code is organized into layers (app, features, shared, widgets) with clear dependencies flowing downward.
Separation of Concerns
UI Components
UI Components
React components focus purely on presentation and user interaction.
Business Logic
Business Logic
Services and stores handle business logic, API calls, and state management.
Routing
Routing
TanStack Router manages navigation with type-safe routes and layouts.
State Management
State Management
Zustand stores provide global state with a simple, hook-based API.
Application Bootstrap
The application initializes insrc/main.tsx:
The auth store is initialized before the router to ensure authentication state is available for route guards.
Key Technologies
React 18
Modern React with hooks, StrictMode, and Suspense
TypeScript
Full type safety across the application
TanStack Router
Type-safe routing with file-based routes
Zustand
Lightweight state management
Next Steps
Routing
Learn about TanStack Router setup and route structure
State Management
Explore Zustand stores and state patterns
API Client
Understand the API client and request handling