A centralized web marketplace connecting gyms and personal trainers with clients. Built with Next.js 14, TypeScript, TailwindCSS, and AWS integration.
- Landing Page with advanced search filters (location, cost, availability, rating)
- Gym Listings with detailed pages, contact info, offers, and ratings
- Personal Trainer Listings with profiles, specialties, availability, and ratings
- Offer Feed with card layout supporting both gym and PT offers
- Role-based Authentication with Cognito integration
- Role-based Dashboards for different user types
- Client_User: Anonymous access, login for favorites/rating/reporting
- PT_User: Create personal profile, set availability & cost, manage offers
- Gym_Staff: Register/manage gym, approve PTs, create gym offers
- Admin: Approve reported content, manage subscriptions & ranking priority
- Next.js 14 with App Router
- TypeScript for type safety
- TailwindCSS for styling
- Zustand for global state management
- Axios for API communication
- AWS S3 integration for media handling
- Role-based routing middleware
- Responsive design
βββ app/ # Next.js App Router
β βββ auth/ # Authentication pages
β β βββ login/page.tsx
β β βββ register/page.tsx
β βββ dashboard/ # Role-based dashboards
β β βββ admin/page.tsx
β β βββ gym-staff/page.tsx
β β βββ pt/page.tsx
β β βββ layout.tsx
β βββ gyms/ # Gym pages
β β βββ [id]/page.tsx
β β βββ page.tsx
β βββ trainers/ # Personal trainer pages
β β βββ [id]/page.tsx
β β βββ page.tsx
β βββ offers/ # Offer pages
β β βββ page.tsx
β βββ globals.css
β βββ layout.tsx
β βββ page.tsx # Landing page
β βββ providers.tsx
βββ components/ # Reusable components
β βββ dashboard/ # Dashboard components
β βββ gyms/ # Gym-specific components
β βββ landing/ # Landing page components
β βββ layout/ # Layout components
β βββ offers/ # Offer components
β βββ trainers/ # Trainer components
β βββ ui/ # Base UI components
βββ lib/ # Utilities and configurations
β βββ api.ts # API client with Axios
β βββ aws.ts # AWS S3 integration
β βββ utils.ts # Utility functions
βββ store/ # Zustand stores
β βββ authStore.ts # Authentication state
β βββ searchStore.ts # Search state
β βββ uiStore.ts # UI state
βββ types/ # TypeScript type definitions
β βββ index.ts
βββ middleware.ts # Role-based routing middleware
βββ ...config files
- Node.js 18+
- npm or yarn
- AWS account (for S3 and Cognito)
-
Clone the repository
git clone <repository-url> cd easy-body-frontend
-
Install dependencies
npm install # or yarn install -
Environment Setup
cp env.example .env.local
Update
.env.localwith your configuration:# AWS Configuration NEXT_PUBLIC_AWS_REGION=us-east-1 NEXT_PUBLIC_S3_BUCKET=your-bucket-name AWS_ACCESS_KEY_ID=your-access-key AWS_SECRET_ACCESS_KEY=your-secret-key # API Configuration NEXT_PUBLIC_API_BASE_URL=http://localhost:8080/api # Cognito Configuration NEXT_PUBLIC_COGNITO_USER_POOL_ID=your-user-pool-id NEXT_PUBLIC_COGNITO_CLIENT_ID=your-client-id NEXT_PUBLIC_COGNITO_REGION=us-east-1
-
Run the development server
npm run dev # or yarn dev -
Open your browser Navigate to http://localhost:3000
- Hero section with search functionality
- Advanced search filters
- Featured gyms, trainers, and offers
- How it works section
- Testimonials and CTA
- Location-based search with radius
- Price range filtering
- Rating and availability filters
- Amenities and specialties filtering
- Real-time search results
- Client Dashboard: Bookings, favorites, profile management
- PT Dashboard: Client management, session scheduling, offer creation
- Gym Staff Dashboard: Gym management, trainer approvals, offer management
- Admin Dashboard: Platform oversight, moderation, analytics
- Login/Register pages with form validation
- Role-based access control
- JWT token management
- Social OAuth integration (Google, Facebook)
The frontend is designed to work with a Spring Boot backend. Key API endpoints include:
- Authentication:
/api/auth/* - Gyms:
/api/gyms/* - Trainers:
/api/trainers/* - Offers:
/api/offers/* - Reviews:
/api/reviews/* - Search:
/api/search/* - Admin:
/api/admin/*
- Next.js 14 App Router setup
- TypeScript configuration
- TailwindCSS styling system
- Zustand state management
- Authentication pages (Login/Register)
- Landing page with search filters
- Gym listing and detail pages
- Personal trainer listing and detail pages
- Offer feed with card layout
- Role-based dashboards (Admin, Gym Staff, PT, Client)
- Role-based routing middleware
- API utilities and Axios configuration
- AWS S3 integration for media
- Responsive design
- Component library with reusable UI components
- Connect to actual Spring Boot API
- Implement real Cognito authentication
- Add real-time notifications
- Implement booking system
- Add payment integration
- Set up email notifications
- Add advanced analytics
- Implement real-time chat
The project uses a consistent design system with:
- Primary Colors: Blue-based palette
- Typography: Inter font family
- Components: Reusable UI components with consistent styling
- Layout: Responsive grid system
- Icons: Lucide React icon library
The application is fully responsive and works on:
- Desktop (1024px+)
- Tablet (768px - 1023px)
- Mobile (320px - 767px)
- Role-based access control with Cognito integration
- JWT token authentication with automatic refresh
- Protected routes with middleware
- Input validation and sanitization
- XSS protection
- CSRF protection
- AWS Cognito security features
The frontend is fully integrated with the provided Spring Boot API:
- User signs up/signs in via Cognito
- JWT token is obtained and stored
- User data is synchronized with backend via
/api/v1/auth/register - All API calls include JWT token in Authorization header
- Auth:
/api/v1/auth/register,/api/v1/auth/me - Gyms:
/api/v1/gyms/*,/api/v1/gyms/search - PTs:
/api/v1/pt-users/* - Offers:
/api/v1/offers/*,/api/v1/search/offers - Admin:
/api/v1/admin/* - Media:
/api/v1/media/presigned-url
- Location-based search using PostGIS coordinates
- Advanced filtering by price, rating, availability
- Pagination support for large result sets
- Real-time search with debouncing
The application is ready for deployment on:
- Vercel (recommended for Next.js)
- AWS Amplify
- Netlify
- Any Node.js hosting platform
This project is proprietary software. All rights reserved.
Please follow the established coding standards and component patterns when contributing to this project.
For technical support or questions, please contact the development team.