Dr. Dieu Phan D.C. - Modern React-based frontend for chiropractic clinic management
A comprehensive, production-ready frontend application built with React and modern web technologies for managing chiropractic clinic operations, patient records, appointments, and doctor-patient communication.
Recent optimizations implemented:
β
Route-based lazy loading - Reduces initial bundle by ~80%
β
Image lazy loading - Progressive image loading
β
Advanced code splitting - 40+ optimized chunks
β
Error boundaries - Graceful error handling
- Use Squoosh.app or TinyPNG
- Convert to WebP format, 75-80% quality
- Target: Each image < 200KB
Performance Monitoring:
import { performanceTracker } from '@/api/core/baseApi';
console.log(performanceTracker.getStats()); // View API performanceThis is the complete frontend application for Dr. Dieu Phan's chiropractic practice management system. It provides an intuitive, responsive interface for patients, doctors, and administrators to manage all aspects of clinic operations.
- π Secure Authentication: JWT-based authentication with refresh token support
- π₯ Patient Management: Complete patient intake, records, and medical history
- π Appointment Scheduling: Intelligent booking system with doctor availability
- π¬ Real-time Chat: Doctor-patient messaging system with live updates
- π Clinical Documentation: SOAP notes, vitals tracking, and medical records
- π Reports & Analytics: Patient reports and clinic analytics
- π± Responsive Design: Works seamlessly on desktop, tablet, and mobile
- π¨ Modern UI: Clean, professional interface using shadcn/ui components
- βΏ Accessibility: WCAG compliant with keyboard navigation support
- π PWA Ready: Progressive Web App capabilities for offline access
- π± Mobile Apps: Native iOS and Android apps via Capacitor
- β‘ Performance: Lazy loading, code splitting, and optimized bundles
| Category | Technologies |
|---|---|
| Frontend Framework | React 18 with Hooks + Lazy Loading |
| Build Tool | Vite (fast HMR & optimized builds) |
| State Management | Redux Toolkit + RTK Query |
| Styling | Tailwind CSS 3 |
| UI Components | shadcn/ui (Radix UI primitives) |
| Forms | React Hook Form + Zod validation |
| Routing | React Router v6 + Code Splitting |
| HTTP Client | Fetch API with custom interceptors |
| Authentication | JWT tokens with secure storage |
| Icons | Radix Icons + Lucide React |
| Date Handling | date-fns |
| Mobile Apps | Capacitor 7 (iOS & Android) |
| Testing | Vitest + React Testing Library |
| Code Quality | ESLint + Prettier |
| Performance | Lazy Loading + Advanced Code Splitting |
- Node.js: Version 18 or higher
- npm: Version 9 or higher
- Backend API: Running on
http://localhost:3000(see backend README)
# 1. Clone the repository
git clone <repository-url>
cd chiropractor_fe
# 2. Install dependencies
npm install
# 3. Create environment file (optional)
cp .env.example .env
# 4. Configure environment (if needed)
# The app auto-detects localhost for development
# Edit .env only if using custom API endpoint
# 5. Start development server
npm run dev
# 6. Open your browser
# Visit: http://localhost:5173The application will automatically connect to your backend API at http://localhost:3000/api/v1/2025.
After starting the app:
- Register a new account or login with existing credentials
- Complete your profile with required information
- Explore features based on your role (Patient/Doctor/Admin)
# Start with hot-reload
npm run dev
# The app will be available at:
# - Local: http://localhost:5173
# - Network: http://[your-ip]:5173# Create optimized production build
npm run build
# Preview production build locally
npm run preview
# Build output will be in ./dist directory# Build and sync Android app
npm run mobile:android
# This will:
# 1. Build the web app
# 2. Copy to Capacitor Android project
# 3. Open Android Studio# Build and sync iOS app
npm run mobile:ios
# This will:
# 1. Build the web app
# 2. Copy to Capacitor iOS project
# 3. Open Xcode# Start electron in development
npm run electron:dev
# Build desktop apps
npm run dist # All platforms
npm run dist:win # Windows
npm run dist:mac # macOS
npm run dist:linux # LinuxThe app automatically detects the environment and connects to the appropriate API:
Development (localhost):
http://localhost:3000/api/v1/2025
Staging:
http://staging.drdieuphanchiropractor.com/api/v1/2025
Production:
https://api.drdieuphanchiropractor.com/api/v1/2025
Create .env file for custom settings:
# API Environment (development, staging, production)
VITE_API_ENVIRONMENT=development
# Google OAuth (optional)
VITE_GOOGLE_CLIENT_ID=your-google-client-id
# Feature Flags
VITE_ENABLE_ANALYTICS=false
VITE_ENABLE_PWA=trueThe app intelligently determines the API URL:
- Uses
VITE_API_ENVIRONMENTif set - Detects
stagingsubdomain - Falls back to
localhostfor development - Uses production URL otherwise
chiropractor_fe/
βββ src/
β βββ main.jsx # Application entry point
β βββ App.jsx # Root component with routing
β βββ api/ # API integration layer
β β βββ config/
β β β βββ config.js # API URLs and configuration
β β βββ core/
β β β βββ baseApi.js # Base API client with interceptors
β β β βββ tokenManager.js # JWT token management
β β βββ index.js
β βββ components/ # Reusable React components
β β βββ auth/ # Authentication components
β β βββ ui/ # shadcn/ui components
β β βββ forms/ # Form components
β β βββ chat/ # Chat components
β β βββ ...
β βββ pages/ # Page components (routes)
β β βββ Dashboard/
β β βββ Appointments/
β β βββ Patients/
β β βββ Chat/
β β βββ Profile/
β β βββ ...
β βββ layouts/ # Layout components
β β βββ MainLayout.jsx
β β βββ AuthLayout.jsx
β β βββ ...
β βββ features/ # Feature-based modules
β β βββ appointments/
β β βββ patients/
β β βββ chat/
β β βββ ...
β βββ store/ # Redux store configuration
β β βββ index.js
β β βββ slices/
β βββ routes/ # Route definitions
β β βββ index.jsx
β βββ hooks/ # Custom React hooks
β β βββ useAuth.js
β β βββ useNotification.js
β β βββ ...
β βββ utils/ # Utility functions
β β βββ validators.js
β β βββ formatters.js
β β βββ ...
β βββ constants/ # Constants and enums
β βββ contexts/ # React contexts
β βββ assets/ # Static assets
β β βββ images/
β β βββ icons/
β β βββ fonts/
β βββ lib/ # Third-party library configs
βββ public/ # Public static files
βββ android/ # Capacitor Android project
βββ ios/ # Capacitor iOS project
βββ test/ # Test files
βββ vite.config.js # Vite configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ capacitor.config.ts # Capacitor configuration
βββ package.json # Dependencies and scripts
- JWT-based authentication with auto-refresh
- Secure token storage
- Role-based access control (Patient, Doctor, Admin)
- OAuth integration (Google)
- Password reset flow
- Session timeout handling
- Token expiration monitoring
- Comprehensive intake forms
- Medical history tracking
- Insurance information
- Emergency contacts
- Document uploads
- Patient search and filtering
- Visual calendar interface
- Doctor availability checking
- Multiple appointment types
- Email/SMS reminders
- Easy rescheduling
- Recurring appointments
- Appointment history
- Doctor-patient messaging
- Conversation history
- Unread message indicators
- Typing indicators
- File attachments
- Message search
- Long-polling for real-time updates
- Patient analytics dashboard
- Treatment history reports
- Export to PDF/CSV
- Custom report generation
- Data visualizations
# Development
npm run dev # Start dev server
npm run build # Production build
npm run preview # Preview production build
npm run lint # Run linting
npm run lint:check # Check without fixing
npm test # Run tests
# Mobile
npm run mobile:build # Build and sync
npm run mobile:android # Open Android Studio
npm run mobile:ios # Open Xcode
# Desktop (Electron)
npm run electron:dev # Dev mode
npm run dist # Build all platforms# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Watch mode
npm run test:watch# Build for production
npm run build
# Deploy dist/ folder to:
# - Vercel
# - Netlify
# - AWS S3 + CloudFront
# - Your hosting providerAndroid:
- Build:
npm run mobile:build - Open Android Studio
- Generate signed APK/Bundle
- Deploy to Google Play Store
iOS:
- Build:
npm run mobile:ios - Open Xcode
- Archive and sign
- Deploy to App Store
Contributions are welcome! Please read our contributing guidelines and submit pull requests.
MIT License - see LICENSE file for details.
- Documentation: This README and inline code comments
- Issues: GitHub Issues
- Email: support@drdieuphanchiropractor.com
- Enhanced mobile app features
- Offline mode support
- Advanced analytics
- Video consultation integration
- Multi-language support
- Accessibility improvements
Built with β€οΈ for Dr. Dieu Phan D.C.