Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

126 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿพ PetDex โ€” Next Prime Level Desktop Pet Gallery & Creation Studio

 โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
 โ•‘   _____   ______  _______  _____   ______  _______  _     _               โ•‘
 โ•‘  |_____]  |______     |    |  |  | |  |  | |______  |____/                โ•‘
 โ•‘  |        |______     |    |__|__| |__|__| |______  |    \_               โ•‘
 โ•‘                                                                           โ•‘
 โ•‘              ULTRA-MODERN VIRTUAL DESKTOP PET ECOSYSTEM                   โ•‘
 โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Next.js 16 React 19 TypeScript 5.7 Tailwind CSS v4 npm License MIT

Explore Live Repo โ€ข Browse Approved Packs โ€ข System Architecture


๐Ÿš€ Overview

PetDex is a state-of-the-art public gallery, interactive Tamagotchi-style desktop simulator, and custom creation studio for Codex-compatible animated digital companion pets.

Engineered with Next.js 16 (Turbopack), React 19, Tailwind CSS v4, and Web Audio API sound synthesis, PetDex provides developers, pixel artists, and AI enthusiasts with an immersive glassmorphic experience to preview, play with, build, and deploy desktop pets directly into the Codex CLI ecosystem (~/.codex/pets/).


โœจ Key Features & Capabilities

๐ŸŽฎ 1. Interactive Tamagotchi Playground

  • Live Vitality Statistics: Real-time progress meters for Happiness, Fullness, and Energy.
  • Interactive Actions:
    • Pet โค๏ธ: Synthesizes a warm purr sound, triggers celebration animations, and bursts heart particles.
    • Feed Treat ๐ŸŽ: Synthesizes crunch sound effects, triggers eating state, and restores hunger.
    • Play Ball โšฝ: Synthesizes a bounce sweep sound, triggers play state, and exercises the pet.
  • 5 Dynamic Environments: Switch between Cyberpunk Grid, Cozy Desk, Mystic Forest, Synthwave Neon, and Dark Void.
  • Web Audio API Sound Engine: Zero external audio asset dependencies โ€” pure synthesized browser chiptune audio.

๐ŸŽจ 2. Pet Creation Studio (In-Browser Pack Builder)

  • Drag-and-Drop Spritesheet Inspector: Upload custom PNG/WEBP spritesheet images.
  • Frame Grid Mapper: Interactively map frame width, height, start frames, and frame sequences across 10+ animation states (idle, walk, run, sleep, play, eat, celebrate, drag).
  • One-Click Package Exporter: Generates pet.json, metadata.json, and client-side .zip archives ready for Codex CLI deployment.

๐Ÿ” 3. Advanced Search & Vibe Filtering

  • Multi-Tag Real-Time Search: Instant filtering by pet name, vibe, or tag.
  • Vibe Filter Tabs: cozy, cyberpunk, playful, magical, chill.
  • Favorites & Bookmarks: Custom local storage hook (useFavoritePets) with reactive state sync.

