teal-prompt

byYuii

# SYSTEM PROMPT: AI Full-Stack & ML Architect for Group Travel Compromise Engine ## 1. PROJECT OVERVIEW You are an expert Full-Stack Developer and Machine Learning Engineer. I am building a 2-week hybrid web application + ML project that solves group travel deadlock. ### The Core Problem: Planning trips with friends/family fails because schedules, budgets, and interests clash, causing endless WhatsApp group chat debates. ### The Solution: 1. An Organizer sets a destination & dates baseline. 2. The system sends an SMS/WhatsApp link (via Twilio/Webhooks) to friends. 3. Friends fill out a zero-login 30-second web form (available dates, budget limits, interests, pace). 4. A Machine Learning Pipeline (Python/FastAPI) calculates date overlaps, clusters places geographically (DBSCAN), and optimizes a multi-constraint itinerary balancing budget and happiness (Genetic Algorithm / Multi-Criteria Scoring). 5. Generative AI (LLM) takes the mathematically optimized JSON output and turns it into 2-3 readable, friendly "Compromise Itineraries" for the group to vote on. --- ## 2. TECHNICAL STACK REQUIREMENTS - **Frontend:** Next.js 14 (App Router), React, Tailwind CSS, Shadcn UI components. - **Database & Auth:** Supabase (PostgreSQL with Realtime capabilities). - **ML Backend:** Python 3.11 with FastAPI, `scikit-learn`, `pandas`, `numpy`, `spacy` (or `transformers`). - **External APIs:** Google Places API (for place details/photos) and Twilio API (for SMS invites). - **LLM Integration:** OpenAI API (GPT-4o) using `response_format: { type: "json_object" }` for structured outputs. --- ## 3. REQUIRED DELIVERABLES TO GENERATE Please generate the following core artifacts sequentially, ensuring production-level quality and detailed code: ### DELIVERABLE 1: DATABASE SCHEMA (Supabase / PostgreSQL) Provide clean SQL scripts to create tables with foreign keys and Row Level Security (RLS) policies for: - `users` (organizers) - `trips` (destination, base dates, invite links) - `participants` (name, phone_number, availability_dates, max_budget, pace, interests) - `places` (cached Google Places data: name, rating, price_level, lat, lng, categories) - `itineraries` (generated plans, vote count, final locked plan) ### DELIVERABLE 2: PYTHON ML SERVICE (`ml_engine.py` & FastAPI) Write a Python FastAPI service with two primary endpoints: 1. `POST /api/ml/match-dates`: Accepts an array of participant available date arrays and returns the exact overlapping dates and the highest-coverage window. 2. `POST /api/ml/optimize-itinerary`: - Takes participant preference profiles and candidate POIs. - Calculates a **Group Preference Score** using Cosine Similarity between user interest vectors and POI tags. - Uses **DBSCAN** or **K-Means Clustering** on location coordinates (`lat`, `lng`) to cluster attractions into morning/afternoon geographic zones. - Applies a multi-constraint compromise function ensuring the total day cost stays below the minimum specified budget in the group. ### DELIVERABLE 3: NEXT.JS FRONTEND ARCHITECTURE Provide the structure and component code for: 1. `app/trip/create/page.tsx`: Organizer form to set trip destination and invite phone numbers via Twilio. 2. `app/join/[tripId]/page.tsx`: Zero-auth friend response form (date picker matrix, budget slider, interest tagging). 3. `app/trip/[tripId]/dashboard/page.tsx`: Real-time dashboard displaying: - Date Overlap Matrix - 3 Compromise Itinerary Cards (Generated by the ML + LLM pipeline) - Anonymous voting buttons for the group ### DELIVERABLE 4: LLM SYSTEM PROMPT & STRUCTURED JSON SCHEMAS Write the system prompt and JSON Schema used to convert the raw output from the Python ML clustering script into a human-readable trip summary. --- ## 4. INSTRUCTIONS FOR EXECUTION - Keep code clean, modular, and fully functional. Do not use pseudo-code or placeholder comments like `// implement later`. - Prioritize low-friction UX (friends should not have to register or create accounts to submit preferences). - Provide step-by-step instructions on how to set up the project locally. Let's start with **DELIVERABLE 1: DATABASE SCHEMA** and **DELIVERABLE 2: PYTHON ML SERVICE**.

LandingParticipant Response PageAuthenticationTrip Creation PageTrip Dashboard Page
Landing

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 6

System Requirements Document for teal-prompt

1. Introduction

The purpose of this document is to outline the system requirements for the "teal-prompt" project, a web application designed to facilitate group travel planning by streamlining itinerary creation and decision-making among group members.

2. System Overview

Page 2 of 6

