Overview
DADDO is built as a modern single-page application (SPA) using React 18 with Vite as the build tool and bundler. The application follows a component-based architecture with centralized state management using Redux.Technology Stack
Frontend Framework
React 18.2.0 with React Router v7.6.3
Build Tool
Vite 5.2.0 for fast development and optimized builds
State Management
Redux 5.0.1 with Redux Thunk 3.1.0
Styling
Tailwind CSS 4.1.11 with Vite plugin
Project Structure
The application follows a clear separation of concerns with the following directory structure:Build Configuration
Vite Configuration
The application uses Vite with React and Tailwind CSS plugins:vite.config.js
Build Scripts
Available NPM scripts:package.json
Routing Architecture
The application uses React Router v7 for client-side routing with a clear separation between public and protected routes.Route Configuration
src/App.jsx
Protected Routes Implementation
Authenticated routes are protected using a wrapper component that checks for a valid authentication token:src/components/Protected_Route.jsx
The
Protected_Route component uses Redux to check authentication state and automatically redirects unauthenticated users to the login page.Authentication Flow
- User submits login credentials
- Redux action dispatches API request
- On success, token is stored in localStorage/sessionStorage
- Redux store updates with user data and token
- Protected routes become accessible
- Token is automatically included in subsequent API requests via interceptor
Deployment Configuration
Vercel Deployment
The application is configured for deployment on Vercel with SPA routing support:vercel.json
Environment Variables
.env
Key Dependencies
| Package | Version | Purpose |
|---|---|---|
| react | 18.2.0 | Core UI library |
| react-router-dom | 7.6.3 | Client-side routing |
| redux | 5.0.1 | State management |
| redux-thunk | 3.1.0 | Async action handling |
| axios | 1.10.0 | HTTP client |
| tailwindcss | 4.1.11 | Utility-first CSS |
| recharts | 3.2.0 | Data visualization |
| qrcode.react | 4.2.0 | QR code generation |
| react-toastify | 11.0.5 | Toast notifications |
| lucide-react | 0.539.0 | Icon library |
Performance Optimizations
- Vite’s Fast Refresh: Hot module replacement for instant updates during development
- Code Splitting: React Router automatically splits code by route
- Optimized Production Builds: Vite produces highly optimized production bundles
- Tree Shaking: Unused code is automatically removed from production builds
Next Steps
State Management
Learn about Redux store configuration and state structure
API Integration
Explore API configuration and authentication