Project Management Plan - SagnikSaha01/CSC510-002-4 GitHub Wiki

Restaurant Swipe App — Project Management Plan

1. Project Overview

Goal:
Develop an app where users can swipe left or right on nearby restaurants to discover new dining options. When users accept a restaurant, they can browse its menu and order dishes for delivery.

Core Features:

  • Swipe-based restaurant discovery interface
  • Personalized restaurant recommendations based on user history
  • Restaurant detail pages (menu, reviews, and basic info)
  • Google Sign-In authentication for user accounts
  • Ordering and checkout flow for selected restaurants

2. Project Scope

Component Description
Frontend Interactive swiping interface, restaurant browsing, and ordering experience
Backend Stores user, restaurant, and dish data; handles recommendations and orders
Recommendation Engine Adapts to user preferences based on swipe history and past orders
Integration Uses Google Authentication for sign-in and possibly mock delivery integration

3. System Architecture Overview

Note: The specific technologies are to be finalized. The section below defines the general system requirements so the exact implementation stack can be substituted easily.

Frontend:

  • Needs to support mobile-friendly UI with swipe gestures
  • Communicates with backend through a REST API or GraphQL
  • Should include a secure authentication flow (Google Sign-In)
  • Stores minimal local user data (session, preferences cache)

Backend:

  • Provides API endpoints for user, restaurant, and order data
  • Handles Google OAuth2 authentication verification
  • Maintains a data model for users, restaurants, and dishes
  • Includes a recommendation service that adapts to swipe behavior

Database:

  • Must support flexible data structures for restaurants and menus
  • Should allow quick reads/writes and efficient query filtering by tags and preferences

Hosting / Deployment:

  • Must support quick deployment for demo (cloud-based or local container setup)
  • Should allow easy updates and integration with frontend

4. Data Model Design

User (auth.users)

Note: User authentication is managed by Supabase Auth. The backend does not directly query or manipulate this table. User information is handled through Supabase authentication flows.

Field Type Description
UID UUID Primary key (Supabase Auth managed)
Display name String User's display name (from authentication provider)
Email String User's email address
Phone String User's phone number (optional)
Providers String Authentication provider (e.g., "Google", "Email")
Provider type String Type of provider (e.g., "Social", "Email")
Created at Timestamptz Account creation timestamp
Last sign in at Timestamptz Last sign-in timestamp

Restaurant

Field Type Description
id UUID Primary key
name Text Restaurant name (required)
address Text Restaurant location
banner_image_url Text URL to restaurant banner image
created_at Timestamptz Record creation timestamp

Menu_Item

Field Type Description
id UUID Primary key
restaurant_id UUID Foreign key → restaurants.id
name Text Name of the dish
description Text Description of the dish
category Text Dish category (e.g., "Appetizer", "Main", "Dessert")
price Numeric Dish price
image_url Text URL to dish image
created_at Timestamptz Record creation timestamp

Cart_Item

Field Type Description
id UUID Primary key
user_id UUID Foreign key → auth.users.id
menu_item_id UUID Foreign key → menu_items.id
quantity Int4 Quantity of the menu item in cart

Relationships

  • auth.users → cart_items: One-to-many (user_id)
  • restaurants → menu_items: One-to-many (restaurant_id)
  • menu_items → cart_items: One-to-many (menu_item_id)

API Endpoints

Restaurant Endpoints


GET /api/restaurants

Get all restaurants from the database.

Query Parameters:
None

Response:

[
  {
    "id": "uuid",
    "name": "string",
    "address": "string",
    "banner_image_url": "string",
    "created_at": "timestamp"
  }
]

Status Codes:

  • 200 — Success
  • 404 — No restaurants found
  • 500 — Server error

GET /api/restaurant/:restaurant_id

Get a single restaurant with its menu items.

Path Parameters: restaurant_id (UUID, required) — The restaurant's unique identifier

Response:

{
  "id": "uuid",
  "name": "string",
  "address": "string",
  "banner_image_url": "string",
  "created_at": "timestamp",
  "menu_items": [
    {
      "id": "uuid",
      "restaurant_id": "uuid",
      "name": "string",
      "description": "string",
      "category": "string",
      "price": number,
      "image_url": "string",
      "created_at": "timestamp"
    }
  ]
}

Status Codes:

  • 200 — Success
  • 404 — Restaurant not found
  • 500 — Server error

POST /api/restaurants

Create a new restaurant with optional menu items.

Request Body:

{
  "name": "string (required)",
  "address": "string",
  "banner_image_url": "string",
  "menu_items": [
    {
      "name": "string",
      "description": "string",
      "category": "string",
      "price": number,
      "image_url": "string"
    }
  ]
}

Response:

{
  "id": "uuid",
  "name": "string",
  "address": "string",
  "banner_image_url": "string",
  "created_at": "timestamp",
  "menu_items": [...]
}

Status Codes:

  • 201 — Created
  • 400 — Bad Request (missing required fields)
  • 500 — Server error

