Skip to content

Commit 87514bd

Browse files
authored
Merge pull request #25 from Bruno-366/copilot/fix-16
Refactor monolithic App.tsx into focused components for better maintainability
2 parents a4aedda + 0d50286 commit 87514bd

File tree

10 files changed

+1048
-751
lines changed

10 files changed

+1048
-751
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 62 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Unbroken
22

3-
A modern React application built with TypeScript and Vite, ready for deployment on Cloudflare Pages.
3+
**Tactical Barbell Tracker** - A modern React application for tracking strength training, cardio workouts, and training blocks following the Tactical Barbell methodology. Built with TypeScript and Vite, ready for deployment on Cloudflare Pages.
4+
5+
## πŸ“‹ Features
6+
7+
- **Training Block Management**: Organize workouts into structured training blocks (Endurance, Powerbuilding, Strength, Bodybuilding)
8+
- **Comprehensive Workout Tracking**: Support for strength, hypertrophy, LISS cardio, HIIT, rest, and deload workouts
9+
- **Exercise Database**: Track 1RM and 10RM personal records with automatic weight calculations
10+
- **Smart Warm-up Sets**: Automatically calculated warm-up progressions for strength workouts
11+
- **Rest Timer**: Built-in timer with notifications and extend options
12+
- **Workout History**: Complete tracking of all completed workouts
13+
- **Drag & Drop Planning**: Reorder training blocks with intuitive drag-and-drop interface
14+
- **Responsive Design**: Works seamlessly on desktop and mobile devices
415

516
## πŸš€ Quick Start
617

@@ -40,11 +51,12 @@ A modern React application built with TypeScript and Vite, ready for deployment
4051

4152
## πŸ—οΈ Tech Stack
4253

43-
- **React 18** - UI library
44-
- **TypeScript** - Type safety
45-
- **Vite** - Build tool and dev server
46-
- **Tailwind CSS** - Utility-first CSS framework
47-
- **ESLint** - Code linting
54+
- **React 18** - UI library with hooks for state management
55+
- **TypeScript** - Type safety and enhanced developer experience
56+
- **Vite** - Build tool and dev server with hot module replacement
57+
- **Tailwind CSS** - Utility-first CSS framework for responsive design
58+
- **ESLint** - Code linting and quality enforcement
59+
- **Tactical Barbell Methodology** - Structured training approach for strength and conditioning
4860

4961
## 🌐 Deployment on Cloudflare Pages
5062

@@ -93,23 +105,42 @@ A modern React application built with TypeScript and Vite, ready for deployment
93105

