A beautiful, minimalist web application that automatically finds and schedules workout time slots in your Google Calendar. Built with Next.js, TypeScript, and Tailwind CSS.
- 🔐 Google OAuth Authentication - Secure login with your Google account
- 📅 Smart Calendar Integration - Automatically scans your Google Calendar for available time slots
- ⏰ Flexible Scheduling - Choose between 15-minute or 30-minute workout sessions
- 🎯 Customizable Preferences - Set your preferred workout times and timezone
- 🎨 Beautiful UI - Clean, minimalist design with smooth animations
- 📱 Responsive Design - Works perfectly on desktop and mobile devices
- Sign in with your Google account
- Set preferences for your preferred workout times and duration
- Find available slots by scanning your calendar for gaps
- Schedule workouts with a single click
Before you begin, ensure you have the following installed:
- Node.js 18+
- npm or yarn
- A Google Cloud Console project with Calendar API enabled
git clone <your-repo-url>
cd fitness-gap
npm install- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API
- Go to "Credentials" and create an OAuth 2.0 Client ID
- Add
http://localhost:3000/api/auth/callback/googleto authorized redirect URIs - Copy your Client ID and Client Secret
Create a .env file in the root directory:
# Google OAuth Configuration
GOOGLE_CLIENT_ID=your_google_client_id_here
GOOGLE_CLIENT_SECRET=your_google_client_secret_here
# NextAuth Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret_here
# Database (for user preferences)
DATABASE_URL="file:./dev.db"Important: Replace the placeholder values with your actual credentials:
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETfrom your Google Cloud ConsoleNEXTAUTH_SECRET- generate a random string (you can useopenssl rand -base64 32)
npx prisma generate
npx prisma migrate devnpm run devOpen http://localhost:3000 to see the application.
fitness-gap/
├── src/
│ ├── app/
│ │ ├── api/
│ │ │ ├── auth/[...nextauth]/ # NextAuth configuration
│ │ │ ├── calendar/ # Calendar API endpoints
│ │ │ └── preferences/ # User preferences API
│ │ ├── globals.css # Global styles
│ │ ├── layout.tsx # Root layout
│ │ └── page.tsx # Main page
│ ├── components/
│ │ ├── Dashboard.tsx # Main dashboard component
│ │ └── Preferences.tsx # User preferences component
│ └── lib/
│ ├── calendar.ts # Google Calendar service
│ ├── prisma.ts # Prisma client
│ └── session-provider.tsx # NextAuth session provider
├── prisma/
│ └── schema.prisma # Database schema
└── .env # Environment variables
POST /api/calendar/slots- Find available time slotsPOST /api/calendar/schedule- Schedule a workoutGET /api/preferences- Get user preferencesPOST /api/preferences- Save user preferences
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- NextAuth.js - Authentication for Next.js
- Prisma - Database ORM
- SQLite - Local database
- Google Calendar API - Calendar integration
- Lucide React - Beautiful icons
- Fork the repository
- Create a 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.
If you encounter any issues or have questions, please open an issue on GitHub.