Notes: Includes automatic rollback logic if menu items fail to save after restaurant creation. The created_at timestamp is automatically set by Supabase.


AI Service Endpoints


POST /api/recommendations

Get AI-powered restaurant or dish recommendations based on a user's mood.

Request Body:

{
  "mood": "string (required)"
}

Response:

{
  "recommendations": [
    {
      "id": number,
      "title": "string",
      "description": "string",
      "image": "string (full URL)",
      "price": number,
      "distance": number,
      "rating": number,
      "category": "string"
    }
  ]
}

Status Codes:

  • 200 — Success
  • 400 — Bad Request (missing mood)
  • 404 — No restaurants available
  • 500 — Server error

Notes: Uses OpenAI GPT-4o-mini model to analyze mood. Returns 8–10 personalized dish recommendations. AI considers comfort foods, healthy options, and adventurous choices. Temperature: 0.7, Max tokens: 2000


Cart Endpoints


POST /api/cart

Add an item to the cart or update quantity if it already exists (upsert operation).

Request Body:

{
  "user_id": "uuid (required)",
  "menu_item_id": "uuid (required)",
  "quantity": number (default: 1)
}

Response:

{
  "id": "uuid",
  "user_id": "uuid",
  "menu_item_id": "uuid",
  "quantity": number
}

Status Codes:

  • 201 — Created or Updated
  • 400 — Bad Request (missing required fields)
  • 500 — Server error

Notes: If quantity < 1, the item is automatically removed from the cart. Uses upsert with conflict resolution on (user_id, menu_item_id).


GET /api/cart

Get all items in a user's cart with detailed menu item information.

Query Parameters: user_id (UUID, required) — The user's unique identifier

Response:

[
  {
    "id": "uuid",
    "quantity": number,
    "menu_items": {
      "id": "uuid",
      "name": "string",
      "price": number,
      "image_url": "string",
      "restaurant_id": "uuid"
    }
  }
]

Status Codes:

  • 200 — Success
  • 400 — Missing user_id parameter
  • 500 — Server error

DELETE /api/cart/items/:menu_item_id

Remove a specific item from a user's cart.

Path Parameters: menu_item_id (UUID, required) — The menu item to remove

Query Parameters: user_id (UUID, required) — The user's unique identifier

Response: Empty (No Content)

Status Codes:

  • 204 — Success (No Content)
  • 400 — Missing user_id parameter
  • 404 — Item not found in cart
  • 500 — Server error

5. Development Phases & Timeline (1 Week Plan)

Phase Duration Key Deliverables
Day 1: Planning & Design 1 day Finalize requirements, mockups, data models, and API routes
Day 2–3: Backend Setup 2 days Implement user/restaurant APIs, Google Auth integration, and mock data
Day 3–5: Frontend Development 3 days Build swiping UI, restaurant cards, and API connection
Day 6: Recommendation Logic 1 day Implement basic preference-based filtering algorithm
Day 7: Testing & Polishing 1 day Integration testing, bug fixes, and demo preparation

6. Team Roles (4 Developers)

Role Responsibilities
Developer 1 (Team Lead) Oversee project timeline, manage API integration, and coordinate tasks
Developer 2 (Frontend Lead) Implement swiping UI, Google Sign-In, and restaurant details page
Developer 3 (Backend Lead) Build database schema, authentication flow, and REST endpoints
Developer 4 (Recommendation & QA) Implement preference logic, test features, and ensure data flow integrity

7. Risks and Mitigation

Risk Impact Mitigation Strategy
Short timeframe Limited feature completion Focus on core MVP (swiping + basic recommendations)
Authentication issues Users unable to log in Use proven Google Auth SDKs and test early
API/DB integration delays Broken data flow Use mock data during early frontend dev
Recommendation inaccuracies Poor user experience Implement simple rule-based filtering first
UI responsiveness issues Lower engagement Prioritize mobile-friendly design and minimal animations

8. Tools and Workflow

Category Tools / Options
Version Control GitHub
Task Management Trello / Notion
Design Figma
API Testing Postman
Deployment Local Docker / Cloud Service (Firebase, AWS, or Render)
Communication Slack / Discord

9. Success Metrics

  • Working MVP demonstrating:
    • Swipe-based restaurant browsing
    • Working Google Sign-In
    • Basic preference-based recommendations
    • Functional order flow (mock delivery acceptable)
  • Minimal critical bugs during testing
  • Usable demo for stakeholders within 1 week

10. Future Enhancements

  • Improved ML-based recommendation system
  • Social features (friends, shared restaurant lists)
  • Push notifications for new restaurants or deals
  • Restaurant admin dashboard for menu management
  • Integration with real delivery APIs

11. Deliverables Summary

  • Functional prototype demonstrating end-to-end flow
  • Documented API routes and data models
  • Project report summarizing architecture and recommendations
  • Presentation/demo to showcase MVP