๐Ÿ’Ž 4. Futuristic Glassmorphic Aesthetics

  • Theme Accents: Soft glowing mesh radial gradients and glassmorphism panels.
  • Custom Brand Selection Highlight: Custom CSS ::selection styling matching PetDex Indigo (#5266ea).
  • Hygiene & Reliability: Built-in Service Worker (public/sw.js) and database fallbacks for zero console warnings and 100% build stability.

๐Ÿ›๏ธ System Architecture

flowchart TD
    subgraph Client ["Client UI Layer (React 19 & Next.js 16)"]
        UI["PetDex Dashboard & Hero Parade"]
        PG["Interactive Playground (Tamagotchi Engine)"]
        ST["Pet Creation Studio & Spritesheet Inspector"]
        AUDIO["Web Audio API Sound Synthesizer"]
        FAV["Local Storage Favorites Manager"]
    end

    subgraph Server ["Next.js 16 App Router & Server Runtime"]
        API_SUBMIT["/api/submit (Community Submissions)"]
        API_ADMIN["/api/admin/[id] (Review Dashboard)"]
        API_UPLOAD["/api/uploadthing (Media Storage)"]
        MAN["/packs/manifest.json (Pet Gallery Manifest)"]
        MW["Proxy Middleware (Route Protection)"]
    end

    subgraph Data ["Data & Services Layer"]
        DB[(Neon PostgreSQL Database)]
        ORM["Drizzle ORM Engine"]
        REDIS[(Upstash Redis Rate Limiter)]
        CLERK[Clerk Authentication Provider]
    end

    subgraph Output ["Codex CLI Distribution"]
        PACKS["public/packs/*.zip Archives"]
        CODEX["~/.codex/pets/<slug>/ Target Directory"]
    end

    UI --> PG & ST & FAV
    PG --> AUDIO
    ST --> PACKS
    API_SUBMIT & API_ADMIN --> ORM --> DB
    API_SUBMIT --> REDIS
    MW --> CLERK
    PACKS --> CODEX
Loading

๐Ÿถ Virtual Pets Roster

PetDex comes pre-loaded with 12 approved animated digital companions:

Pet Icon Name Category Vibe States Count Description
๐Ÿง‹ Boba Creature Cozy 10 States A cute otter enjoying boba tea during coding sessions.
๐Ÿ“ฆ Boxcat Creature Cozy 10 States A cozy kitten tucked inside a cardboard box.
๐Ÿฐ Byte Bunny Creature Playful 10 States An energetic cyber bunny that loves jumping over logic bugs.
๐Ÿฆซ Cache Capy Creature Chill 10 States The ultimate relaxed capybara for stress-free debugging.
๐Ÿน Cash Cuy Creature Playful 10 States A wealthy guinea pig keeping track of your cloud compute credits.
๐Ÿš€ Cosmo Creature Magical 10 States An astronaut pet floating through space synthwave grids.
๐Ÿค– Kebo Robot Cyberpunk 10 States An AI robot companion monitoring background build tasks.
๐Ÿ•ต๏ธ Noir Webling Character Mysterious 10 States A dark detective pet investigating stack traces.
โ˜ข๏ธ Nukey Character Chaos 10 States A radioactive pixel pet bursting with nuclear energy.
๐Ÿผ Pixel Panda Creature Cozy 10 States A bamboo-munching panda for serene coding nights.
๐Ÿง Prompt Penguin Creature Focused 10 States An AI prompt specialist penguin guiding your code queries.
๐Ÿฆ Scoop Food Chill 10 States A sweet ice-cream companion keeping your terminal cool.

๐Ÿ“‚ Project Directory Structure

PetDex/
โ”œโ”€โ”€ .github/                  # GitHub workflows & repository config
โ”œโ”€โ”€ public/                   # Public static assets & pre-built packs
โ”‚   โ”œโ”€โ”€ brand/                # Brand mark & wordmark SVG logos
โ”‚   โ”‚   โ”œโ”€โ”€ petdex-mark.svg
โ”‚   โ”‚   โ””โ”€โ”€ petdex-wordmark.svg
โ”‚   โ”œโ”€โ”€ packs/                # Generated pet .zip archives & manifest.json
โ”‚   โ”‚   โ””โ”€โ”€ manifest.json
โ”‚   โ”œโ”€โ”€ pets/                 # Approved virtual pet directories (12 pets)
โ”‚   โ”‚   โ”œโ”€โ”€ boba/             # (spritesheet.webp, pet.json, metadata.json)
โ”‚   โ”‚   โ”œโ”€โ”€ boxcat/
โ”‚   โ”‚   โ”œโ”€โ”€ byte-bunny/
โ”‚   โ”‚   โ”œโ”€โ”€ cache-capy/
โ”‚   โ”‚   โ”œโ”€โ”€ cash-cuy/
โ”‚   โ”‚   โ”œโ”€โ”€ cosmo/
โ”‚   โ”‚   โ”œโ”€โ”€ kebo/
โ”‚   โ”‚   โ”œโ”€โ”€ noir-webling/
โ”‚   โ”‚   โ”œโ”€โ”€ nukey/
โ”‚   โ”‚   โ”œโ”€โ”€ pixel-panda/
โ”‚   โ”‚   โ”œโ”€โ”€ prompt-penguin/
โ”‚   โ”‚   โ””โ”€โ”€ scoop/
โ”‚   โ”œโ”€โ”€ apple-icon.png        # Brand favicon & app icons
โ”‚   โ”œโ”€โ”€ favicon.ico
โ”‚   โ”œโ”€โ”€ og.png                # Social media preview card
โ”‚   โ””โ”€โ”€ sw.js                 # Service Worker to prevent 404 logs
โ”œโ”€โ”€ src/                      # Application source code
โ”‚   โ”œโ”€โ”€ app/                  # Next.js 16 App Router routes
โ”‚   โ”‚   โ”œโ”€โ”€ admin/            # Admin review dashboard page
โ”‚   โ”‚   โ”œโ”€โ”€ api/              # Server API routes (submit, admin, uploadthing)
โ”‚   โ”‚   โ”œโ”€โ”€ install/          # One-click Codex CLI install route
โ”‚   โ”‚   โ”œโ”€โ”€ pets/             # Individual pet details & state inspection route
โ”‚   โ”‚   โ”œโ”€โ”€ submit/           # Community pet submission page
โ”‚   โ”‚   โ”œโ”€โ”€ globals.css       # Global styles & custom ::selection theme
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx        # Root HTML layout with Clerk auth provider
โ”‚   โ”‚   โ””โ”€โ”€ page.tsx          # Main home page hero parade & gallery
โ”‚   โ”œโ”€โ”€ components/           # Reusable UI components
โ”‚   โ”‚   โ”œโ”€โ”€ admin-review-row.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ auth-badge.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ download-actions.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ github-icon.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ ideas-queue.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ install-command.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ pet-builder.tsx   # Custom Pet Creation Studio
โ”‚   โ”‚   โ”œโ”€โ”€ pet-gallery.tsx   # Real-time multi-tag search & vibe filters
โ”‚   โ”‚   โ”œโ”€โ”€ pet-playground.tsx# Tamagotchi simulator & stats engine
โ”‚   โ”‚   โ”œโ”€โ”€ pet-sprite.tsx    # HTML Canvas pixel animation player
โ”‚   โ”‚   โ”œโ”€โ”€ pet-state-viewer.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ pet-submit-form.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ petdex-logo.tsx
โ”‚   โ”‚   โ””โ”€โ”€ track-on-click.tsx
โ”‚   โ”œโ”€โ”€ data/                 # Generated datasets
โ”‚   โ”‚   โ””โ”€โ”€ pets.generated.ts # Pet definitions registry
โ”‚   โ”œโ”€โ”€ lib/                  # Utility libraries & core modules
โ”‚   โ”‚   โ”œโ”€โ”€ db/               # Database client, queries, and schema
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ client.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ queries.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ schema.ts
โ”‚   โ”‚   โ”œโ”€โ”€ admin.ts
โ”‚   โ”‚   โ”œโ”€โ”€ audio.ts          # Web Audio API sound synthesizer
โ”‚   โ”‚   โ”œโ”€โ”€ downloads.ts
โ”‚   โ”‚   โ”œโ”€โ”€ favorites.ts      # Favorites local storage custom hook
โ”‚   โ”‚   โ”œโ”€โ”€ ideas.ts
โ”‚   โ”‚   โ”œโ”€โ”€ pet-states.ts     # Animation state frame metadata
โ”‚   โ”‚   โ”œโ”€โ”€ pets.ts
โ”‚   โ”‚   โ”œโ”€โ”€ ratelimit.ts      # Upstash Redis rate limiter
โ”‚   โ”‚   โ”œโ”€โ”€ types.ts          # TypeScript type definitions
โ”‚   โ”‚   โ””โ”€โ”€ uploadthing.ts
โ”‚   โ””โ”€โ”€ proxy.ts              # Clerk authentication middleware
โ”œโ”€โ”€ scripts/                  # Automation & asset pipeline scripts
โ”‚   โ”œโ”€โ”€ build-packs.ts        # Automated pet zip pack generator
โ”‚   โ”œโ”€โ”€ generate-assets.ts    # Canvas spritesheet generator
โ”‚   โ””โ”€โ”€ import-pet.ts         # Pet package importer & validator
โ”œโ”€โ”€ .env.example              # Environment variables template
โ”œโ”€โ”€ biome.json                # Biome code formatting & linting config
โ”œโ”€โ”€ drizzle.config.ts         # Drizzle ORM PostgreSQL config
โ”œโ”€โ”€ next.config.ts            # Next.js 16 configuration
โ”œโ”€โ”€ package.json              # Project dependencies & npm scripts
โ”œโ”€โ”€ postcss.config.mjs        # PostCSS Tailwind CSS v4 config
โ”œโ”€โ”€ PRD.md                    # Product Requirements Document
โ”œโ”€โ”€ README.md                 # Futuristic project documentation
โ””โ”€โ”€ tsconfig.json             # TypeScript configuration

โšก Quick Start & Setup

1. Prerequisites

  • Node.js: v20.0.0 or higher
  • npm: v10.0.0 or higher

2. Installation

# Clone the repository
git clone https://github.com/CodeWithBasu/PetDex.git
cd PetDex

# Install dependencies using npm
npm install

3. Environment Configuration (Optional)

Copy .env.example to .env.local to configure authentication and database connections:

cp .env.example .env.local

4. Run Development Server

npm run dev

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


๐Ÿ› ๏ธ CLI Commands & NPM Scripts

Script Description
npm run dev Starts the Next.js 16 Turbopack development server at http://localhost:3000.
npm run build Compiles TypeScript and creates an optimized production build.
npm run start Launches the production server after running npm run build.
npm run build-packs Programmatically generates pet .zip archives and manifest.json.
npm run check Executes Biome linting and code quality checks.
npm run format Runs Biome auto-formatting across the codebase.

๐Ÿ“ฆ Codex Local Installation

To install any pet locally into your Codex CLI environment:

# Create local Codex pets directory for Boba
mkdir -p ~/.codex/pets/boba

# Download and extract the pet package
curl -O https://petdex.dev/packs/boba.zip
unzip boba.zip -d ~/.codex/pets/boba

๐Ÿ“„ License

This project is open-source and licensed under the MIT License.

Made with โค๏ธ for the Codex community by CodeWithBasu.

About

virtual-pets, desktop-companion, codex, tamagotchi, pixel-art, spritesheet, web-audio-api, nextjs, react, typescript, tailwindcss, game-engine, drizzle-orm, neon-postgres, upstash-redis, nextjs16, react19, app-router, turbopack, open-source

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages