padelio / PROMPTS.md
obaes's picture
Upload 5 files
b67033d verified

A newer version of the Gradio SDK is available: 6.13.0

Upgrade

Project Build Prompts

This file documents the prompts used to build the Padel Court Booking application.

  1. Initial Setup

    make me a mcp server in a directory padel, the mcp server is in python and based on gradio, it expose 3 functions, add booking, remove booking, list booking, all function work with sqlite db locally to get add remove booling entry
    
  2. Corrections & Virtual Environment

    correct the errors
    
  3. Add Court ID and Player Names

    to book a padel you need also a court id, and not just one player name but 4 in total
    
  4. Database and Validation Corrections

    correct the errors
    
  5. UI Design

    make a nice padel design over the front
    
  6. Booking Logic and Validation

    before adding a booking check if the court is available and check the date is in the future. a booking has a end time, note that a booking duration is 1h30, booking end time is not an input of add booking, it is automatically calculated and set in db
    
  7. Documentation

    add documentation in the code, add a prompt file in markdown format with all the command i gave you to build the project, add a readme file explaining how to use the project
    
  8. Add Padel Clubs

    add into database padel club with prepopulated french padel club
    
  9. Database Schema Correction

    correct error Database error: table bookings has no column named club_id
    
  10. SQL Export

    add .sql file with database creation sql script with all tables, and prepopulated data
    
  11. Supabase Migration

    instead of local sqlite db do use a supabase database where url is postgresql://postgres:[YOUR-PASSWORD]@db.jzvflgshkmpffbefmvdh.supabase.co:5432/postgres where password is KKdPRh61pgp9uAf4, password should be in a env var exported and loaded from a file at project start
    
  12. Pre-populate Supabase

    add all tables prepopulated to supabase
    
  13. MCP Server

    add mcp extension This Gradio app can also serve as an MCP server, with an MCP tool corresponding to each API endpoint. To enable this, launch this Gradio app with .launch(mcp_server=True) or set the GRADIO_MCP_SERVER env variable to "True".
    
  14. Reservation Number

    add a booking reservation number for each booking  with a 12 char/digit unique number per booking
    
  15. Remove Booking by Reservation Number

    remove booking can be done with a reservation number
    
  16. Performance Tracking

    ajoute une fonction list performance, qui affiche les performances de chacune des  parties réservés et pour lequel les joueurs ont donnée les informations sur les performance de la partie, le résultat des sets, une description generale de la partie, un commentaire sur la perfomance des joueurs
    

Master Prompt

This single prompt encapsulates all the features of the final application.

Create a Python-based padel court booking application in a directory named `padel`. The application should use the Gradio library for the user interface and a Supabase PostgreSQL database for data storage.

The application should have the following features:

1.  **Database:**
    *   A `clubs` table with columns for `club_id` (primary key), `name`, `city`, and `number_of_courts`.
    *   A `bookings` table with columns for `id` (primary key), `reservation_number` (unique), `club_id` (foreign key to `clubs`), `court_id`, `player1`, `player2`, `player3`, `player4`, `date`, `time`, and `end_time`.
    *   A `performances` table with columns for `id` (primary key), `booking_id` (foreign key to `bookings`), `set1_score`, `set2_score`, `set3_score`, `description`, and `player_comments`.
    *   The `clubs` and `bookings` tables should be pre-populated with sample data.

2.  **User Interface (Gradio):**
    *   A "Clubs" tab to display a list of all padel clubs from the database.
    *   A "List Bookings" tab to display all current and upcoming bookings, including the club name, court ID, player names, and start/end times.
    *   An "Add Booking" tab with the following fields:
        *   A dropdown menu to select a club.
        *   A number input for the court ID.
        *   Text inputs for the four player names.
        *   Text inputs for the date and start time of the booking.
    *   A "Remove Booking" tab to remove a booking by its 12-character reservation number.
    *   An "Add Performance" tab to add performance details for a completed match.
    *   A "List Performances" tab to view all recorded match performances.
    *   A professional and modern "padel-themed" design.

3.  **Booking Logic:**
    *   When adding a booking, the system must:
        *   Validate that all fields are filled correctly.
        *   Ensure the selected date and time are in the future.
        *   Check if the selected court at the chosen club is available for the requested time slot.
        *   Automatically calculate the `end_time` as 1 hour and 30 minutes after the start time.
        *   Generate a unique 12-character alphanumeric reservation number for each new booking.
    *   The "List Bookings" view should join the `bookings` and `clubs` tables to display the club's name for each booking.

4.  **MCP Server:**
    *   The Gradio application should be launched with the `mcp_server=True` parameter to expose the booking and performance functions as MCP tools.

5.  **Configuration:**
    *   The Supabase database password should be stored in a `.env` file and loaded as an environment variable.

6.  **Documentation:**
    *   Add comprehensive docstrings and comments to the Python code.
    *   Create a `README.md` file with instructions on how to set up and run the application, including how to use the `database_setup.sql` file.
    *   Create a `database_setup.sql` file with the complete SQL script to create and pre-populate the database.
    *   Create a `PROMPTS.md` file documenting all the prompts used to build the project.