Complete gym management system with facial recognition, member management, subscriptions, payments, and real-time analytics.
Features β’ Tech Stack β’ Installation β’ Usage β’ Structure
- π Full client registration with advanced validation
- π€ Detailed profiles with biometric information
- π Facial recognition for quick and secure check-in
- π Complete membership and subscription history
- π± Contact and payment method management
- π Flexible membership plan management
- π Automatic subscription renewal
- π° Partial and full payment tracking
- π Debt and payment status monitoring
- π Attendance-based rewards system
- π Complete transaction history
- π€ Facial recognition check-in in real-time
- π Detailed attendance reports by hour, day, and week
- π Frequency and attendance pattern analytics
- β° Automatic entry and exit logging
- π« Access control based on subscription status
- π·οΈ Complete product and stock control
- π Automatic low stock and overstock alerts
- π Entry and exit movement logging
- π° Daily sales reports by employee
- π Inventory analysis and valuation
- π Real-time business metrics
- π° Financial analysis and revenue reports
- π₯ Membership statistics and new client tracking
- π Attendance analysis by periods
- π― Customizable and exportable KPIs
- π¨ Modern and responsive design with Tailwind CSS
- β¨ Smooth animations with Framer Motion
- π± Mobile and tablet optimized interface
- β‘ Performance optimized with lazy loading
- π Dark mode ready (coming soon)
- React 18.3 - Modern UI library
- TypeScript 5.9 - Static typing
- Vite 7.1 - Ultra-fast build tool
- Tailwind CSS 3.4 - Utility-first styling
- Framer Motion 12 - Advanced animations
- TanStack Query 5.9 - Server state management
- React Query Persist - Cache persistence
- React Hook Form 7.6 - Performant forms
- Zod 4.1 - Schema validation
- React Router 6.3 - Declarative navigation
- Protected Routes - Authentication and authorization
- Lucide React - Modern and consistent icons
- Custom components - Own UI component library
- Vitest 4.0 - Fast testing framework
- React Testing Library - Component testing
- JSDOM - Testing environment
- ESLint 9 - Code linting
- TypeScript ESLint - TypeScript rules
- PostCSS - CSS processing
- Node.js >= 18.0.0
- npm >= 9.0.0 (or yarn/pnpm)
- Git to clone the repository
git clone <repository-url>
cd frontendnpm installCreate a .env file in the project root:
# API Configuration
VITE_API_BASE_URL=http://localhost:8000/api/v1
# Authentication
VITE_DISABLE_AUTH=false
# Development
VITE_USE_MOCK_API=true # Use mock API in developmentnpm run devThe application will be available at http://localhost:5173
# Development
npm run dev # Start development server with hot reload
# Build
npm run build # Create production build
npm run preview # Preview production build
# Testing
npm run test # Run tests once
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
npm run test:ui # Open Vitest UI (auto port)
npm run test:ui:port # Open Vitest UI on port 3001
# Code Quality
npm run lint # Run ESLint
npm run typecheck # Verify TypeScript types- Landing Page:
/- Landing page with system information - Login:
/login- User authentication - Dashboard:
/dashboard- Main panel (requires authentication) - Clients:
/dashboard#clients- Member management - Attendances:
/dashboard#attendances- Attendance control - Inventory:
/dashboard#inventory- Product management
frontend/
βββ public/ # Static files
β βββ favicon.svg
β βββ logo.svg
βββ src/
β βββ components/ # Reusable components
β β βββ ui/ # Base components (Button, Input, Card, etc.)
β β βββ auth/ # Authentication components
β β βββ biometrics/ # Facial recognition components
β βββ features/ # Feature-based modules
β β βββ auth/ # Authentication
β β βββ clients/ # Client management
β β βββ subscriptions/# Subscriptions and payments
β β βββ attendances/ # Attendance control
β β βββ inventory/ # Inventory management
β β βββ dashboard/ # Dashboard and analytics
β β βββ rewards/ # Rewards system
β βββ pages/ # Main pages
β βββ shared/ # Shared code
β β βββ api/ # API client
β β βββ hooks/ # Shared hooks
β β βββ lib/ # Libraries (QueryClient, etc.)
β β βββ types/ # Shared types
β β βββ utils/ # Utilities (logger, etc.)
β βββ test/ # Test configuration
β βββ main.tsx # Entry point
βββ .gitignore
βββ eslint.config.js # ESLint configuration
βββ package.json
βββ tailwind.config.js # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
The project is organized by features, where each module contains:
api/- API functions and backend callscomponents/- Module-specific componentshooks/- Custom hooks for reusable logictypes/- TypeScript type definitionsutils/- Utilities and helpersconstants/- Constants and configurations
Uses @/ alias for absolute imports:
import { Button } from '@/components/ui/Button';
import { useAuth } from '@/features/auth';- TanStack Query: For server state (fetching, caching, mutations)
- React Hook Form: For form state
- Local State:
useStatefor simple local state
- β Strict TypeScript with well-defined types
- β ESLint configured with strict rules
- β
No
anytypes (usingunknownwhen necessary) - β Unit and integration tests
- β Conditional logger (development only)
- Primary:
#f60310(PowerGym Red) - Success: Green for successful actions
- Warning: Yellow for warnings
- Error: Red for errors
- Info: Blue for information
- Font Family: Inter (system-ui fallback)
- Sizes: Responsive with Tailwind
Own component library with:
- Buttons with variants and states
- Inputs with visual validation
- Cards with animations
- Badges for status
- Modals and dialogs
- Loading spinners
- Toast notifications
# Tests in watch mode
npm run test:watch
# Tests with coverage
npm run test:coverage
# Visual test interface
npm run test:ui- Unit Tests: For utilities and helpers
- Component Tests: For UI components
- Integration Tests: For hooks and complete flows
The project maintains coverage thresholds:
- Lines: 70%
- Functions: 75%
- Branches: 65%
- Statements: 70%
npm run buildThe build is generated in dist/ ready for deployment.
The project is configured for Netlify with netlify.toml. You just need:
- Connect your repository to Netlify
- Configure environment variables
- Automatic deployment on each push
VITE_API_BASE_URL=https://api.yourdomain.com/api/v1
VITE_DISABLE_AUTH=false- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'feat: Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Commits: Use conventional commits (
feat:,fix:,docs:, etc.) - Branches:
feature/,fix/,refactor/ - TypeScript: Strict types, no
any - ESLint: Pass all rules before commit
This project is licensed under the MIT License - see the LICENSE file for details.