Skip to content

shlawgathon/ICBG

Repository files navigation

πŸŽ… ICBG - Intercontinental Ballistic Gifts

Santa's logistics operations platform for global gift delivery

Overview

ICBG is a full-stack application that combines an interactive 3D globe interface with AI-powered gift recommendations to help Santa efficiently dispatch gifts to households worldwide. The platform identifies addresses within user-selected areas, intelligently pairs appropriate gifts using AI, and manages the entire order lifecycle.

Features

  • 🌍 Interactive Globe Interface - Draw polygons on a 3D globe to select delivery areas
  • 🏠 Real-time Address Identification - Fetch building addresses from OpenStreetMap Overpass API
  • πŸ€– AI-Powered Gift Pairing - Intelligent gift recommendations based on household metadata (powered by Grok-4)
  • πŸ“§ Email Notifications - Festive delivery notifications via AgentMail MCP server
  • πŸ›’ Automated Purchasing - Direct product purchasing via Shopping Agent MCP server
  • πŸ“¦ Order Management - Create, track, and export delivery batches
  • 🎨 Festive Dark Theme - Holiday-themed UI with shadcn/ui components

Tech Stack

Layer Technology Version
Framework Next.js 16.0.10
Language TypeScript 5.7.x
Runtime Node.js 22.x LTS
UI Library React 19.x
Database Convex 1.17.x
UI Components shadcn/ui latest
Styling Tailwind CSS 4.x
Mapping Mapbox GL JS 3.17.0
Map React react-map-gl 8.1.x
Geospatial @turf/turf 7.3.1
AI/MCP dedalus-labs 0.1.0-alpha.8
Data Fetching @tanstack/react-query 5.62.x
Icons lucide-react 0.468.x

Getting Started

Prerequisites

  • Node.js 22.x LTS
  • npm or pnpm
  • Mapbox account (for access token)
  • Convex account (for database)
  • Dedalus Labs API key (for AI features)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/ICBG.git
cd ICBG
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env.local

Edit .env.local with your API keys:

# Mapbox access token for globe visualization
NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=pk.xxx

# Convex deployment URL (auto-populated by `npx convex dev`)
NEXT_PUBLIC_CONVEX_URL=https://xxx.convex.cloud

# Dedalus Labs API key for AI gift pairing and MCP server access
DEDALUS_API_KEY=sk-xxx
  1. Initialize Convex:
npx convex dev

This will:

  • Create a new Convex project
  • Deploy the schema and functions
  • Populate NEXT_PUBLIC_CONVEX_URL in .env.local
  1. Start the development servers:
npm run dev

The app will be available at http://localhost:3000.

Project Structure

icbg/
β”œβ”€β”€ app/                    # Next.js App Router pages
β”‚   β”œβ”€β”€ api/               # API route handlers
β”‚   β”‚   β”œβ”€β”€ addresses/     # Address identification (Overpass API)
β”‚   β”‚   β”œβ”€β”€ catalog/       # Product catalog browsing
β”‚   β”‚   β”œβ”€β”€ gifts/         # AI gift pairing
β”‚   β”‚   β”œβ”€β”€ notifications/ # Email notifications (AgentMail MCP)
β”‚   β”‚   └── orders/        # Order export & purchase (Shopping Agent MCP)
β”‚   β”œβ”€β”€ orders/            # Order history page (SSR with Convex)
β”‚   └── page.tsx           # Main mission control
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ ui/               # shadcn/ui components
β”‚   β”œβ”€β”€ GlobeMap/         # Map, markers, and drawing components
β”‚   β”œβ”€β”€ ControlPanel/     # Sidebar workflow controls
β”‚   └── OrderHistory/     # Order batch management
β”œβ”€β”€ convex/               # Convex database
β”‚   β”œβ”€β”€ schema.ts         # Database schema (batches, orders, selections)
β”‚   β”œβ”€β”€ orderBatches.ts   # Batch CRUD operations
β”‚   β”œβ”€β”€ orders.ts         # Order CRUD operations
β”‚   └── addressSelections.ts # Selection history
β”œβ”€β”€ lib/                  # Utility libraries
β”‚   β”œβ”€β”€ types.ts          # TypeScript type definitions
β”‚   β”œβ”€β”€ overpass.ts       # OSM Overpass API client
β”‚   β”œβ”€β”€ dedalus.ts        # Dedalus SDK (AI + MCP orchestration)
β”‚   β”œβ”€β”€ agentmail.ts      # Email notification helpers
β”‚   β”œβ”€β”€ mapbox.ts         # Mapbox GL configuration
β”‚   └── utils.ts          # General utilities
└── data/
    └── catalog.json      # Product catalog (20 items, 5 categories)

Usage

Mission Control Flow

  1. Select Area - Click "Select Area" (or press D) and draw a polygon on the globe
  2. Review Addresses - View identified addresses with household metadata
  3. Pair Gifts - Use AI or manual strategy to assign gifts
  4. Send Notifications - (Optional) Send festive delivery emails
  5. Buy Products - (Optional) Automated purchasing via Shopping Agent MCP
  6. Confirm Orders - Create batch in database
  7. Export - Download CSV/JSON manifest

Keyboard Shortcuts

Key Action
D Toggle drawing mode
Escape Exit drawing mode

Gift Pairing Strategies

Strategy Description
ai-recommended AI-powered pairing using household metadata (default)
round-robin Cycles through products in catalog order
single-product Assigns the same product to all addresses

API Endpoints

Endpoint Method Description
/api/addresses/identify POST Identify addresses in polygon
/api/gifts/pair POST Pair gifts with addresses
/api/notifications/send POST Send delivery emails
/api/orders/export GET Export orders as CSV/JSON
/api/orders/purchase POST Purchase products via Shopping Agent MCP
/api/catalog GET Browse product catalog

MCP Server Integrations

The application leverages the following MCP (Model Context Protocol) servers via Dedalus Labs:

MCP Server Purpose
vroom08/agentmail-mcp Send festive delivery notification emails
dw820/shopping-agent-mcp Automated product purchasing and order processing

AI Model

Gift pairing and agent orchestration use the xai/grok-4-fast-non-reasoning model via the Dedalus Labs SDK.

Development

# Run development servers (Next.js + Convex in parallel)
npm run dev

# Type check
npm run type-check

# Lint
npm run lint

# Format code with Prettier
npm run format

# Build for production
npm run build

# Deploy Convex to production
npm run convex:deploy

License

MIT License - see LICENSE for details.

Acknowledgments

  • OpenStreetMap contributors for address data
  • Mapbox for the globe visualization
  • Dedalus Labs for AI/MCP integration
  • shadcn for the beautiful UI components

πŸŽ„ Built with ❀️ for the Holiday Season 2025

About

Intercontinental Ballistic Gifts (ICBG)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors