twotalesanimation 2ed7ae46a4
Deploy / deploy (push) Successful in 9m11s
Add CSV shotlist export for jobs/quotes
Adds a GET /api/csv/shots/[jobId] endpoint with two modes:

  ?detail=shots (default) - one row per shot, with rolled-up task
    count, hours, days, subtotal and total.
  ?detail=tasks - one row per line item, adding artist role, rate
    card, rates and the markup/discount/tax/total split.

Totals run through the existing calcLineItem/sumLineItems helpers so
they match the editor and the PDF. Amounts are emitted as plain 2dp
numbers with the currency named in the header, so spreadsheets can sum
them. Rows follow the editor's display order (grouped by episode or
shot group, Ungrouped last, then alphabetical by shot code) and the
group column header adapts to the job type.

Shotlist column headers deliberately match the CSV importer's aliases
so an export can be edited and re-imported. Free text is flattened to a
single line to keep one shot per row: the importer's parser splits on
newlines before handling quotes, so multi-line quoted fields would
otherwise corrupt a re-import.

Exposed as an "Export CSV" dropdown in the shots editor.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 16:06:11 +02:00
2026-08-18 15:23:22 +02:00
2026-08-18 12:11:20 +02:00
2026-08-18 12:11:20 +02:00
2026-05-12 14:54:08 +02:00
2026-05-12 14:54:08 +02:00
2026-08-18 12:11:20 +02:00
2026-08-18 16:14:17 +02:00
2026-08-18 12:11:20 +02:00
2026-08-18 12:11:20 +02:00
2026-08-18 12:11:20 +02:00
2026-08-18 12:11:20 +02:00
2026-08-18 12:11:20 +02:00
2026-08-18 15:23:22 +02:00

xBid — VFX Quoting & Bidding SaaS

A professional full-stack VFX quoting application built with Next.js 15, TypeScript, Tailwind CSS v4, Prisma ORM, and PostgreSQL.


Features

  • Clients — manage client companies with full contact and billing info
  • Jobs / Quotes — versioned quote documents with status workflow (Draft ? Sent ? Approved/Rejected)
  • Shots — VFX shot breakdown with complexity multipliers and drag-and-drop reordering
  • Assets — CG asset budget tracking (characters, environments, vehicles, etc.)
  • Line Items — per-task cost rows with hours/days/artists/rates, markup, discount, tax
  • Rate Cards — studio rate card library organized by department
  • PDF Export — professional quote PDF with front page + detailed appendix
  • Decimal Precision — all financials use decimal.js (no floating-point drift)

Tech Stack

Layer Technology
Framework Next.js 15 (App Router, Server Actions)
Language TypeScript
Styling Tailwind CSS v4 + shadcn/ui
ORM Prisma 7 + PostgreSQL 16
Forms React Hook Form + Zod
Drag & Drop @dnd-kit/core + @dnd-kit/sortable
Finance Math decimal.js
Notifications sonner
PDF HTML render via /api/pdf/[id]

Prerequisites

  • Node.js 20+
  • PostgreSQL 16 (or Docker)
  • npm 10+
  • ts-node for seeding: npm install -g ts-node typescript

Quick Start

1. Clone & install

git clone <repo-url>
cd xBid
npm install

2. Configure environment

cp .env.example .env

Edit .env:

DATABASE_URL="postgresql://postgres:postgres@localhost:5432/xbid"
NEXTAUTH_SECRET="your-random-secret-here"
NEXTAUTH_URL="http://localhost:3000"

3. Start PostgreSQL

Option A — Docker (recommended):

docker compose up -d postgres

Option B — local PostgreSQL:

CREATE DATABASE xbid;

4. Run database migrations

npm run db:generate   # generate Prisma client
npm run db:migrate    # run migrations (enter "init" as migration name)

5. Seed sample data

npm run db:seed

This creates 15 rate cards, 2 sample clients, 2 jobs with shots, assets, and line items.

6. Start development server

npm run dev

Open http://localhost:3000


Production (Docker)

docker compose up --build -d

After first run, apply migrations:

docker compose exec app npx prisma migrate deploy
docker compose exec app npx prisma db seed

PDF Export

Navigate to any job and click Download PDF. The route at /api/pdf/[id] generates HTML with:

  • Front page: client info, project details, shot/asset summary, financial totals, T&C
  • Appendix: full per-shot and per-asset line item breakdown

Print to PDF via browser (Ctrl+P ? Save as PDF).


Project Structure

src/
  app/                  Next.js App Router pages
    api/pdf/[id]/       PDF generation endpoint
    clients/            Client management
    jobs/               Job management
    rate-cards/         Rate card management
  actions/              Server actions (CRUD)
  components/
    assets/             Asset editor
    clients/            Client form & table
    dashboard/          Stats & recent jobs
    jobs/               Job form, table, detail, totals
    layout/             Sidebar navigation
    line-items/         Line item table & dialog
    rate-cards/         Rate card management
    shots/              Shot editor
    ui/                 shadcn/ui components
  lib/
    calculations.ts     Decimal.js financial math
    constants.ts        Domain constants & defaults
    prisma.ts           Prisma client singleton
    validations.ts      Zod schemas
prisma/
  schema.prisma         Full database schema
  seed.ts               Sample data seeder

Database Scripts

npm run db:generate   # npx prisma generate
npm run db:migrate    # npx prisma migrate dev
npm run db:seed       # ts-node prisma/seed.ts
npm run db:studio     # npx prisma studio (DB GUI at :5555)
S
Description
No description provided
Readme 535 KiB
Languages
TypeScript 98.8%
CSS 0.7%
JavaScript 0.4%
Dockerfile 0.1%