MyTrainer is a comprehensive web application that generates personalized training schedules using AI. The app combines intelligent scheduling with automated notifications to help users achieve their fitness and lifestyle goals.
MyTrainer creates customized weekly schedules based on your:
- Personal Goals: Fitness, productivity, wellness, or any lifestyle objectives
- Availability: Work days, free time, and preferred activity times
- Preferences: Activity types, intensity levels, and scheduling preferences
The app then provides:
- AI-Generated Schedules: Personalized weekly plans with specific activities and times
- Smart Notifications: SMS and push notifications to keep you on track
- Flexible Management: Easy schedule adjustments and regeneration options
Start your journey with our beautiful, modern landing page that showcases the app's features and benefits.
Secure login with Google authentication for a seamless user experience.
Answer a few simple questions to help us understand your goals and preferences.
Watch as our AI creates your personalized schedule in real-time.
View and manage your AI-generated weekly schedule with beautiful, organized layouts.
- Personalized Plans: ChatGPT generates schedules tailored to your unique goals and lifestyle
- Smart Adaptation: AI considers your work schedule, preferences, and available time
- Motivation Tips: AI provides personalized tips to help you stay motivated
- Regeneration: Easily regenerate your schedule if you want changes
- Activity Reminders: Notifications 5 minutes before each scheduled activity
- Daily Motivation: Morning motivation messages to start your day right
- Evening Reflection: Evening prompts for progress reflection
- Multiple Channels: SMS notifications via Twilio and push notifications via Firebase
- Customizable: Choose which notification types you want to receive
- Modern Design: Clean, elegant interface with smooth animations
- Responsive: Works perfectly on desktop, tablet, and mobile devices
- Intuitive: Easy-to-use onboarding and schedule management
- Visual Feedback: Beautiful schedule display with pastel colors
- Node.js (v14 or higher)
- OpenAI API key
- Twilio account (for SMS notifications)
- Firebase project (for push notifications)
-
Clone the repository
git clone <repository-url> cd mytrainer
-
Install dependencies
npm install cd server && npm install && cd ..
-
Set up environment variables Create a
.envfile in the project root:# OpenAI API REACT_APP_OPENAI_API_KEY=your_openai_api_key_here # Twilio (SMS notifications) TWILIO_ACCOUNT_SID=your_twilio_account_sid TWILIO_AUTH_TOKEN=your_twilio_auth_token TWILIO_PHONE_NUMBER=+1234567890 # Firebase (Push notifications) REACT_APP_FIREBASE_API_KEY=your_firebase_api_key REACT_APP_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com REACT_APP_FIREBASE_PROJECT_ID=your-project-id REACT_APP_FIREBASE_STORAGE_BUCKET=your-project.appspot.com REACT_APP_FIREBASE_MESSAGING_SENDER_ID=123456789 REACT_APP_FIREBASE_APP_ID=your-app-id REACT_APP_FIREBASE_VAPID_KEY=your_vapid_key_here
-
Start the servers
# Start the notification server (in one terminal) cd server && node notificationServer.js # Start the React app (in another terminal) npm start
-
Open the application Visit
http://localhost:3000in your browser
- Go to OpenAI Platform
- Sign up or log in to your account
- Navigate to "API Keys" in your dashboard
- Create a new API key
- Add the key to your
.envfile
- Create a Twilio account
- Get your Account SID and Auth Token from the dashboard
- Purchase a phone number for SMS capabilities
- Add credentials to your
.envfile
- Create a Firebase project
- Enable Cloud Messaging in project settings
- Generate a VAPID key pair
- Download the service account JSON file
- Save it as
server/firebase-service-account.json - Add Firebase configuration to your
.envfile
- Enter your personal goals and objectives
- Specify your work days and available time
- Choose your preferred activity types and intensity levels
- The AI automatically creates your personalized weekly schedule
- Review the generated activities and times
- Regenerate if you want changes
- Click "Notification Settings" in your schedule
- Enable desired notification types (SMS, push, or both)
- Enter your phone number for SMS notifications
- Grant browser permissions for push notifications
- Receive notifications before each scheduled activity
- Get morning motivation messages
- Reflect on your progress in the evening
- Adjust your schedule as needed
src/App.js- Main application componentsrc/Onboarding.js- User onboarding and data collectionsrc/ScheduleDisplay.js- Schedule display and managementsrc/NotificationSettings.js- Notification configurationsrc/scheduleService.js- OpenAI API integrationsrc/notificationService.js- Frontend notification logic
server/notificationServer.js- Notification scheduling and sending- Handles SMS via Twilio
- Manages push notifications via Firebase
- Schedules automated notifications
- Frontend: React, CSS3, HTML5
- Backend: Node.js, Express
- AI: OpenAI GPT API
- SMS: Twilio
- Push Notifications: Firebase Cloud Messaging
- Styling: Custom CSS with gradients and animations
- Environment Variables: Never commit
.envfiles to version control - API Keys: Keep all API keys secure and private
- User Data: User information is processed securely
- Notifications: User consent required before sending notifications
- Rate Limiting: Implemented to prevent abuse
- Each schedule generation typically costs a few cents
- Monitor usage in your OpenAI dashboard
- Costs based on the number of tokens used
- Free tier: 1,000 SMS/month
- Paid: ~$0.0075 per SMS (varies by country)
- Consider user opt-in rates and frequency
- Free tier: 1 million FCM messages/month
- Paid: $0.50 per million messages
- Very cost-effective for push notifications
API Key Problems
- Verify your
.envfile is in the project root - Check that API keys are correct and active
- Restart the development server after adding keys
Notification Issues
- Verify Twilio credentials and phone number format
- Check Firebase configuration and VAPID key
- Ensure browser permissions are granted
- Check server logs for error messages
Server Connection
- Verify notification server is running on port 3001
- Check CORS configuration
- Ensure all environment variables are set













