Tech Stack
The application is built on a modern JavaScript stack optimized for cross-platform mobile development:Frontend Framework
- React 19.1.0 - Core UI framework
- Ionic React 8.6.4 - Mobile-optimized UI components and native capabilities
- Vite 7.0.4 - Fast build tool and development server
- React Router DOM 5.3.4 - Client-side routing
Mobile Development
- Capacitor 7.4.2 - Native runtime for deploying to iOS and Android
- Capacitor Android 7.4.2 - Android platform support
UI Libraries
- Bootstrap 5.3.7 - CSS framework
- React Bootstrap 2.10.10 - Bootstrap components for React
- Ionicons 8.0.13 - Icon library
Data Visualization & Forms
- FullCalendar 6.1.18 - Calendar component for daily records
- Recharts 3.7.0 - Charts and statistics visualization
- React Hook Form 7.61.1 - Form validation and management
Communication
- Axios 1.10.0 - HTTP client for API calls
- STOMP.js 7.1.1 - WebSocket messaging protocol
- SockJS Client 1.6.1 - WebSocket fallback support
Project Structure
The application follows a well-organized directory structure:Application Architecture
Layered Architecture
CicloVital follows a layered architecture pattern:-
Presentation Layer (
pages/,components/)- Page components for each route
- Reusable UI components
- Ionic UI framework integration
-
Business Logic Layer (
hooks/,contexts/)- Custom hooks encapsulating business logic
- Context providers for global state management
- Form validation and data transformation
-
Data Access Layer (
services/)- API service modules
- HTTP request handling
- Error handling and response formatting
Data Flow
The application implements a unidirectional data flow:- User interactions trigger component events
- Custom hooks process business logic and call services
- Services make API requests using Axios
- Contexts update global state
- Local storage persists critical data (user, theme, chat)
- Components re-render with updated data
Key Features
Authentication & User Management
- User registration and login (see
src/hooks/useAuth.js:7) - Persistent sessions via localStorage
- Context-based user state management
AI-Powered Chat
- Real-time messaging with WebSocket support
- Multiple chat sessions management
- Chat history persistence
Wellness Tracking
- Daily record creation and management
- Calendar visualization of wellness data
- Metrics: sleep hours, exercise, energy, mood, motivation
Analytics Dashboard
- Statistics visualization with charts
- Wellness trend analysis
- Historical data review
Configuration
Build Configuration
The project uses Vite for building and development:Mobile Configuration
Development Workflow
Available Scripts
npm run dev- Start development server with Vitenpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
Environment Variables
The application uses environment-based API URL configuration:Next Steps
- Learn about the Frontend Architecture
- Explore Component Architecture
