SwapSpec — AI Engine Swap Planner

FastAPI
Supabase
Unity
Claude AI
Python
Published

January 29, 2025

Overview

SwapSpec is an AI-driven engine swap planning platform that helps enthusiasts and professionals plan, validate, and execute engine swap projects. The platform combines a Python FastAPI backend with a Unity mobile client, backed by Supabase for auth, storage, and database.

The primary purpose of SwapSpec is to:

  • Provide AI-assisted build planning and compatibility guidance via Claude
  • Decode VINs and catalog vehicle/engine specifications for swap projects
  • Support 3D mesh uploads for engine bay scanning and fitment visualization
  • Generate exportable build reports (JSON and PDF)
  • Track conversation history with the AI Build Advisor per project

Architecture

Backend: FastAPI + Async SQLAlchemy 2.0 + Supabase PostgreSQL

  • Supabase Auth for user registration/login (no local password storage)
  • Supabase Storage for file uploads (mesh files, general uploads)
  • Claude API integration for the AI Build Advisor with persistent conversation history
  • VIN decoding via NHTSA API
  • PDF report generation via WeasyPrint + Jinja2

Client: Unity C# mobile app

  • UnityWebRequest-based HTTP client with JWT token management
  • One service per backend domain (Auth, Vehicle, Engine, Build, Advisor, File)
  • Screen-based UI navigation via ScreenManager

Technical Details

Framework/Stack: Python FastAPI, SQLAlchemy 2.0, Supabase, Unity C#

Database: Supabase PostgreSQL via pgBouncer connection pooler

Auth: Supabase Auth (sign_up, sign_in_with_password, JWT validation)

AI: Anthropic Claude API (claude-sonnet-4-20250514) for build advising

Deployment: Supabase cloud infrastructure

Tools Used:

  • Claude Code for development
  • Supabase for backend infrastructure
  • Unity 2022.3+ for mobile client

Source Code

Key Features

Feature Description
AI Build Advisor Claude-powered chat that understands your specific build context
VIN Decoder NHTSA API integration for automatic vehicle identification
3D Mesh Uploads Upload .obj, .stl, .fbx, .gltf, .glb files for engine bay scans
Build Reports Export builds as JSON data or formatted PDF documents
Chat History Persistent per-build conversation history with the AI advisor
Transmission Matching Find compatible transmissions via bellhousing pattern matching

Data Model

  • Users own Builds and contribute Vehicles
  • Builds reference one Vehicle + one Engine + optional Transmission
  • Each Build has its own ChatMessage history with the AI Advisor
  • Transmissions match Engines via bellhousing pattern strings