94106
```
95107
Unbroken/
96-
β”œβ”€β”€ public/ # Static assets
97-
β”œβ”€β”€ src/ # Source code
98-
β”‚ β”œβ”€β”€ App.tsx # Main App component
99-
β”‚ β”œβ”€β”€ main.tsx # Entry point
100-
β”‚ └── index.css # Global styles with Tailwind CSS
101-
β”œβ”€β”€ .github/ # GitHub Actions workflows
102-
β”œβ”€β”€ dist/ # Build output (generated)
103-
β”œβ”€β”€ index.html # HTML template
104-
β”œβ”€β”€ package.json # Dependencies and scripts
105-
β”œβ”€β”€ tsconfig.json # TypeScript configuration
106-
β”œβ”€β”€ vite.config.ts # Vite configuration
107-
β”œβ”€β”€ wrangler.jsonc # Cloudflare Pages configuration
108-
β”œβ”€β”€ tailwind.config.js # Tailwind CSS configuration
109-
β”œβ”€β”€ postcss.config.js # PostCSS configuration
110-
└── .eslintrc.cjs # ESLint configuration
108+
β”œβ”€β”€ public/ # Static assets
109+
β”œβ”€β”€ src/ # Source code
110+
β”‚ β”œβ”€β”€ components/ # React components (refactored from monolithic App.tsx)
111+
β”‚ β”‚ β”œβ”€β”€ CardioWorkouts.tsx # LISS and HIIT workout rendering
112+
β”‚ β”‚ β”œβ”€β”€ StrengthWorkouts.tsx # Strength/hypertrophy workouts with warm-up sets
113+
β”‚ β”‚ β”œβ”€β”€ RestWorkouts.tsx # Rest and deload workout rendering
114+
β”‚ β”‚ β”œβ”€β”€ History.tsx # Workout history display
115+
β”‚ β”‚ β”œβ”€β”€ TrainingPlan.tsx # Training blocks drag & drop management
116+
β”‚ β”‚ └── ExerciseDatabase.tsx # 1RM and 10RM exercise input management
117+
β”‚ β”œβ”€β”€ App.tsx # Main App component (reduced from 1,066 to 373 lines)
118+
β”‚ β”œβ”€β”€ types.ts # Centralized TypeScript interfaces and types
119+
β”‚ β”œβ”€β”€ utils.ts # Shared utility functions (weight calculations, notifications)
120+
β”‚ β”œβ”€β”€ blockTemplates.ts # Training block templates and configurations
121+
β”‚ β”œβ”€β”€ main.tsx # Entry point
122+
β”‚ └── index.css # Global styles with Tailwind CSS
123+
β”œβ”€β”€ .github/ # GitHub Actions workflows
124+
β”œβ”€β”€ dist/ # Build output (generated)
125+
β”œβ”€β”€ index.html # HTML template
126+
β”œβ”€β”€ package.json # Dependencies and scripts
127+
β”œβ”€β”€ tsconfig.json # TypeScript configuration
128+
β”œβ”€β”€ vite.config.ts # Vite configuration
129+
β”œβ”€β”€ wrangler.jsonc # Cloudflare Pages configuration
130+
β”œβ”€β”€ tailwind.config.js # Tailwind CSS configuration
131+
β”œβ”€β”€ postcss.config.js # PostCSS configuration
132+
└── .eslintrc.cjs # ESLint configuration
111133
```
112134

135+
### Component Architecture
136+
137+
The application has been refactored from a monolithic structure into focused, maintainable components:
138+
139+
- **Separation of Concerns**: Each component handles a specific aspect of functionality
140+
- **Type Safety**: Comprehensive TypeScript interfaces ensure code reliability
141+
- **Reusability**: Components are designed to be easily testable and modifiable
142+
- **Maintainability**: Reduced complexity makes debugging and feature additions simpler
143+
113144
## 🚨 CI/CD
114145

115146
The repository includes GitHub Actions workflow that runs on every push and pull request:
@@ -134,12 +165,18 @@ The repository includes GitHub Actions workflow that runs on every push and pull
134165
# Example: Add a UI library (compatible with Tailwind)
135166
npm install @headlessui/react @heroicons/react
136167

137-
# Example: Add routing
168+
# Example: Add routing (for multi-page functionality)
138169
npm install react-router-dom
139170
npm install --save-dev @types/react-router-dom
140171

141-
# Example: Add form handling
172+
# Example: Add form handling and validation
142173
npm install react-hook-form @hookform/resolvers zod
174+
175+
# Example: Add state management (if needed for larger scale)
176+
npm install zustand
177+
178+
# Example: Add date/time utilities
179+
npm install date-fns
143180
```
144181

145182
### Tailwind CSS Customization
@@ -158,6 +195,8 @@ Create `.env` files for different environments:
158195
- [React Documentation](https://react.dev/)
159196
- [Cloudflare Pages Documentation](https://developers.cloudflare.com/pages/)
160197
- [TypeScript Documentation](https://www.typescriptlang.org/)
198+
- [Tailwind CSS Documentation](https://tailwindcss.com/)
199+
- [Tactical Barbell Official](https://www.tacticalbarbell.com/) - Learn about the training methodology
161200

162201
## 🀝 Contributing
163202

0 commit comments

Comments
Β (0)