Skip to content

Repository files navigation

CRAFTO โœจ

AI-Powered 3D Product & Packaging Design Platform
Transform ideas into production-ready 3D models and custom packaging in minutes.

Next.js FastAPI Python TypeScript


๐ŸŽฏ What is CRAFTO?

CRAFTO is an end-to-end AI design platform that bridges the gap between imagination and production. Using cutting-edge generative AI, it transforms simple text descriptions into:

  • 3D Product Models โ€“ Generate photorealistic 3D assets from text or images
  • Custom Packaging โ€“ Design professional packaging with AI-generated panel textures
  • Interactive Previews โ€“ Real-time 3D visualization with lighting and material controls

Whether you're a designer prototyping concepts, a marketer creating product mockups, or an entrepreneur visualizing ideas โ€“ CRAFTO makes professional 3D design accessible to everyone.


๐Ÿš€ Key Features

๐ŸŽจ AI Product Generation

  • Text-to-3D Pipeline: Describe any product and watch it materialize in 3D
  • Multi-Angle Synthesis: AI generates multiple views for accurate 3D reconstruction
  • Iterative Editing: Refine models with natural language instructions
  • Export Ready: Download production-ready GLB files

๐Ÿ“ฆ Smart Packaging Designer

  • Parametric Templates: Box and cylinder packaging with custom dimensions
  • Industry Presets: Pre-configured sizes for common products (shoes, bottles, electronics)
  • Panel-by-Panel AI Generation: Generate unique textures for each packaging face
  • Live Dieline Editor: Visual feedback with UV-mapped texture placement
  • 3D Preview: Real-time package visualization with product integration

โšก Advanced Capabilities

  • Trellis 3D Integration: State-of-the-art image-to-3D reconstruction via fal.ai
  • Gemini Vision AI: Multi-modal image generation with style consistency
  • Context-Aware Editing: AI maintains design coherence across iterations
  • Caching System: Smart asset caching for instant load times
  • Redis State Management: Seamless session persistence and recovery

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     CRAFTO Platform                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                               โ”‚
โ”‚  Frontend (Next.js 15 + TypeScript + Three.js)              โ”‚
โ”‚  โ”œโ”€ Product Creation Flow                                    โ”‚
โ”‚  โ”œโ”€ Packaging Design Studio                                  โ”‚
โ”‚  โ”œโ”€ 3D Model Viewer (React Three Fiber)                     โ”‚
โ”‚  โ””โ”€ Real-time Chat Interface                                 โ”‚
โ”‚                                                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                               โ”‚
โ”‚  Backend (FastAPI + Python)                                  โ”‚
โ”‚  โ”œโ”€ Product Pipeline Service                                 โ”‚
โ”‚  โ”‚   โ”œโ”€ Gemini Image Generation (Multi-View)               โ”‚
โ”‚  โ”‚   โ””โ”€ Trellis 3D Model Synthesis                         โ”‚
โ”‚  โ”‚                                                            โ”‚
โ”‚  โ”œโ”€ Packaging Generation Service                             โ”‚
โ”‚  โ”‚   โ”œโ”€ Panel Texture Generation                            โ”‚
โ”‚  โ”‚   โ”œโ”€ Dieline Processing                                  โ”‚
โ”‚  โ”‚   โ””โ”€ UV Mapping & Export                                 โ”‚
โ”‚  โ”‚                                                            โ”‚
โ”‚  โ””โ”€ State Management (Redis)                                 โ”‚
โ”‚                                                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                               โ”‚
โ”‚  AI Services                                                  โ”‚
โ”‚  โ”œโ”€ Google Gemini 3 Image (Multi-angle views)               โ”‚
โ”‚  โ”œโ”€ Trellis 3D Reconstruction (fal.ai)                      โ”‚
โ”‚  โ””โ”€ Context-aware prompt engineering                         โ”‚
โ”‚                                                               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Tech Stack:

  • Frontend: Next.js 15, React Three Fiber, Radix UI, TailwindCSS
  • Backend: FastAPI, Pydantic, Redis
  • AI: Google Gemini 3 Image, Trellis (fal.ai)
  • 3D: Three.js, GLB/GLTF, trimesh
  • Infrastructure: Docker, Docker Compose

๐Ÿ› ๏ธ Quick Start

Prerequisites

  • Node.js 18+ and npm/yarn
  • Python 3.11+
  • Redis (local or cloud instance)
  • API Keys:

Installation

1. Clone the repository

git clone https://github.com/yourusername/CRAFTO.git
cd CRAFTO

2. Backend Setup

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp env.example .env
# Edit .env with your API keys:
#   FAL_KEY=your_fal_api_key
#   GEMINI_API_KEY=your_gemini_api_key
#   REDIS_URL=redis://localhost:6379/0

# Start the backend
uvicorn main:app --host 0.0.0.0 --port 8000 --reload

3. Frontend Setup

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

4. Access the Application


๐ŸŽฎ Usage

Creating a 3D Product

  1. Navigate to Home: Enter a product description

    "A modern ceramic coffee mug with a matte finish"
    
  2. Generate: Click "Create" and watch the AI work:

    • ๐Ÿ–ผ๏ธ Generates multi-angle product views
    • ๐ŸŽจ Reconstructs 3D geometry from images
    • โœจ Produces a downloadable 3D model
  3. Refine: Use the chat panel to edit:

    "Make it blue with gold trim"
    "Add a geometric pattern"
    

