Removes output: "standalone" from next.config.js, updates build/start/preview
scripts to use next build/next start, and updates Dockerfile to copy .next
output directory and run via bun run start instead of server.js.
https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG
The React Compiler (reactCompiler: true) generates code that calls
react/compiler-runtime during SSR, which resolves to null on Linux/bun,
causing "Cannot read properties of null (reading 'useRef')" on every
statically prerendered page. Disabling restores normal SWC transforms.
https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG
Dashboard pages require authentication and include client components
with hooks that fail during static prerendering on Linux/Docker.
Setting force-dynamic in the layout prevents build-time prerendering
across the entire authenticated dashboard.
https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG
Prevents Turbopack from statically analyzing better-auth's kysely adapter,
which imports symbols removed in kysely 0.29. Also fixes @typescript-eslint
consistent-type-imports warning on the Db type alias.
https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG
- Schema: add publicTokenExpiresAt to invoices table
- invoices.generatePublicToken: accepts optional ttlHours param; sets
expiry timestamp when provided
- invoices.getByPublicToken: returns 403 if token is expired
- New route GET /api/i/[token]/pdf: streams the invoice PDF publicly,
returns 410 Gone if expired; excluded from auth middleware
- MCP invoices_generate_public_token: exposes ttlHours, returns both
webUrl (/i/{token}) and pdfUrl (/api/i/{token}/pdf)
https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG
MCP expanded from 49 to 58 tools:
- templates_list, templates_list_by_type, templates_create, templates_update,
templates_delete — full invoice template CRUD
- businesses_get_email_config, businesses_update_email_config — configure
per-business Resend API key and sending domain
- profile_get, profile_update — user profile read/write
invoices_list now accepts optional status and clientId filters (e.g. list
all draft invoices, or all invoices for a specific client). Backed by a
new optional input on invoices.getAll in the tRPC router.
https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG
The backend now accepts invoiceId on clock-in to link a timer directly
to a specific invoice. Expose this in the MCP so AI clients can clock in
against a particular invoice rather than relying on latest-invoice lookup.
Also update time_clock_out description to reflect the new behavior.
https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG
- Remove "Time Clock" from sidebar navigation
- Redirect /dashboard/time-clock to /dashboard/invoices
- Add InvoiceTimerCard to invoice detail page (shown for non-paid invoices)
- Timer started from an invoice is explicitly linked to that invoice at clock-in
- On clock-out, time is added directly to the linked invoice as a line item
- Active timer widget on dashboard now shows which invoice is being tracked
- Backend: clockIn accepts invoiceId; clockOut prefers explicit invoiceId over
searching for the latest draft invoice for the client
https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG
- New beenvoice_time_entry DB table with migration (startedAt/endedAt, hours, rate, clientId)
- tRPC router with clockIn, clockOut, getRunning, getAll, getSummary, create, update, delete
- Dashboard page at /dashboard/time-clock with live elapsed timer, entry list, and manual entry form
- 5 MCP tools: time_clock_in, time_clock_out, time_get_running, time_entries_list, time_entries_create
- Sidebar navigation entry
Timer state is stored in PostgreSQL (endedAt IS NULL = running), suitable for serverless/Coolify deployment.
- Add taxDeductible boolean to expenses schema + migration 0002
- Update expenses router, form, and list to support tax-deductible flag
- Fix invoice-view tax calculation (was hardcoded $0.00; now uses taxRate)
- New Tax Summary tab in Reports: year selector, income/deductions breakdown,
SE tax + federal income estimates, quarterly bar chart
- CSV export for accountant with income + expense rows and tax summary
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
The previous baseline blindly recorded all migrations as applied.
Now on startup the script validates every recorded migration against
the actual schema; any entry whose schema changes don't exist is
deleted so migrate() will re-run that migration.
This unblocks the existing deployment where 0001 was recorded as done
but beenvoice_client.currency was never actually added.
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
Previously the baseline marked ALL migrations as done, causing 0001 to
be skipped even on databases that didn't have the currency column yet.
Now each migration is checked against a sentinel column/table before
being seeded into the tracking table. Migrations whose changes don't
exist yet are left out so migrate() runs them normally.
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
When switching from db:push to db:migrate on an existing database,
the migration table is empty so Drizzle tries to re-run all migrations,
failing with "relation already exists".
Detect this case (tables exist but no migration history) and seed the
__drizzle_migrations tracking table with all current migrations so
Drizzle treats them as already applied. Future migrations run normally.
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
- Remove drizzle/*.sql and drizzle/*-journal from .dockerignore so
migration files are included in the Docker build context
- Restore next/font/google imports (removed prematurely due to local
IP being 403'd by Google Fonts; production builds should work fine)
- Update CSS font fallbacks to use proper system font stacks
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
- Move EXPENSE_CATEGORIES to ~/lib/expense-categories.ts to break
server router import chain from client component
- Use inline import() types in trpc/react.tsx to prevent Turbopack
from including server modules (pg, db) in the client bundle
- Replace next/font/google with system font stacks to fix build
failures in environments without Google Fonts access
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
Migrations:
- drizzle.config.ts: add out: './drizzle' so drizzle-kit generate writes
SQL migration files instead of only supporting push
- drizzle/0000_glossy_magneto.sql: initial migration capturing all 9
current tables (users, accounts, sessions, verification_tokens,
sso_providers, clients, businesses, invoices, invoice_items)
- src/server/db/migrate.ts: programmatic runner using drizzle-orm's
migrate() — tracks applied migrations in __drizzle_migrations,
safe to run on every deploy
- package.json: db:migrate now runs the programmatic runner instead of
drizzle-kit migrate (CLI requires devDeps at runtime)
- start.sh: replace drizzle-kit push with bun src/server/db/migrate.ts
- Dockerfile: copy drizzle/ folder into the runner image so migrations
are available at container startup
Mobile fixes:
- data-table.tsx: pagination buttons grow from 32px to 40px on mobile
(h-10 w-10 md:h-8 md:w-8) to meet 44px touch-target guidelines
- floating-action-bar.tsx: stack left-content + action buttons to column
layout on narrow screens (flex-col sm:flex-row), reduce padding on
mobile (p-3 sm:p-4)
- revenue-chart.tsx: responsive chart height (h-48 md:h-64) so the chart
doesn't consume too much vertical space on small screens
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
- README: fix auth (better-auth), database (PostgreSQL), env vars,
Docker setup, and feature list to reflect actual implementation
- InvoicesDataTable: show status badge + amount inline on mobile
(previously hidden behind sm: breakpoint, leaving mobile users
with no financial or status info at a glance)
- InvoiceItemsTable: hide Date/Hours/Rate columns on mobile and
fold that info into the Description cell as secondary text
- invoice-view.tsx header card: wrap to column layout on mobile
so status/amount/button don't overflow narrow screens; also
improve item rows to show date, hours, and rate as subtext
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi