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!

Architecture

No Services Diagrams Yet

Architecture diagrams will be automatically generated when the Project Manager creates tasks for your project.

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