Designing Packaging

  1. Select Package Type: Choose box or cylinder
  2. Set Dimensions: Use presets or custom measurements
  3. Generate Textures: Describe each panel:
    "Minimalist design with brand logo and product showcase"
    
  4. Preview in 3D: See your packaging in real-time
  5. Export: Download UV maps and 3D models

๏ฟฝ๏ฟฝ Configuration

Environment Variables

Backend (backend/.env):

# Required
FAL_KEY=your_fal_api_key_here
GEMINI_API_KEY=your_gemini_api_key_here
REDIS_URL=redis://localhost:6379/0

# Optional - Model Selection
GEMINI_PRO_MODEL=gemini-3-pro-image-preview
GEMINI_FLASH_MODEL=gemini-2.5-flash-image
GEMINI_IMAGE_SIZE=1K  # Options: 1K, 2K, 4K

# Optional - Quality Settings
SAVE_ARTIFACTS_LOCALLY=false  # Save all generations locally
DEMO_MOCK_MODE=false          # Enable for presentations (no API calls)

Frontend (frontend/next.config.ts):

// API endpoints auto-configured for localhost development
// Update for production deployment

๐Ÿณ Docker Deployment

Run the entire stack with Docker Compose:

cd backend

# Configure .env file first
cp env.example .env
# Edit .env with your API keys

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Services:


๐Ÿ“‚ Project Structure

CRAFTO/
โ”œโ”€โ”€ backend/                  # FastAPI backend
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ core/            # Config, Redis, utilities
โ”‚   โ”‚   โ”œโ”€โ”€ endpoints/       # API routes
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ product/     # Product generation API
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ packaging/   # Packaging design API
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ trellis/     # 3D generation API
โ”‚   โ”‚   โ”œโ”€โ”€ integrations/    # External AI services
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ gemini.py    # Google Gemini integration
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ trellis.py   # Trellis 3D integration
โ”‚   โ”‚   โ”œโ”€โ”€ models/          # Pydantic models
โ”‚   โ”‚   โ””โ”€โ”€ services/        # Business logic
โ”‚   โ”œโ”€โ”€ tests/               # Test suite
โ”‚   โ”œโ”€โ”€ main.py             # FastAPI app entry
โ”‚   โ””โ”€โ”€ requirements.txt    # Python dependencies
โ”‚
โ”œโ”€โ”€ frontend/                # Next.js frontend
โ”‚   โ”œโ”€โ”€ app/                # App router pages
โ”‚   โ”‚   โ”œโ”€โ”€ product/        # Product creation flow
โ”‚   โ”‚   โ”œโ”€โ”€ packaging/      # Packaging designer
โ”‚   โ”‚   โ””โ”€โ”€ page.tsx        # Home page
โ”‚   โ”œโ”€โ”€ components/         # React components
โ”‚   โ”‚   โ”œโ”€โ”€ ModelViewer.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ package-viewer-3d.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ dieline-editor.tsx
โ”‚   โ”‚   โ””โ”€โ”€ AIChatPanel.tsx
โ”‚   โ”œโ”€โ”€ lib/               # API clients & utilities
โ”‚   โ”‚   โ”œโ”€โ”€ product-api.ts
โ”‚   โ”‚   โ”œโ”€โ”€ packaging-api.ts
โ”‚   โ”‚   โ””โ”€โ”€ model-cache.ts
โ”‚   โ””โ”€โ”€ package.json
โ”‚
โ””โ”€โ”€ docs/                   # Documentation
    โ”œโ”€โ”€ Packaging.plan.md
    โ””โ”€โ”€ product_backend_plan.md

๐ŸŽฏ API Endpoints

Product Generation

  • POST /product/create โ€“ Generate new 3D product
  • POST /product/edit โ€“ Refine existing product
  • POST /product/trellis-only โ€“ Convert pre-generated images to 3D
  • GET /product โ€“ Get current product state
  • GET /product/status โ€“ Poll generation status

Packaging Design

  • POST /packaging/initialize โ€“ Start packaging session
  • POST /packaging/panels/generate โ€“ Generate panel texture
  • POST /packaging/panels/bulk-generate โ€“ Generate multiple panels
  • GET /packaging/state โ€“ Get current packaging state
  • POST /packaging/export โ€“ Export packaging files

Utilities

  • GET /health โ€“ Health check
  • GET / โ€“ API welcome message

Full API documentation: http://localhost:8000/docs


๐Ÿงช Testing

cd backend

# Run all tests
pytest

# Run with coverage
pytest --cov=app tests/

# Run specific test file
pytest tests/test_product_pipeline.py -v

๐Ÿš€ Roadmap

  • Text-to-3D product generation
  • Iterative AI editing
  • Box and cylinder packaging
  • Panel-by-panel texture generation
  • Real-time 3D preview

๐Ÿค Contributing

We welcome contributions! Here's how:

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

Please ensure:

  • Code follows existing style conventions
  • Tests pass (pytest for backend, npm test for frontend)
  • Documentation is updated

๐Ÿ™ Acknowledgments

  • Google Gemini โ€“ Multi-modal AI image generation
  • Trellis (fal.ai) โ€“ State-of-the-art image-to-3D reconstruction
  • Three.js โ€“ 3D rendering engine
  • FastAPI โ€“ High-performance Python web framework
  • Next.js โ€“ React framework for production

๐Ÿ’ฌ Support


Built with โค๏ธ by the CRAFTO Team

Powering Your Imagination with AI

About

CRAFTO AI Powering Your IMAGINATION.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages