Skip to content

Repository files navigation

⌨️ KeyWatch

The zero-maintenance, serverless tracker and collection manager for custom mechanical keyboard enthusiasts.

Next.js TypeScript Tailwind CSS Supabase Zero Maintenance License


🌟 Overview

KeyWatch is an ultra-low-maintenance, serverless web app designed to organize the chaotic lifecycle of custom mechanical keyboard collecting. From tracking multi-month Interest Checks (IC) and Group Buys (GB) across disparate vendors, to monitoring wishlist keywords and managing keyboard inventory valuation, KeyWatch keeps everything in a sleek, dark-themed command center.

🛡️ Zero-Maintenance Architecture

  • No Cron Jobs / No Long-Running Daemons: Automated background scrapers/cron jobs are paused by default to prevent failed executions, IP blocking, and unexpected compute billing.
  • Serverless & Scale-to-Zero: Runs entirely on free-tier friendly serverless infrastructure (Vercel + Supabase).
  • PostgreSQL Row Level Security (RLS): Data integrity and user isolation are handled entirely in PostgreSQL with zero backend middleware maintenance.

✨ Key Features

  • 🛒 Group Buy Lifecycle Tracking: Manage GBs and ICs through each phase (ic ➔ gb ➔ shipping ➔ delivered ➔ closed) with estimated ship dates and vendor notes.
  • 🔔 Market Radar & Keyword Alerts: Set keyword monitors to log and search aftermarket listings (MechMarket, Geekhack) on demand.
  • 📦 Collection & Portfolio Valuation: Catalog your keyboards, switches, and artisan keycaps, tracking acquisition cost vs. estimated secondary market value.
  • 🔄 Restock Tracking: Keep track of out-of-stock items and storefront restock statuses.
  • 🔒 Secure Authentication & Row Level Security (RLS): User-isolated data storage enforced at the PostgreSQL database level via Supabase Auth and RLS policies.
  • ⚡ Real-time Notifications: In-app alert feeds and notification badges for newly matched aftermarket deals and GB status updates.
  • 💳 Tiered Memberships: Scalable architecture prepared for monetization (Free, Enthusiast, Collector tiers) powered by Dodo Payments.

🛠️ Tech Stack

  • Framework: Next.js 14 (App Router & Server Components)
  • Language: TypeScript
  • Styling: Tailwind CSS & Lucide React Icons
  • Backend & Database: Supabase (PostgreSQL, Auth, Row Level Security)
  • Payments: Dodo Payments (Optional webhook-based billing)
  • Deployment: Vercel (Scale-to-zero serverless platform)

🗄️ Database Architecture

KeyWatch uses PostgreSQL hosted on Supabase with strict Row-Level Security (RLS).

erDiagram
    USERS ||--o| PROFILES : has
    USERS ||--o{ TRACKED_GBS : tracks
    USERS ||--o{ ALERT_KEYWORDS : configures
    USERS ||--o{ ALERT_HITS : receives
    USERS ||--o{ COLLECTION_ITEMS : owns
    USERS ||--o{ RESTOCK_WATCHES : watches
    USERS ||--o{ NOTIFICATIONS : gets

    ALERT_KEYWORDS ||--o{ ALERT_HITS : generates
Loading

Core Entities:

  • profiles: User subscription plan (free, enthusiast, collector) and profile metadata with auto-provisioning trigger on signup.
  • tracked_gbs: Group buy items, vendors, timeline status, and expected ship dates.
  • alert_keywords: Subscribed keywords, target scrapers/sources, and toggle status.
  • alert_hits: Incoming matching items, source URLs, price detection, and read state.
  • collection_items: User personal inventory, purchase price, current market valuation, and condition rating.
  • restock_watches: Vendor URLs tracked for inventory status changes.
  • notifications: User notification inbox for hits, restocks, and delivery updates.

🚀 Getting Started

1. Clone the Repository

git clone https://github.com/ParitoshSrivastava31/KeyWatch.git
cd KeyWatch

2. Install Dependencies

npm install

3. Configure Supabase

  1. Create a project at supabase.com.
  2. Navigate to the SQL Editor in your Supabase dashboard.
  3. Run the migrations located in:
    • supabase/migrations/001_initial.sql
    • supabase/migrations/002_profile_trigger.sql

4. Setup Environment Variables

Copy the example environment file and fill in your keys:

cp .env.example .env.local

Edit .env.local:

NEXT_PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key

# Optional Integrations
DODO_PAYMENTS_SECRET_KEY=
DODO_WEBHOOK_SECRET=

5. Run Development Server

npm run dev

Open http://localhost:3000 with your browser.


☁️ Vercel Deployment

KeyWatch is designed for zero-maintenance deployment on Vercel with zero ongoing upkeep.

Deploy with Vercel

Steps for Deployment:

  1. Push your repository to GitHub.
  2. Import the repository into your Vercel Dashboard.
  3. Add the Environment Variables in Vercel project settings:
    • NEXT_PUBLIC_SUPABASE_URL
    • NEXT_PUBLIC_SUPABASE_ANON_KEY
    • SUPABASE_SERVICE_ROLE_KEY
  4. Click Deploy.
  5. Update your Site URL & Redirect URLs in your Supabase Dashboard (Authentication -> URL Configuration) to include your Vercel deployment domain (e.g. https://your-keywatch-app.vercel.app/**).

📂 Project Structure

KeyWatch/
├── app/
│   ├── (auth)/                # Authentication routes (login, signup)
│   ├── dashboard/             # Protected dashboard application
│   │   ├── alerts/            # Keyword alerts feed & manager
│   │   ├── collection/        # Keyboard inventory & valuation
│   │   ├── settings/          # Account settings & subscription
│   │   ├── tracker/           # Group Buy lifecycle kanban/list
│   │   ├── layout.tsx         # Persistent sidebar & dashboard layout
│   │   └── page.tsx           # Dashboard home & analytics overview
│   ├── api/
│   │   ├── alerts/send/       # Alert dispatch endpoints
│   │   ├── scraper/trigger/   # Paused/on-demand trigger endpoints
│   │   └── webhooks/dodo/     # Dodo Payments billing webhooks
│   ├── globals.css            # Global CSS & Tailwind styling
│   ├── layout.tsx             # Root layout with font definitions
│   └── page.tsx               # Landing page
├── components/
│   ├── alerts/                # Alert keyword & hit cards
│   ├── collection/            # Collection items & stats components
│   ├── dashboard/             # Dashboard widgets & user profile
│   ├── tracker/               # Group Buy status & progress bars
│   └── ui/                    # Reusable UI library (buttons, cards, badges)
├── lib/
│   ├── dodo/                  # Dodo Payments SDK integration
│   ├── scraper/               # Scraper utilities
│   ├── supabase/              # Supabase client (browser, server, middleware)
│   └── utils/                 # General helper utilities
├── supabase/
│   └── migrations/            # PostgreSQL schemas, RLS, and triggers
├── types/                     # TypeScript interfaces and database schemas
├── middleware.ts              # Route protection & Supabase session handling
├── tailwind.config.ts         # Tailwind design tokens
└── tsconfig.json              # TypeScript configuration

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Zero-maintenance, serverless group buy tracker, aftermarket radar, and collection valuation dashboard for custom mechanical keyboard enthusiasts. Built with Next.js 14 & Supabase.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages