Skip to content

heewonseo7/spaceoverflow

 
 

Repository files navigation

SpaceOverflow

SpaceOverflow Logo

A peer-to-peer storage marketplace for college students. Students with unused space rent out closets, corners, or rooms to students needing temporary storage — at 40-60% below traditional storage unit costs.

Built with Next.js 16, Supabase, Stripe, and an AI-powered Smart Split agent that automatically distributes items across multiple hosts.

Demo

SpaceOverflow Listing Page

Listing marketplace with search and filters

SpaceOverflow Details

Detailed listing view with host information

SpaceOverflow Dashboard

User Profile Page

Features

  • .edu-verified accounts — only students with a valid .edu email (or Google OAuth) can sign up
  • Listing marketplace — search and filter by university, price, space type, availability, and more
  • Multi-step booking — select items, choose insurance tier, review cost breakdown, and pay
  • Stripe payments — Checkout Sessions for renters, Stripe Connect for host payouts
  • Smart Split AI — an agent that splits your items across multiple hosts when no single listing fits
  • Real-time messaging — conversations with typing indicators and read receipts
  • Two-way reviews — 5-star ratings with reliability, communication, and condition sub-scores
  • Push notifications — Web Push alerts for booking updates and new messages
  • Recommendation engine — scored results based on distance, price, and host rating

Tech Stack

Layer Technology
Framework Next.js 16 (App Router), React 19
Language TypeScript
UI Mantine v8, Tailwind CSS v4, Framer Motion
Database & Auth Supabase (PostgreSQL, Auth, Storage, Realtime)
Payments Stripe (Checkout + Connect)
AI Agent Dedalus Labs SDK + MCP servers
Maps Mapbox (geocoding, map preview)
Package Manager pnpm

Getting Started

Prerequisites

Installation

git clone https://github.com/danielryang/spaceoverflow.git
cd spaceoverflow
pnpm install

Configuration

Copy the example env file and fill in your keys:

cp .env.example .env.local

Required variables:

# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

# Stripe
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...

# App URL
NEXT_PUBLIC_APP_URL=http://localhost:3000

See .env.example for all available variables (Dedalus API key, VAPID keys, SMTP, etc.).

Database Setup

  1. Open your Supabase Dashboard → SQL Editor
  2. Run each migration in supabase/migrations/ in filename order
  3. (Optional) Run supabase/seed.sql to insert test data — 4 users, 5 listings, 2 bookings, 2 reviews

Run

pnpm dev

Open http://localhost:3000.

Create a Test User

Supabase requires email confirmation by default. To skip that for local development:

node scripts/create-test-user.mjs
# Or with custom credentials:
node scripts/create-test-user.mjs test@stanford.edu MyPassword "Jane Doe"

Usage

Searching for Storage

# Find listings near Stanford under $100/month
curl "http://localhost:3000/api/listings?university=Stanford&max_price=100"

Getting Recommendations

curl -X POST http://localhost:3000/api/recommendation \
  -H "Content-Type: application/json" \
  -d '{
    "volume_cubic_feet": 45,
    "start_date": "2026-06-15",
    "end_date": "2026-08-15",
    "university": "Stanford"
  }'

Smart Split (AI Agent)

curl -X POST http://localhost:3000/api/agent/storage \
  -H "Content-Type: application/json" \
  -d '{
    "message": "I need storage from 2026-06-01 to 2026-08-31. I have a bike, 3 boxes, and a mini fridge. Find the best plans.",
    "renterId": "your-user-id"
  }'

The agent queries the database, calculates distances, runs bin-packing optimization, and returns 3 plans (Cheapest, Closest, Best Rated). See docs/SMART_SPLITTING_SPEC.md for the full specification.

Project Structure

app/
  api/               API routes (auth, listings, bookings, items, messages,
                     reviews, payments, disputes, recommendation, upload,
                     push, users, agent, stripe)
  auth/              Login, signup, OAuth callback
  checkout/          Checkout flow, success/cancel pages
  host/              Host dashboard (listings, bookings)
  listings/          Browse and listing detail pages
  messages/          Conversations and threads
  profile/           User profile and public profiles
  requests/          Renter booking requests
  smart-split/       AI storage concierge UI

components/          React components organized by feature
  agent/             Smart Split form and plan cards
  booking/           Multi-step booking flow
  home/              Hero, navbar, featured listings
  listings/          Cards, filters, gallery, forms
  mapbox/            Address autocomplete, map preview
  messages/          Conversation UI
  stripe/            Payment form, Connect setup

lib/                 Shared logic
  agent/             Dedalus runner + local tools
  auth/              Auth helpers (requireAuth, requireVerifiedUser)
  supabase/          Client, server, middleware, realtime
  types/             Auto-generated DB types + API types
  utils/             Response helpers, validation, cost calculations

supabase/
  migrations/        Database schema + RLS policies
  seed.sql           Test data

API Overview

The API is organized into these domains:

Domain Base Route Key Operations
Auth /api/auth/* signup, login, logout, me
Listings /api/listings/* search, create, update, delete
Bookings /api/bookings/* create, status updates, split booking
Items /api/items/* CRUD for renter item inventories
Messages /api/messages/* send, list conversations, mark read
Reviews /api/reviews/* create, get by booking/user
Payments /api/payments/* transaction records
Stripe /api/stripe/* payment intents, webhooks, Connect
Recommendation /api/recommendation scored listing suggestions
Smart Split /api/agent/storage AI-powered multi-host booking
Users /api/users/* profile view and update
Disputes /api/disputes/* create, resolve
Upload /api/upload image uploads to Supabase Storage
Push /api/push/* Web Push subscription and test

Database

Core tables:

Table Purpose
users Student profiles (.edu verified, university)
listings Storage spaces (dimensions, price, photos, availability)
item_inventories Items to store (category, dimensions, weight, value)
bookings Transactions linking renters, hosts, and items
payments Payment records with escrow tracking
reviews Two-way ratings with sub-scores
messages In-app messaging with read receipts
disputes Conflict resolution with evidence

Full schema: supabase/migrations/

Scripts

Command Description
pnpm dev Start dev server
pnpm build Production build
pnpm start Start production server
pnpm lint Run ESLint
node scripts/create-test-user.mjs Create a pre-verified test user

Documentation

Help & Support

  • Issues: GitHub Issues
  • Docs: See the Documentation section above
  • Schema: Check supabase/migrations/ for database details and lib/types/ for TypeScript types

License

Private — All Rights Reserved

About

2026 CMU Tartan Hacks Grand Prize Finalist -- top 5 overall

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 91.8%
  • PLpgSQL 6.7%
  • Other 1.5%