Skip to content

Repository files navigation

Smart Carport

White-label 3D carport configurator and regional pricing engine for metal-building dealers.

Customers design carports and metal structures in the browser, get ZIP-based quotes, and share builds by link. Dealers get live pricing, sales tools, saved builds, contracts, and PDF workflows — all themed per tenant from one codebase.

Local demo: http://localhost:8000/

Documentation

Doc Contents
Architecture Multi-tenancy, config lifecycle, pricing engine, 3D renderer, auth, email/PDF
API Reference REST endpoints, SPA routes, configuration schema, admin
Development Guide Setup, Docker, env vars, commands, troubleshooting, deployment

Vision

The long-term goal is an AI-native carport builder: users describe what they want in natural language, and the platform generates a valid configuration, 3D preview, and regional price automatically.

Example prompts the product should eventually support:

  • "22×31 vertical-roof carport, 12' legs, clay ends, merlot roof, one 9×8 garage door on the front."
  • "Add a 10' lean-to on the left with storage."
  • "Make it engineer certified and show me the quote for zip 23451."

Today, SmartCarport is the foundation for that vision — a full rules engine, procedural 3D renderer, pricing backend, and dealer workflow stack. The AI layer will sit on top of this existing configuration model: prompts translate into structured build state, the server validates options against regional catalog rules, and the canvas updates in real time.

Features

Style of carport picker Adjust building dimensions Style and options panel
Building styles
Start from Standard, Garage, Utility, Side Combo, Step-Down Barn, Straight-Line Barn, or Lean-To.
Live dimensions
Set width, length, and height from the top bar and watch the 3D model resize in real time.
Style & options
Configure roof type, engineer certification, frame gauge, and surface finish per region.
Lean-to configuration Sides and ends enclosure options Color picker
Lean-tos
Add left or right lean-to sections with independent width, length, height, pitch, and storage.
Sides & ends
Enclose walls and gable ends with open, fully enclosed, gable, and partial-side options.
Color picker
Choose roof, trim, ends, wainscot, and colored screw options from the regional palette.
Doors and openings editor Dealer menu and saved builds 3D configurator overview
Openings
Place walk-in doors, windows, garage doors, and frameouts with on-model placement controls.
Saved builds
Dealers save designs, revisit My Builds, and manage profile from the dealer menu.
Real-time 3D
Procedural Three.js canvas with orbit controls, dimension overlays, and multi-angle screenshots on save.
  • Regional pricing — ZIP-gated service area; backend computes line items, surcharges, tax, deposit, and payment fees
  • Shareable links — builds autosave to /api/configurations/ and resume at /<uuid>/
  • Quote & contracts — request quote, email configuration link, contract preview, and PDF delivery via Playwright
  • White-label theming — logo, colors, contact info, and analytics resolved from hostname
  • Admin CMS — sites, pricing catalog, users, configurations, and HTML pages at /admin/

User Flows

flowchart TD
    Start([Visitor lands on site]) --> Host{Resolve tenant by hostname}
    Host --> Zip[Enter ZIP code]
    Zip --> InArea{In service area?}
    InArea -->|No| OutOfArea[Out of service area]
    InArea -->|Yes| Style[Pick carport style]
    Style --> Create[POST /api/configurations/]
    Create --> Design[Configure in 3D sidebar + canvas]
    Design --> Save[Debounced PUT autosave]
    Save --> Design

    Design --> Share[Email configuration link]
    Design --> Resume[Open /uuid/ link]
    Resume --> Load[GET configuration]
    Load --> Design

    Design --> Auth{Dealer logged in?}
    Auth -->|No| Quote[Request Quote]
    Quote --> EmailQuote[Email to sales inbox]

    Auth -->|Yes| Price[Live pricing + sales tools]
    Price --> MyBuilds[Save to My Builds]
    Price --> Contract[Contract preview / Buy Now]
    Contract --> Pdf[PDF via Playwright]
    Pdf --> EmailContract[Email contract]
Loading

Tech Stack

Layer Technology
Backend Python 3.9, Django 4.2, Django REST Framework, dj-rest-auth
Frontend React 18, React Router 6, Zustand, Tailwind CSS 4
Build Vite 6, django-vite (HMR in dev)
3D Three.js 0.176 (procedural carport geometry)
Database PostgreSQL
Cache Redis 7 via django-redis
Storage Backblaze B2 (S3-compatible, django-storages)
Email SendGrid (production), console backend (development)
PDF Playwright (headless Chromium)
Server Uvicorn ASGI (production), Django runserver (development)

Quick Start

Docker Compose

Requires Docker and a PostgreSQL server reachable from Docker.

cp .env.example .env
# set DATABASE_URL — use host.docker.internal for host Postgres, not localhost
docker compose up --build

Open http://localhost:8000. The web container runs migrations, builds frontend assets, and starts Django.

Local development

Requires Python 3.9, Node.js 20.x, PostgreSQL, Redis, and Pipenv.

cp .env.example .env
pipenv install --dev
npm install --legacy-peer-deps
pipenv run python manage.py migrate
docker compose up redis -d   # or run Redis locally on :6379

# Terminal 1 — Vite dev server (django-vite HMR)
npm run dev

# Terminal 2 — Django
pipenv run python manage.py runserver

For contract PDF generation:

pipenv run playwright install chromium

See the Development Guide for environment variables, sample data restore, and troubleshooting.

Repository Layout

smartcarport/           Django project (settings, urls, ASGI)
api/
  sites/                Multi-tenant Site and Theme models
  users/                Custom user, auth, saved builds
  options/              Regional pricing catalog
  configurations/       Build state, images, pricing engine
    utils/              Mixin-based Building price computation
  emails/               Quote, link, and contract email flows
  pages/                Per-site CMS pages
  printing/             Contract HTML and PDF endpoints
client/
  static_src/           React SPA, Three.js generators, Zustand stores
  static/               Vite build output (gitignored)
  templates/            SPA shell with injected site JSON
docs/                   Documentation and feature screenshots
tests/                  Pricing unit tests
docker-compose.yml      web + redis services
Dockerfile              Python 3.9 + Node 20 + Pipenv + npm ci
Procfile                Heroku: migrate + uvicorn

Reference Projects

License

GPL-3.0-or-later — see LICENSE.

About

White-label 3D carport configurator and regional pricing engine for metal-building dealers.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages