Skip to content

Development and Deployment

Koneko edited this page Jul 29, 2026 · 1 revision

πŸ’» Development & Deployment Manual

This guide provides technical instructions for local environment setup, project structure navigation, build pipelines, Oxlint static analysis, and Cloudflare Pages deployment.


1. Prerequisites & Environment Setup

  • Node.js: v18.0.0 or higher
  • npm: v9.0.0 or higher
  • Git: v2.30.0 or higher

Environment Configuration (.env):

Create a .env file in the root directory if connecting to a custom Supabase instance:

VITE_SUPABASE_URL=https://your-supabase-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=your-supabase-anon-key

If these environment variables are omitted, Tamed automatically runs in Offline Demo Mode using local browser storage (mockBackend.js).


2. Local CLI Commands

# 1. Clone & Install Dependencies
git clone https://github.com/NottKoneko/Tamed.git
cd Tamed
npm install

# 2. Run Local Development Server (Vite 6)
npm run dev

# 3. Build Production Bundle (Outputs to dist/)
npm run build

# 4. Preview Production Build Locally
npm run preview

# 5. Run Oxlint Static Analysis
npm run lint

3. Directory & Architecture Map

PetOwner Site/
β”œβ”€β”€ .github/workflows/       # GitHub Actions & CI Workflows (e.g. CodeQL)
β”œβ”€β”€ public/                  # Static web assets (favicon, logo, icons)
β”œβ”€β”€ scripts/                 # Utility scripts (e.g., pad_icons.ps1)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/              # Web assets and icons
β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ BottomNav.jsx         # Navigation bar
β”‚   β”‚   β”œβ”€β”€ Calendar.jsx          # Interactive status calendar
β”‚   β”‚   β”œβ”€β”€ ConfirmationModal.jsx # Generic modal dialog
β”‚   β”‚   β”œβ”€β”€ MascotAvatar.jsx      # Animated pet species mascot
β”‚   β”‚   β”œβ”€β”€ PinModal.jsx          # 4-digit security PIN modal
β”‚   β”‚   β”œβ”€β”€ PraiseCardModal.jsx   # Praise card popover
β”‚   β”‚   β”œβ”€β”€ QuickSwitchBanner.jsx # Fast role switcher
β”‚   β”‚   β”œβ”€β”€ RemindersSection.jsx  # Check-in nudges
β”‚   β”‚   β”œβ”€β”€ Toast.jsx             # Notification toasts
β”‚   β”‚   └── XPProgressBar.jsx     # Level progress bar
β”‚   β”œβ”€β”€ pages/               # Top-level page views
β”‚   β”‚   β”œβ”€β”€ AuthScreen.jsx        # Supabase sign-up / sign-in
β”‚   β”‚   β”œβ”€β”€ DashboardOwner.jsx    # Owner schedule view
β”‚   β”‚   β”œβ”€β”€ DashboardPet.jsx      # Pet schedule view
β”‚   β”‚   β”œβ”€β”€ Home.jsx              # Main habit dashboard
β”‚   β”‚   β”œβ”€β”€ Onboarding.jsx        # Initial profile setup
β”‚   β”‚   β”œβ”€β”€ Requests.jsx          # Redemption requests
β”‚   β”‚   β”œβ”€β”€ Rewards.jsx           # Store catalog & redemptions
β”‚   β”‚   └── Settings.jsx         # Profile & app configuration
β”‚   β”œβ”€β”€ services/            # Data layer interfaces
β”‚   β”‚   β”œβ”€β”€ mockBackend.js        # Offline demo mode mock engine
β”‚   β”‚   └── supabaseClient.js     # Supabase client & API wrapper
β”‚   β”œβ”€β”€ store/               # State management
β”‚   β”‚   └── useAppStore.js        # Zustand 5 application store
β”‚   └── utils/               # Core utility modules
β”‚       β”œβ”€β”€ audio.js              # Web Audio API sound synthesizer
β”‚       β”œβ”€β”€ confetti.js           # Canvas particle confetti
β”‚       β”œβ”€β”€ cryptoUtils.js        # Web Crypto API random generator
β”‚       β”œβ”€β”€ currency.js          # Currency formatting
β”‚       β”œβ”€β”€ dateUtils.js          # Local date formatting
β”‚       β”œβ”€β”€ notifications.js     # Browser native notifications
β”‚       β”œβ”€β”€ rateLimiter.js        # Sliding window rate limiter
β”‚       β”œβ”€β”€ sanitizer.js          # XSS text sanitizer
β”‚       β”œβ”€β”€ theme.js              # Dynamic CSS token theme engine
β”‚       └── xpUtils.js            # Leveling & XP math functions
β”œβ”€β”€ supabase-schema.sql      # Full PostgreSQL schema, RPCs & RLS policies
└── vite.config.js           # Vite 6 configuration file

4. Cloudflare Pages Deployment

Tamed is optimized for single-command static site hosting on Cloudflare Pages:

  1. Build Command: npm run build
  2. Build Output Directory: dist
  3. Environment Variables: Set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY in Cloudflare Pages dashboard settings.
  4. Live URL: https://tamed.pages.dev/

Clone this wiki locally