A full-stack web application that generates personalized swimming training plans using AI. The application features a React frontend with a modern UI and a Node.js/Express backend integrated with the Google Gemini AI API.
- 🏊♂️ Personalized swimming training plan generation
- 📊 Multi-step form for detailed customization
- 🎯 Goal-based training recommendations
- 💾 Save and manage training plans
- 🎨 Modern, responsive UI with Tailwind CSS
- 🤖 AI-powered workout generation using Google Gemini
- React with TypeScript
- Tailwind CSS for styling
- Vite for build tooling
- React Router for navigation
- Node.js with Express
- TypeScript
- Google Gemini AI API
- Winston for logging
- Node.js (v16 or higher)
- npm or yarn
- Google Gemini API key (Get it from Google AI Studio)
- Clone the repository:
git clone <repository-url>
cd swimming-trainer- Install dependencies:
For the backend:
cd backend
npm installFor the frontend:
cd frontend
npm install- Configure environment variables:
Copy the example environment file and update it with your values:
cd backend
cp .env.example .envUpdate the .env file with your actual values:
PORT=3001
GEMINI_API_KEY=your_gemini_api_key_here
NODE_ENV=developmentNote: The .env file is included in .gitignore to prevent sensitive information from being committed to the repository.
- Start the development servers:
Backend:
cd backend
npm run devFrontend:
cd frontend
npm run devThe frontend will be available at http://localhost:5173
The backend will be running at http://localhost:3001
├── backend/
│ ├── src/
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ ├── utils/ # Utility functions
│ │ └── index.ts # Server entry point
│ ├── logs/ # Application logs
│ └── package.json
│
└── frontend/
├── src/
│ ├── pages/ # Page components
│ ├── components/ # Reusable components
│ ├── api/ # API integration
│ └── main.tsx # App entry point
└── package.json
The following environment variables are required:
PORT- Server port (default: 3001)GEMINI_API_KEY- Your Google Gemini API keyNODE_ENV- Environment mode (development/production)
All environment variables are documented in .env.example
POST /api/trainings- Generate a new training planGET /api/trainings- Get all saved training plansGET /api/trainings/:id- Get a specific training planPOST /api/trainings/save- Save a training planDELETE /api/trainings/:id- Delete a training plan
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for powering the training plan generation
- The swimming community for inspiration and feedback