Skip to content

A cutting-edge fitness training platform connecting personal trainers with clients, featuring workout management, interactive timer with voice guidance, and cyberpunk design

License

Notifications You must be signed in to change notification settings

dorigoleopoldocom/personal-trainer-workout-timer

Repository files navigation

πŸ’ͺ Personal Trainer Workout Timer

A cutting-edge, mobile-first fitness training platform that connects personal trainers with their clients in a futuristic, high-tech environment. Built with React, TypeScript, tRPC, and featuring a stunning cyberpunk aesthetic with neon pink and electric cyan accents.

License React TypeScript tRPC

✨ Features

πŸ‘¨β€πŸ« Personal Trainer Features

  • Client Management Dashboard: View and manage all registered clients with detailed profiles
  • Workout Builder: Create custom workouts with multiple phases (warmup, main workout, cooldown)
  • Exercise Management: Add exercises with duration timers or repetition counts
  • Template System: Save workouts as reusable templates and assign them to multiple clients
  • Progress Tracking: Monitor client workout completions and performance metrics

πŸ’ͺ Client Features

  • Enhanced Registration: Complete profile with name, date of birth (auto-calculates age), goals, and equipment
  • Workout Library: View all assigned workouts with detailed previews
  • Interactive Timer: Real-time workout execution with countdown timers and navigation controls
  • Voice Guidance: Hands-free training with text-to-speech announcements for exercises and countdowns
  • Profile Management: Update personal information, goals, and available equipment
  • Progress History: Track workout completions and personal achievements

🎨 Design System

  • Cyberpunk Aesthetic: Deep black background with vibrant neon pink and electric cyan accents
  • Neon Glow Effects: Intense outer glow effects simulating neon signage
  • Mobile-First: Fully responsive design optimized for all devices
  • HUD-Style Elements: Minimalist technical lines and corner brackets
  • Smooth Animations: Polished transitions and hover effects

πŸ› οΈ Technology Stack

Frontend

  • React 19 - Modern UI library with latest features
  • TypeScript - Type-safe development
  • Tailwind CSS 4 - Utility-first styling with custom cyberpunk theme
  • tRPC Client - End-to-end type-safe API calls
  • Wouter - Lightweight routing solution
  • shadcn/ui - Beautiful, accessible component library
  • Web Speech API - Voice synthesis for workout guidance

Backend

  • Node.js - JavaScript runtime
  • Express 4 - Web application framework
  • tRPC 11 - Type-safe API layer
  • Drizzle ORM - TypeScript ORM for database operations
  • MySQL/TiDB - Relational database
  • Manus OAuth - Secure authentication system

Testing & Quality

  • Vitest - Fast unit testing framework
  • TypeScript Strict Mode - Enhanced type checking
  • ESLint - Code quality and consistency

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v22.13.0 or higher)
  • pnpm (v10.4.1 or higher)
  • MySQL or TiDB database instance
  • Git for version control

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/YOUR_USERNAME/personal-trainer-timer.git
cd personal-trainer-timer

2. Install Dependencies

pnpm install

3. Environment Setup

Create a .env file in the root directory with the following variables:

# Database
DATABASE_URL=mysql://user:password@host:port/database

# Authentication (provided by Manus platform)
JWT_SECRET=your-jwt-secret
OAUTH_SERVER_URL=https://api.manus.im
VITE_OAUTH_PORTAL_URL=https://portal.manus.im
VITE_APP_ID=your-app-id

# Owner Information
OWNER_OPEN_ID=your-open-id
OWNER_NAME=Your Name

# API Keys (provided by Manus platform)
BUILT_IN_FORGE_API_URL=https://forge.manus.im
BUILT_IN_FORGE_API_KEY=your-api-key
VITE_FRONTEND_FORGE_API_KEY=your-frontend-api-key
VITE_FRONTEND_FORGE_API_URL=https://forge.manus.im

4. Database Setup

Run database migrations to create all necessary tables:

pnpm db:push

This will create the following tables:

  • users - User accounts with role-based access
  • workouts - Workout definitions
  • workout_phases - Workout phases (warmup, main, cooldown)
  • exercises - Individual exercises
  • workout_templates - Reusable workout templates
  • template_phases - Template phases
  • template_exercises - Template exercises
  • workout_completions - Workout completion records
  • exercise_performance - Exercise performance metrics

5. Start Development Server

pnpm dev

The application will be available at http://localhost:3000

6. Run Tests

pnpm test

πŸ“– Project Structure

