This application allows a training provider to offer their services online. It consists of a FastAPI backend and a Vue.js frontend. Potential customers can browse available trainings, view training dates, and book training sessions.
The application is built using:
- Backend: FastAPI with MongoDB for data storage
- Frontend: Vue 3 with Vite and Vuetify 3 for UI components
It provides the following functionalities:
-
Trainings Management
- Overview of all offered trainings (name, description, price, instructor, duration and max participants)
- Display of all trainings in a specific time period
- Creating, updating, and deleting trainings
-
Training Dates Management
- Display of all dates for a specific training
- Creating, updating, and deleting training dates
-
Bookings Management
- Booking a training on a specific date
- Viewing, updating, and cancelling bookings
GET /api/v1/trainings- Get a list of all trainingsGET /api/v1/trainings/time-period- Get trainings available in a specific time periodPOST /api/v1/trainings- Create a new trainingPUT /api/v1/trainings- Update an existing trainingDELETE /api/v1/trainings/{id}- Delete a training
GET /api/v1/training-dates- Get a list of all training datesGET /api/v1/training-dates?training_id={id}- Get all dates for a specific trainingPOST /api/v1/training-dates- Create a new training datePUT /api/v1/training-dates- Update an existing training dateDELETE /api/v1/training-dates/{id}- Delete a training date
GET /api/v1/bookings- Get a list of all bookings (admin only)GET /api/v1/bookings?customer_email={email}- Get bookings for a specific customerPOST /api/v1/bookings- Create a new booking (public endpoint)PUT /api/v1/bookings- Update an existing bookingDELETE /api/v1/bookings/{id}- Delete a booking
- Home: Landing page with featured trainings
- Trainings: List of all trainings with filtering options
- Training Details: Detailed information about a training and its available dates
- Booking Form: Form to book a training on a specific date
- My Bookings: List of user's bookings with management options
- Login: Authentication page for users
Most endpoints require authentication using JWT tokens. The following roles are available:
- Admin: Can manage all trainings, training dates, and bookings
- User: Can view trainings and training dates, and manage their own bookings
{
"name": "Python Programming",
"description": "Learn Python programming from scratch",
"price": 299.99,
"instructor": "John Doe",
"duration_hours": 16,
"max_participants": 10
}{
"training_id": "60d21b4667d0d8992e610c85",
"start_date": "2023-06-15T09:00:00Z",
"end_date": "2023-06-16T17:00:00Z",
"location": "Online",
"available_slots": 10
}{
"training_date_id": "60d21b4667d0d8992e610c86",
"customer_name": "Jane Smith",
"customer_email": "jane@example.com",
"customer_phone": "+1234567890",
"notes": "Special dietary requirements"
}The easiest way to run the application is using Docker Compose:
docker-compose up --buildThis will start:
- The backend API at http://localhost:8000
- The frontend application at http://localhost:3000
- MongoDB database
- Redis cache
-
Install Python dependencies:
pip install -r requirements.txt
-
Set up environment variables (see
.env.example) -
Run the FastAPI application:
uvicorn main:app --host 0.0.0.0 --port 8000
-
Access the API documentation at http://localhost:8000/api/docs
-
Navigate to the frontend directory:
cd frontend -
Install Node.js dependencies:
npm install
-
Run the development server:
npm run dev
-
Access the frontend application at http://localhost:3000