A comprehensive fitness platform connecting clients, trainers, and sports clubs. The application enables workout planning, progress tracking, client management, payment processing, and business analytics for the fitness industry.
- Frontend: Next.js 15 (React 19, TypeScript, Tailwind CSS, next-intl, next-themes, Heroicons)
- Backend: Next.js API Routes (NextAuth, MongoDB, Mongoose, bcryptjs)
- Database: MongoDB
- Other: Stripe integration, Google OAuth, file uploads, real-time messaging
- Plan and track workouts
- Monitor progress (weight, measurements, goals)
- Manage nutrition
- View workout templates
- Track calendar events
- Participate in community
- Premium subscription (Personal)
- Manage clients
- Create and assign workout plans
- Track client progress
- Generate invoices
- View professional analytics
- Manage calendar and events
- Premium subscription (Professional)
- Manage sports club
- Manage members and staff
- Client portal with announcements
- Business analytics and reports
- Financial management
- Schedule management
- Membership management
- Full access to all features
- Manage users and roles
- System administration
AthletiX/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── api/ # API routes
│ │ │ ├── auth/ # Authentication endpoints
│ │ │ ├── user/ # User endpoints
│ │ │ ├── professional/ # Professional endpoints
│ │ │ ├── business/ # Business endpoints
│ │ │ ├── workouts/ # Workout endpoints
│ │ │ ├── stripe/ # Payment endpoints
│ │ │ └── messaging/ # Messaging endpoints
│ │ ├── auth/ # Auth pages (login, register)
│ │ ├── dashboard/ # Dashboard pages
│ │ └── page.tsx # Home page
│ ├── components/ # React components
│ │ ├── auth/ # Auth components
│ │ ├── dashboard/ # Dashboard components
│ │ ├── community/ # Community components
│ │ └── layout/ # Layout components
│ ├── models/ # Mongoose models
│ │ ├── User.ts # User model
│ │ ├── Workout.ts # Workout model
│ │ ├── Plan.ts # Training plan model
│ │ ├── Message.ts # Message model
│ │ └── ...
│ ├── lib/ # Libraries
│ │ ├── mongodb.ts # MongoDB connection
│ │ ├── mongoose.ts # Mongoose connection
│ │ └── stripe.ts # Stripe configuration
│ ├── containers/ # Page containers
│ ├── hooks/ # Custom React hooks
│ ├── utils/ # Utility functions
│ └── theme/ # Theme configuration
├── messages/ # i18n translations
│ ├── en/ # English translations
│ └── pl/ # Polish translations
├── public/ # Static assets
├── scripts/ # Helper scripts
├── tests/ # Test files
└── package.json
- Node.js >= 18.x
- MongoDB (locally or Atlas)
- Google OAuth account (for login)
- Stripe account (for payments)
-
Clone the repository:
git clone <repository-url> cd AthletiX
-
Install dependencies:
npm install
-
Create a
.envfile in the root directory and fill in the required data:# MongoDB Configuration MONGODB_URI=mongodb://localhost:27017/athletix # Google OAuth Configuration GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret # NextAuth Configuration NEXTAUTH_SECRET=your-secret-key-here-generate-with-openssl-rand-base64-32 # Stripe Configuration STRIPE_SECRET_KEY=sk_test_your-stripe-secret-key STRIPE_WEBHOOK_SECRET=whsec_your-stripe-webhook-secret
-
Generate
NEXTAUTH_SECRET:openssl rand -base64 32
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
- user - Regular client (plan workouts, track progress, manage nutrition, use community features)
- professional - Trainer (manage clients, create plans, generate invoices, view analytics)
- business_owner - Club owner (manage club, members, staff, business analytics)
- admin - Full access to all features and user management
Example main endpoints:
POST /api/auth/register- Register new userPOST /api/auth/[...nextauth]- NextAuth endpoints (login, logout, session)POST /api/auth/add-role- Add role to userPOST /api/auth/update-role- Update user role
GET /api/user/profile- Get user profilePOST /api/user/profile- Update user profileGET /api/user/progress- Get user progress dataPOST /api/user/progress- Update user progressGET /api/user/nutrition- Get nutrition dataPOST /api/user/nutrition- Add nutrition entryGET /api/user/plans- Get user's training plans
GET /api/workouts- List workoutsPOST /api/workouts- Create workoutGET /api/workouts/[id]- Get workout detailsPUT /api/workouts/[id]- Update workoutDELETE /api/workouts/[id]- Delete workoutGET /api/workouts/templates- Get workout templates
GET /api/professional/clients- List clientsGET /api/professional/plans- List training plansGET /api/professional/analytics- Get analytics dataGET /api/professional/invoices- List invoices
GET /api/business- Get business dataPOST /api/business- Create businessGET /api/business/members- List membersGET /api/business/analytics- Get business analyticsGET /api/business/finances- Get financial data
POST /api/stripe/checkout- Create Stripe checkout sessionPOST /api/stripe/webhook- Stripe webhook handlerGET /api/stripe/check-status- Check subscription status
GET /api/messaging/conversations- List conversationsGET /api/messaging/messages- Get messagesPOST /api/messaging/messages- Send messageGET /api/messaging/stream- Real-time messaging stream
More details can be found in the source code in the src/app/api/ directory