personal-trainer-timer/
β”œβ”€β”€ client/                  # Frontend application
β”‚   β”œβ”€β”€ public/             # Static assets
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable UI components
β”‚   β”‚   β”‚   └── ui/        # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ contexts/       # React contexts
β”‚   β”‚   β”œβ”€β”€ hooks/          # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ lib/           # Utility libraries
β”‚   β”‚   β”‚   └── trpc.ts    # tRPC client configuration
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TrainerDashboard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ClientDetail.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ WorkoutBuilder.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TemplateLibrary.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ClientWorkouts.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ClientProfile.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ WorkoutPreview.tsx
β”‚   β”‚   β”‚   └── WorkoutExecution.tsx
β”‚   β”‚   β”œβ”€β”€ App.tsx        # Main app component with routing
β”‚   β”‚   β”œβ”€β”€ main.tsx       # Application entry point
β”‚   β”‚   └── index.css      # Global styles with cyberpunk theme
β”‚   └── index.html         # HTML template
β”œβ”€β”€ server/                 # Backend application
β”‚   β”œβ”€β”€ _core/             # Core server functionality
β”‚   β”‚   β”œβ”€β”€ index.ts       # Server entry point
β”‚   β”‚   β”œβ”€β”€ context.ts     # tRPC context
β”‚   β”‚   β”œβ”€β”€ trpc.ts        # tRPC router configuration
β”‚   β”‚   └── env.ts         # Environment variables
β”‚   β”œβ”€β”€ db.ts              # Database query helpers
β”‚   β”œβ”€β”€ routers.ts         # tRPC API routes
β”‚   └── *.test.ts          # Unit tests
β”œβ”€β”€ drizzle/               # Database schema and migrations
β”‚   └── schema.ts          # Database table definitions
β”œβ”€β”€ shared/                # Shared types and constants
β”œβ”€β”€ package.json           # Project dependencies
β”œβ”€β”€ tsconfig.json          # TypeScript configuration
β”œβ”€β”€ tailwind.config.ts     # Tailwind CSS configuration
β”œβ”€β”€ vite.config.ts         # Vite build configuration
└── drizzle.config.ts      # Drizzle ORM configuration

🎯 User Roles

Personal Trainer

  • Access: /trainer/dashboard
  • Capabilities:
    • View all registered clients
    • Create and edit workouts
    • Manage workout templates
    • Track client progress

Client

  • Access: /client/workouts
  • Capabilities:
    • View assigned workouts
    • Execute workouts with timer
    • Update personal profile
    • Track workout history

πŸ”§ Development

Available Scripts

# Start development server
pnpm dev

# Build for production
pnpm build

# Start production server
pnpm start

# Run tests
pnpm test

# Type checking
pnpm check

# Format code
pnpm format

# Database migrations
pnpm db:push

Adding New Features

  1. Database Changes: Update drizzle/schema.ts and run pnpm db:push
  2. API Endpoints: Add procedures to server/routers.ts
  3. Database Queries: Add helper functions to server/db.ts
  4. Frontend Pages: Create components in client/src/pages/
  5. Routes: Register routes in client/src/App.tsx
  6. Tests: Write tests in server/*.test.ts

πŸ§ͺ Testing

The project uses Vitest for unit testing. Tests cover:

  • Authentication procedures
  • Workout management
  • Template system
  • Client management
  • Progress tracking

Run tests with:

pnpm test

🎨 Customizing the Design

The cyberpunk theme is defined in client/src/index.css. Key color variables:

--background: oklch(0.12 0.02 270);      /* Deep black */
--primary: oklch(0.65 0.28 340);         /* Neon pink */
--accent: oklch(0.75 0.25 200);          /* Electric cyan */
--foreground: oklch(0.98 0.01 300);      /* Bright white */

Modify these values to create your own color scheme while maintaining the neon aesthetic.

πŸ“± Mobile Optimization

The application is built mobile-first with:

  • Responsive grid layouts
  • Touch-friendly controls
  • Optimized font sizes
  • Smooth animations
  • Voice guidance for hands-free operation

πŸ”’ Security

  • Authentication: Manus OAuth integration
  • Role-Based Access: Separate permissions for trainers and clients
  • Protected Routes: Server-side validation for all API calls
  • Type Safety: End-to-end TypeScript for runtime safety

πŸš€ Deployment

Manus Platform (Recommended)

The project is optimized for deployment on the Manus platform:

  1. Create a checkpoint: The project is already configured
  2. Click "Publish" in the Manus UI
  3. Your app will be live with automatic SSL and custom domain support

Manual Deployment

  1. Build the application:
pnpm build
  1. Set environment variables on your hosting platform

  2. Start the production server:

pnpm start

πŸ“Š Database Schema

Core Tables

  • users: User accounts with role (trainer/client) and profile information
  • workouts: Workout definitions assigned to clients
  • workout_phases: Phases within workouts (e.g., warmup, main, cooldown)
  • exercises: Individual exercises with type (duration/reps)
  • workout_templates: Reusable workout patterns
  • workout_completions: Workout completion records
  • exercise_performance: Detailed exercise performance metrics

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support

For issues, questions, or suggestions:

πŸ—ΊοΈ Roadmap

  • Email notifications for workout completions
  • Analytics dashboard with progress charts
  • Workout scheduling with calendar integration
  • Exercise video demonstrations
  • Social features and workout sharing
  • Mobile app (React Native)

Built with ❀️ and cutting-edge technology

About

A cutting-edge fitness training platform connecting personal trainers with clients, featuring workout management, interactive timer with voice guidance, and cyberpunk design

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published