The Golf Booking Platform is an automated tee time reservation system designed to help golfers secure highly competitive tee times at popular golf courses. The platform handles the entire booking process from user registration to automated booking execution at precisely the right moment when tee times become available.
- 🏌️ Automated tee time booking at exact release times
- 🕒 Smart scheduling system with retry capabilities
- 📱 Modern, responsive web interface
- 🔐 Secure user authentication and authorization
- 📊 Booking analytics and success rate tracking
- 📧 Real-time booking notifications
graph TD
A[Tee Time Portal] -->|REST| B[Tee Time Core API]
A -->|REST| C[Tee Time Scheduler]
C -->|REST| B
B -->|Selenium| D[Golf Course Websites]
B -->|PostgreSQL| E[(Database)]
C -->|PostgreSQL| F[(Database)]
The platform consists of three main services:
-
Tee Time Core API
- Java Spring Boot application
- Handles user management and direct bookings
- Implements Selenium-based booking automation
-
Tee Time Scheduler
- Spring-based scheduling service
- Manages automated booking attempts
- Provides retry and monitoring capabilities
-
Tee Time Portal
- React-based web application
- Modern, responsive user interface
- Real-time booking status updates
- Java 17+
- Node.js 18+
- PostgreSQL 14+
- Supabase
- Docker (optional)
# Clone the repository
git clone https://github.com/your-org/golf-booking.git
# Start databases
docker-compose up -d postgres # using supabase so no need to start postgres
# Start Core API
cd tee-time-core
./mvnw spring-boot:run
# Start Scheduler
cd ../tee-time-scheduler
./mvnw spring-boot:run
# Start Portal
cd ../tee-time-portal
npm install
npm run dev
The Tee Time Core API allows users to manage tee time reservations with functionalities to register, log in, make bookings, and manage existing reservations.
The Tee Time Core service is a Java Springboot application using the Spring framework. It will leverage selenium for webscraping and is built as a multi-module maven project.
Endpoint: POST /register
Description: Register a new user by providing their details.
Request Body:
{
"username": "string",
"password": "string",
"email": "string",
"golfNZMemberId": "string",
"golfNZPassword": "string"
}
Responses:
- 201: User successfully created
- 400: Invalid input
- 401: Unauthorized, invalid token
- 409: User already exists
- 500: Internal server error
Endpoint: POST /login
Description: Log in a user with their credentials.
Request Body:
{
"username": "string",
"password": "string"
}
Responses:
- 200: User successfully logged in
- 400: Invalid input
- 401: Unauthorized, invalid credentials
- 500: Internal server error
Endpoint: POST /logout
Description: Logs out the currently authenticated user session.
Responses:
- 200: User successfully logged out
- 401: Unauthorized, invalid token
- 500: Internal server error
Endpoint: POST /makeBooking
Description: Create a new tee time booking.
Request Body:
{
"date": "YYYY-MM-DD",
"time": "HH:MM",
"course": "string",
"players": "integer"
}
Responses:
- 201: Booking successfully created
- 400: Invalid input
- 401: Unauthorized, invalid token
- 500: Internal server error
Endpoint: GET /getBookings
Description: Retrieve all bookings for the current user.
Responses:
- 200: List of bookings successfully retrieved
- 401: Unauthorized, invalid token
- 500: Internal server error
Endpoint: PUT /modifyBooking
Description: Update details of an existing booking.
Request Body:
{
"date": "YYYY-MM-DD",
"time": "HH:MM",
"course": "string",
"players": "integer"
}
Responses:
- 200: Booking successfully modified
- 400: Invalid input
- 401: Unauthorized, invalid token
- 500: Internal server error
Endpoint: DELETE /deleteBooking
Description: Delete an existing booking.
Request Body:
{
"date": "YYYY-MM-DD",
"time": "HH:MM",
"course": "string",
"players": "integer"
}
Responses:
- 200: Booking successfully deleted
- 400: Invalid input
- 401: Unauthorized, invalid token
- 500: Internal server error
The API uses the following error structure for all unexpected conditions:
{
"code": "integer",
"message": "string"
}
The Tee Time Scheduler Service is a Spring-based scheduling service that executes booking requests through the Tee Time Core API at precise times. This service is designed to handle automated booking attempts when courses release their tee times, ensuring the best possible chance of securing desired tee times.
The scheduler implements the following error handling strategies:
- Retry logic for failed API calls
- Logging of all attempts and responses
- Status tracking for each booking attempt
- User notifications for both success and failure cases
The service tracks:
- Number of scheduled bookings
- Success/failure rates
- API response times
- Retry attempts
- System performance metrics
This design provides a focused solution for executing API calls at specific times while maintaining reliability and monitoring capabilities.
[Previous API and Scheduler Documentation Remains The Same...]
The Tee Time Portal is a React-based web application that provides users with a modern interface to interact with the Tee Time booking platform. It integrates with both the Core API and Scheduler Service to provide a seamless booking experience.
- Framework: React 18
- Build Tool: Vite
- State Management: Redux Toolkit
- Styling: Tailwind CSS
- Component Library: shadcn/ui
- Type Safety: TypeScript
- Testing: Vitest + React Testing Library
- API Client: Axios
- Form Handling: React Hook Form + Zod
src/
├── components/
│ ├── common/
│ │ ├── Button/
│ │ ├── Card/
│ │ ├── Input/
│ │ └── Layout/
│ ├── booking/
│ │ ├── BookingCalendar/
│ │ ├── CourseSelector/
│ │ ├── PlayerSelector/
│ │ └── TimeSelector/
│ └── scheduler/
│ ├── ScheduleForm/
│ └── ScheduleList/
├── features/
│ ├── auth/
│ ├── booking/
│ └── scheduler/
├── hooks/
├── services/
│ ├── api/
│ └── scheduler/
├── store/
├── types/
└── utils/
- Secure login/registration flow
- JWT token management
- Remember me functionality
- Password reset flow
- Profile management
- Interactive calendar for date selection
- Real-time course availability checking
- Player count selection
- Time slot visualization
- Booking confirmation flow
- Schedule future booking attempts
- View scheduled booking status
- Cancel scheduled bookings
- Booking attempt history
- Success/failure notifications
- Course information display
- Favorite courses
- Course release time information
- Historical booking success rates
- Node.js 18+
- npm or yarn
- Git
# Clone the repository
git clone https://github.com/your-org/tee-time-platform.git
# Navigate to frontend directory
cd tee-time-platform/frontend
# Install dependencies
npm install
# Start development server
npm run dev
{
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"lint": "eslint src --ext .ts,.tsx",
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
}
}
- Components tested in isolation
- Redux reducers and actions
- Utility functions
- Custom hooks
- User flows
- API integration
- State management integration
- Critical user journeys
- Cross-browser compatibility
- Mobile responsiveness
- Type checking (TypeScript)
- Lint checking
- Test execution
- Asset optimization
- Bundle generation
The CI/CD pipeline is yet to be implemented.
The CI/CD pipeline is configured to automatically build and deploy the application on every commit to the main branch. The pipeline includes:
- Linting
- Unit tests
- Integration tests
- E2E tests
- Build artifacts generation
- Deployment to staging/production environments
- Monitoring and alerting
- Code splitting
- Lazy loading of routes
- Image optimization
- Caching strategies
- Bundle size monitoring
- WCAG 2.1 compliance
- Keyboard navigation
- Screen reader support
- Color contrast compliance
- Focus management
- CSRF protection
- XSS prevention
- Secure storage of sensitive data
- Input validation
- Authentication token management
This documentation provides a comprehensive overview of the Tee Time Portal frontend service. It covers the technical architecture, development workflow, and key considerations for building and maintaining the application.