Skip to content

Project Overview

UberLotto v2 is a headless online lottery platform built with Shopify Hydrogen and React Router v7. It uses Shopify's Storefront and Customer Account APIs for commerce, Supabase for database and transaction management, and Plisio + MoonPay for cryptocurrency payments. The app is deployed as a PWA on Shopify Oxygen (Cloudflare Workers).

Tech Stack

LayerTechnology
FrameworkShopify Hydrogen
RoutingReact Router v7 (file-based via @react-router/fs-routes)
Build ToolVite 6 with @tailwindcss/vite
LanguageTypeScript (strict mode)
StylingTailwind CSS v4, Shadcn/ui (New York style), Radix UI, Motion
StateZustand (client), TanStack Query (server cache)
DatabaseSupabase (PostgreSQL) — custom fetch client, no SDK
CommerceShopify Storefront API (GraphQL), Customer Account API
PaymentsPlisio (crypto), MoonPay (fiat-to-crypto on-ramp), Shopify Checkout (credit loading)
AnalyticsPostHog
DeploymentShopify Oxygen (Cloudflare Workers edge runtime)
PWAvite-plugin-pwa with Workbox service worker

Critical Import Rule

ALWAYS use react-router imports

This project uses React Router v7, NOT Remix. All route-related imports must come from react-router.

typescript
// CORRECT
import { useLoaderData, Link, Form, redirect } from 'react-router';
import type { LoaderFunctionArgs, ActionFunctionArgs } from 'react-router';

// INCORRECT — never use these
import { ... } from '@remix-run/react';      // ❌
import { ... } from 'react-router-dom';      // ❌

Path Aliases

The project uses TypeScript path aliases defined in tsconfig.json:

AliasMaps ToUsage
~/*app/*General app imports
@/*./*Project root imports
@components/*app/components/*UI components
@lib/*app/lib/*Core utilities
@utils/*app/utils/*Helper functions
@hooks/*app/hooks/*Custom React hooks
@store/*app/store/*Zustand stores
@graphql/*app/graphql/*GraphQL queries
@services/*app/services/*Business logic services
@sections/*app/components/sections/*Page sections
@skeletons/*app/components/skeletons/*Loading skeletons
@shared-types/*app/shared-types/*Shared type definitions

Common Commands

bash
# Start dev server with GraphQL codegen watch
npm run dev

# Production build
npm run build

# Preview production build locally
npm run preview

# TypeScript type checking
npm run typecheck

# Run ESLint
npm run lint

# Generate GraphQL types from queries
npm run codegen

TIP

All scripts use shopify hydrogen CLI under the hood. Running npm run dev executes shopify hydrogen dev --codegen, which starts the Vite dev server with automatic GraphQL type generation.

UberLotto Technical Documentation