2a. Product Interpretation and Delivery Boundary

  • Domain Descriptor: Group Travel Planning

    • Source Evidence: User request for developing a website for group travel planning.
    • Confidence: 0.9
  • Product Being Built: A web application for group travel planning, focusing on itinerary creation and decision-making among group members.

  • Excluded Conventional Assumptions: The application will not include conventional modules such as dashboards, portals, or admin panels unless explicitly stated.

  • First-Party Custom Pages:

    • Landing Page: Serves as the public entry surface for anonymous orientation.
    • Authentication Page: Provides identity access for persistent identity management.
    • Trip Creation Page: Allows organizers to set up new trips, including destination and dates, and generate invite links.
    • Participant Response Page: Enables participants to submit availability, budget, and interests without login.
    • Trip Dashboard Page: Displays itinerary options, overlap matrix, and voting for organizers and participants.
  • Access: Application-owned identity is required for persistent workflows.

  • Behavior Contracts:

    • Setup Trip: Organizer sets up a new trip with destination and dates, generating an invite link.
    • Submit Preferences: Participant submits preferences via an invite link.
    • Generate Itineraries: Organizer requests itinerary generation based on participant preferences.
Page 3 of 6

2b. Source Content Inventory

Not applicable as no explicit content_source directive was provided.

3. Functional Requirements as Story Points

  • As an Organizer, I should be able to set up a new trip with destination and dates to generate an invite link. explicit
  • As a Participant, I should be able to submit my availability, budget, and interests via an invite link without needing to log in. explicit
  • As an Organizer, I should be able to view generated compromise itineraries and vote on them with the group. explicit
  • As a Participant, I should be able to view itinerary options and vote on them. explicit
  • As an Organizer, I should be able to request itinerary generation based on participant preferences. explicit

4. User Personas

  • Organizer: Sets up the trip and invites participants.
  • Participant: Provides preferences and votes on itineraries.

5. Core User Flows

Organizer Flow

  1. Access the Landing Page.
  2. Navigate to the Authentication Page to log in.
  3. Proceed to the Trip Creation Page to set up a new trip.
  4. Generate an invite link and share it with participants.
  5. Access the Trip Dashboard Page to view itinerary options and vote.
Page 4 of 6

Participant Flow

  1. Receive an invite link.
  2. Access the Participant Response Page via the invite link.
  3. Submit availability, budget, and interests.
  4. View itinerary options and vote on them.

6. Visuals Colors and Theme

  • Primary: #007BFF
  • Primary Light: #66B2FF
  • Secondary: #6C757D
  • Accent: #28A745
  • Highlight: #FFC107
  • Background: #FFFFFF
  • Surface: #F8F9FA
  • Text: #212529
  • Text Muted: #6C757D
  • Border: #DEE2E6
Page 5 of 6

7. Signature Design Concept

The design concept for the teal-prompt project will focus on a clean, user-friendly interface that emphasizes ease of use and accessibility. The Landing Page will feature a welcoming hero section with a brief introduction to the service and a call-to-action button leading to the Authentication Page. The Trip Creation Page will have a structured form layout for easy input of trip details, while the Participant Response Page will offer a simple, intuitive interface for submitting preferences. The Trip Dashboard Page will present itinerary options in a visually appealing card format, with clear voting buttons for participants.

8. Interaction Model & Motion Direction

  • Landing Page: Animated with moderate scroll-triggered reveals and hover transitions.
  • Authentication Page: Static for clarity and ease of use.
  • Trip Creation Page: Static with clear form inputs.
  • Participant Response Page: Static with intuitive form elements.
  • Trip Dashboard Page: Animated with interactive elements for voting.

9. Non-Functional Requirements

No additional non-functional requirements were inferred.

Page 6 of 6

10. Tech Stack

  • Frontend: Next.js 14, React, Tailwind CSS, Shadcn UI components.
  • Backend: Python 3.11, FastAPI.
  • Database: Supabase (PostgreSQL with Realtime capabilities).
  • External APIs: Google Places API, Twilio API.
  • LLM Integration: OpenAI API (GPT-4o).

11. Assumptions and Constraints

  • The application will require persistent identity for organizers.
  • Participants will not need to create accounts to submit preferences.
  • The application will use external APIs for place details and SMS invites.

12. Glossary

  • Organizer: A user who sets up a trip and manages participant invitations.
  • Participant: A user who submits preferences and votes on itineraries.
  • Trip Creation Page: A page where organizers set up trip details.
  • Participant Response Page: A page where participants submit their preferences.
  • Trip Dashboard Page: A page displaying itinerary options and voting mechanisms.
Landing design preview
Landing: Anonymous visitor views landing page
Authentication: Organizer logs in
Trip Creation Page: 1. Organizer enters destination and dates
Trip Creation Page: 2. Process: Setup Trip executes
Trip Creation Page: 3. Failure: Trip setup failed
Trip Dashboard Page: 1. Organizer views itinerary options and overlap matrix
Trip Dashboard Page: 2. Process: Generate Itineraries executes
Trip Dashboard Page: 3. Failure: Itinerary generation failed
Landing design preview
Landing: Anonymous visitor views landing page
Authentication: Organizer logs in
Trip Creation Page: 1. Organizer enters destination and dates
Trip Creation Page: 2. Process: Setup Trip executes
Trip Creation Page: 3. Failure: Trip setup failed
Trip Dashboard Page: 1. Organizer views itinerary options and overlap matrix
Trip Dashboard Page: 2. Process: Generate Itineraries executes
Trip Dashboard Page: 3. Failure: Itinerary generation failed