An open API service indexing awesome lists of open source software.

https://github.com/smouj/tazo-art-studio

๐ŸŽด AI-powered Tazo Art Creator for Trading Tazos Game โ€” Create. Collect. Battle.
https://github.com/smouj/tazo-art-studio

90s-aesthetic ai-art digimon dragon-ball image-generation nextjs pokemon prisma shadcn-ui tailwindcss tazo trading-cards typescript

Last synced: about 2 months ago
JSON representation

๐ŸŽด AI-powered Tazo Art Creator for Trading Tazos Game โ€” Create. Collect. Battle.

Awesome Lists containing this project

README

          

# ๐ŸŽด Tazo Art Studio

**AI-Powered Tazo Art Creator for Trading Tazos Game**

_Create. Collect. Battle._

[![Next.js](https://img.shields.io/badge/Next.js-16-black?logo=next.js)](https://nextjs.org/)
[![TypeScript](https://img.shields.io/badge/TypeScript-5-3178C6?logo=typescript)](https://www.typescriptlang.org/)
[![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-4-06B6D4?logo=tailwindcss)](https://tailwindcss.com/)
[![Prisma](https://img.shields.io/badge/Prisma-ORM-2D3748?logo=prisma)](https://www.prisma.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)
[![GitHub Pages](https://img.shields.io/badge/Demo-GitHub_Pages-222?logo=github)](https://smouj.github.io/tazo-art-studio/)

---

## ๐Ÿ“– Overview

**Tazo Art Studio** is a web application for generating, collecting, and managing AI-created tazo art cards across TTG's three original Season 1 franchises. Each tazo features an AI-generated character composited onto circular tazo backgrounds with full front-and-back designs.

> ๐Ÿ”— **Related Project:** [Trading Tazos Game](https://github.com/smouj/Trading-Tazos-Game) โ€” The original game this studio creates art for. Generate characters here, battle them there!

---

## ๐ŸŽด What Does a Tazo Look Like?

Each tazo is a **circular collectible disc** with two sides โ€” much like the classic 90s tazos/pogs:

| | **Front (Composited)** | **Back (Collection Design)** |
|---|---|---|
| The AI-generated character is composited onto a real tazo frontal background | Unique back artwork per collection |

### Minimon โ€” Luminara Creatures


Minimon Tazo Example - Front and Back

### Dracobell โ€” Bellora Fighters


Dracobell Tazo Example - Front and Back

### Cybermon โ€” Neon Grid Entities


Cybermon Tazo Example - Front and Back

---

## ๐Ÿ–ผ๏ธ Frontal Backgrounds

Each collection features unique circular backgrounds where AI characters are composited onto. The backgrounds are actual PNG assets giving each tazo its authentic 90s aesthetic.

### Minimon โ€” 6 Unique Backgrounds


Minimon frontal backgrounds

### Dracobell โ€” 4 Unique Backgrounds


Dracobell frontal backgrounds

### Cybermon โ€” 3 Unique Backgrounds


Cybermon frontal backgrounds

### Collection Back Designs

Each collection has its own back-side tazo design:


Collection back designs

---

## โœจ Features

### ๐ŸŽจ AI-Powered Generation
- Describe your tazo character and let AI generate the art
- **Automatic compositing** of AI characters onto real tazo backgrounds using Sharp
- Custom prompt support for advanced users
- Random preset descriptions for quick inspiration
- Built-in **transparency validation** โ€” ensures characters have clean alpha channels

### ๐Ÿ—‚๏ธ Three Iconic Collections

| Collection | Inspiration | Backgrounds | Color | Theme |
|-----------|------------|-------------|-------|-------|
| **Minimon** | Luminara lineage creatures | 6 frontal BGs | Yellow/Orange | Vital Sparks, Pathfinders, lineage awakening |
| **Dracobell** | Bellora aura fighters | 4 frontal BGs | Orange/Red | Roar Aura, Bell Shards, resonance phases |
| **Cybermon** | Neon Grid entities | 3 frontal BGs | Blue/Cyan | Soul Protocols, Core Gates, Blackout Drift |

### โญ Five Rarity Tiers

| Rarity | Color | Visual Effect |
|--------|-------|---------------|
| **Common** | `#9CA3AF` Gray | Standard clean design |
| **Uncommon** | `#22C55E` Green | Subtle shimmer on character |
| **Rare** | `#3B82F6` Blue | Holographic crystal accents |
| **Ultra-Rare** | `#A855F7` Purple | Purple aura + metallic glow |
| **Legendary** | `#FFCC00` Gold | Golden aura + crown light + particles |

### โš”๏ธ Eight Combat Roles

```
Attacker ยท Tank ยท Technical ยท Bouncer ยท Heavy ยท Light ยท Balanced ยท Special
```

Each role determines the distribution of **9 combat stats**:

| Stat | Icon | Description |
|------|------|-------------|
| **ATK** Attack | โš”๏ธ | Offensive power |
| **DEF** Defense | ๐Ÿ›ก๏ธ | Damage reduction |
| **RES** Resistance | ๐Ÿ›ก๏ธ | Status effect resistance |
| **WGT** Weight | ๐Ÿ‹๏ธ | Knockback resistance |
| **STB** Stability | โš“ | Recovery speed |
| **SPN** Spin | ๐Ÿ”„ | Spin attack power |
| **CTR** Control | ๐ŸŽฏ | Accuracy |
| **BNC** Bounce | โ†•๏ธ | Jump/mobility |
| **PRC** Precision | ๐ŸŽฏ | Critical hit chance |

### ๐Ÿ–ผ๏ธ Gallery & Collection Management
- Browse all created tazos with visual grid
- Filter by collection, rarity, or favorites
- **Flip animation** to see front and back of each tazo
- **Download** tazo images (front, back, or creature-only PNG)
- **Download metadata** as JSON
- Favorite/unfavorite your best designs
- Delete unwanted creations

### ๐Ÿ“ฐ 90s Magazine Aesthetic
- Complete design system inspired by **Nintendo Power / Pokรฉmon Magazine**
- Magazine-style shadows, halftone patterns, and bold typography
- Collection-specific gradients and color schemes
- Animated effects for legendary and ultra-rare tazos
- Comic-style stat bars with color-coded values

---

## ๐Ÿ“ธ App Screenshots

### Landing Page


Tazo Art Studio Landing Page

> ๐Ÿ’ก The full Next.js app (with live AI generation, gallery, and flip animations) requires the `z-ai-web-dev-sdk` API key. See [Getting Started](#-getting-started) to run it locally.

---

## ๐Ÿ› ๏ธ Tech Stack

| Layer | Technology | Purpose |
|-------|-----------|---------|
| **Framework** | [Next.js 16](https://nextjs.org/) (App Router) | Full-stack React framework |
| **Language** | [TypeScript 5](https://www.typescriptlang.org/) | Type-safe development |
| **Styling** | [Tailwind CSS 4](https://tailwindcss.com/) + Magazine Design System | 90s aesthetic UI |
| **UI Components** | [shadcn/ui](https://ui.shadcn.com/) (Radix primitives) | Accessible, composable components |
| **Icons** | [Lucide React](https://lucide.dev/) | Consistent icon set |
| **Image Processing** | [Sharp](https://sharp.pixelplumbing.com/) | Character-to-background compositing + circular masking |
| **AI Generation** | [z-ai-web-dev-sdk](https://www.npmjs.com/package/z-ai-web-dev-sdk) | AI image generation with transparency guard |
| **Database** | [Prisma ORM](https://www.prisma.io/) + SQLite | Persistent storage |
| **Animations** | [Framer Motion](https://www.framer.com/motion/) | Smooth UI transitions + flip card |

---

## ๐Ÿš€ Getting Started

### Prerequisites

- [Node.js](https://nodejs.org/) 22+ or [Bun](https://bun.sh/) 1.x
- npm, yarn, pnpm, or bun
- A [z-ai-web-dev-sdk](https://www.npmjs.com/package/z-ai-web-dev-sdk) API key

### Installation

```bash
# Clone the repository
git clone https://github.com/smouj/tazo-art-studio.git
cd tazo-art-studio

# Install dependencies
npm install # or: bun install

# Set up environment variables
cp .env.example .env

# Initialize the database
npx prisma db push # or: bunx prisma db push

# Start the development server
npm run dev # or: bun run dev
```

Open [http://localhost:3000](http://localhost:3000) in your browser.

### Environment Variables

| Variable | Description | Default |
|----------|------------|---------|
| `DATABASE_URL` | SQLite database connection string | `file:./dev.db` |

---

## ๐Ÿ“ Project Structure

```
tazo-art-studio/
โ”œโ”€โ”€ prisma/
โ”‚ โ””โ”€โ”€ schema.prisma # TazoArt model with 9 combat stats
โ”œโ”€โ”€ public/
โ”‚ โ”œโ”€โ”€ tazo-assets/ # Real tazo background artwork
โ”‚ โ”‚ โ”œโ”€โ”€ frontal/ # Frontal backgrounds per collection
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ minimon/ # 6 PNG backgrounds (1254ร—1254)
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ dracobell/ # 4 PNG backgrounds (1254ร—1254)
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ cybermon/ # 3 PNG backgrounds (1254ร—1254)
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ special/ # Cross-collection legendary BG
โ”‚ โ”‚ โ””โ”€โ”€ back/ # Back designs per collection
โ”‚ โ”‚ โ”œโ”€โ”€ back-minimon.png
โ”‚ โ”‚ โ”œโ”€โ”€ back-dracobell.png
โ”‚ โ”‚ โ””โ”€โ”€ back-cybermon.png
โ”‚ โ””โ”€โ”€ examples/ # README showcase images
โ”‚ โ”œโ”€โ”€ tazo-*-card.png # Front+back card examples
โ”‚ โ”œโ”€โ”€ tazo-*-showcase.png # Background galleries
โ”‚ โ””โ”€โ”€ tazo-backs-showcase.png # Back designs showcase
โ”œโ”€โ”€ docs/
โ”‚ โ””โ”€โ”€ index.html # GitHub Pages landing page
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ app/
โ”‚ โ”‚ โ”œโ”€โ”€ page.tsx # Main SPA (Create Tab + Gallery Tab)
โ”‚ โ”‚ โ”œโ”€โ”€ layout.tsx # Root layout with fonts & metadata
โ”‚ โ”‚ โ”œโ”€โ”€ globals.css # Magazine design system + animations
โ”‚ โ”‚ โ””โ”€โ”€ api/
โ”‚ โ”‚ โ””โ”€โ”€ tazo-art/
โ”‚ โ”‚ โ”œโ”€โ”€ route.ts # GET (list) + POST (create + generate)
โ”‚ โ”‚ โ””โ”€โ”€ [id]/
โ”‚ โ”‚ โ””โ”€โ”€ route.ts # GET + PATCH (favorite) + DELETE
โ”‚ โ”œโ”€โ”€ components/ui/ # shadcn/ui components (Radix-based)
โ”‚ โ”œโ”€โ”€ hooks/ # Custom React hooks
โ”‚ โ””โ”€โ”€ lib/
โ”‚ โ”œโ”€โ”€ db.ts # Prisma client singleton
โ”‚ โ””โ”€โ”€ utils.ts # Utility functions
โ”œโ”€โ”€ scripts/
โ”‚ โ””โ”€โ”€ generate-examples.mjs # README example image generator
โ”œโ”€โ”€ .env.example # Environment variable template
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ LICENSE # MIT License
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tsconfig.json
```

---

## ๐ŸŽฎ How It Works

### AI Generation Flow

```
User Input โ†’ Prompt Builder โ†’ AI Image Generation โ†’ Transparency Check โ†’ Character Compositing โ†’ Database Storage
```

1. **User fills in** the form: name, collection, rarity, role, and visual description
2. **API builds a strict prompt** โ€” collection style + rarity effects + role stance + mandatory transparency guard
3. **z-ai-web-dev-sdk** generates a 1024ร—1024 character illustration with transparent background
4. **Transparency validation** checks all 4 corners of the generated image for alpha channel
5. **Sharp** composites the AI character (65% size) onto a randomly selected frontal background (1254ร—1254)
6. **Both images** (composited front + raw character) are stored in the database as Base64
7. **Tazo appears** in the gallery with full front/back flip view

### Compositing Process

The character is generated with a transparent background, then composited onto the real tazo background:

```typescript
// Character is resized to 65% of background size
const charSize = Math.round(bgSize * 0.65);
const offset = Math.round((bgSize - charSize) / 2);

// Composited with proper transparency preservation
const composited = await sharp(bgBuffer)
.composite([{ input: resizedCharacter, left: offset, top: offset }])
.png()
.toBuffer();
```

### Stat Generation

Stats are generated based on:
- **Rarity tier** โ€” Higher rarity = higher multiplier (Common: 0.8ร—, Legendary: 1.25ร—)
- **Combat role** โ€” Each role has different base stat emphasis:
- **Attacker:** ATK 80, DEF 35 โ€” pure offense
- **Tank:** DEF 85, RES 80, WGT 75 โ€” maximum durability
- **Heavy:** WGT 95, STB 80 โ€” unmovable wall
- **Light:** WGT 15, BNC 65, PRC 75 โ€” nimble glass cannon
- **Random variance** โ€” ยฑ5 points from calculated value to keep each tazo unique

---

## ๐ŸŽจ Design System

The application follows a **90s Nintendo Power / Pokรฉmon Magazine** aesthetic:

### Color Palette

| Token | Hex | Usage |
|-------|-----|-------|
| Magazine Yellow | `#FFCC00` | Primary actions, headings, legendary rarity |
| Pokรฉmon Red | `#E3350D` | Destructive actions, alerts, attacker role |
| Pokรฉmon Blue | `#3B4CCA` | Links, accents, tank role |
| Dragon Orange | `#FF6B00` | Dracobell collection |
| Cyber Blue | `#00A1E9` | Cybermon collection |
| Magazine Cream | `#FFFBE6` | Page backgrounds |
| Magazine Black | `#1A1A1A` | Text, borders, headers |

### Typography
- **Headings:** `font-black uppercase tracking-wider`
- **Labels:** `font-bold text-xs uppercase`
- **Body:** `font-bold text-sm`
- **Font stack:** System sans-serif with bold emphasis

### Special CSS Effects

| Class | Effect |
|-------|--------|
| `.mag-card` | Magazine-style card with thick border + shadow offset |
| `.mag-btn` | Bold button with shadow offset + scale on hover |
| `.legendary-glow` | Animated golden glow + particles for legendary tazos |
| `.holo-border` | Holographic shimmer for rare+ tazos |
| `.mag-stroke` | Text stroke for readability on images |
| `.tazo-card-hover` | Scale(1.03) + shadow on hover |
| `.mag-stripes` | Diagonal halftone pattern overlay |
| `.stat-bar` | Comic-style progress bar for stats |

---

## ๐Ÿค Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

### Ideas for Contributions
- New collection backgrounds
- Additional rarity tiers or effects
- Export formats (GIF, WebP)
- Batch generation
- WebSocket integration with Trading Tazos Game

---

## ๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the [LICENSE](./LICENSE) file for details.

---

## ๐Ÿ™ Acknowledgments

- [Trading Tazos Game](https://github.com/smouj/Trading-Tazos-Game) โ€” The original game project
- [z-ai-web-dev-sdk](https://www.npmjs.com/package/z-ai-web-dev-sdk) โ€” AI image generation SDK
- [shadcn/ui](https://ui.shadcn.com/) โ€” Beautiful, accessible UI components
- [Sharp](https://sharp.pixelplumbing.com/) โ€” High-performance image compositing
- The 90s magazine culture that inspired the aesthetic

---

**[โฌ† Back to Top](#-tazo-art-studio)**

Made with โค๏ธ and 90s nostalgia