Commit Graph
178 Commits
Author SHA1 Message Date
soconnorandClaude Sonnet 5 d589b94580 Make CRON_SECRET optional; fix docker env validation failure
CRON_SECRET was required (min 32 chars) in production by env.js, but
neither docker-compose.yml nor docker-compose.coolify.yml passed it
through. Since the release container isn't covered by
SKIP_ENV_VALIDATION (build-stage only), bun run start failed env
validation on every docker deploy unless CRON_SECRET was manually
configured — even though it only gates the optional recurring-invoice
cron endpoint, which already handles being unset gracefully.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-01 14:43:20 -04:00
soconnor da219b287e Support mobile home and live activity data 2026-07-01 02:55:16 -04:00
soconnor 316edb4b3e Prefer mobile auth cookie for app requests 2026-06-29 22:01:41 -04:00
soconnor 8866335c50 Accept mobile Better Auth session token header 2026-06-29 18:38:35 -04:00
soconnor fb731885de Support chunked Better Auth session cookies 2026-06-29 17:57:38 -04:00
soconnor 1605322bc9 Improve expense dialog button layout 2026-06-29 15:30:19 -04:00
soconnor ef826dffa9 Harden auth and mobile session handling 2026-06-29 15:21:31 -04:00
soconnor d0c916d659 Polish expenses dashboard 2026-06-29 01:30:20 -04:00
soconnor 122a3c64f5 Refactor Coolify deployment from MinIO to Garage
- Updated README and documentation to reflect the transition from MinIO to Garage for S3-compatible storage.
- Removed the MinIO-specific docker-compose files and replaced them with Garage configurations.
- Adjusted environment variables and service dependencies in docker-compose files to accommodate Garage.
- Modified application code to log hints for Garage instead of MinIO.
- Ensured all references to MinIO in the codebase and documentation are replaced with Garage.
2026-06-29 00:59:27 -04:00
soconnorandCursor 31151e7f39 Sync time entries with invoice lines and harden auth for mobile.
Link clocked time to invoice items with bidirectional sync, add entry editing on web, broaden session cookie detection for Expo clients, and handle API rate limits without signing users out.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 21:44:19 -04:00
soconnorandCursor c267b3e1c8 Improve expenses receipts UX and Coolify MinIO deployment.
Extract receipt UI components, add view/edit/create dialog modes with list receipt previews, add docker-compose.coolify.yml and clearer COOLIFY/S3 path-style guidance for Application + MinIO setups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 00:47:59 -04:00
soconnor 5e6e51337a enable react compiler 2026-06-27 00:05:42 -04:00
soconnor b9a9b813d2 add receipts support 2026-06-26 23:07:43 -04:00
soconnorandCursor 85df7c4627 Default signups off, improve Docker deploy, fix onboarding step UI.
Show a disabled-registration state on the register page when DISABLE_SIGNUPS is true (default), document docker-deploy.sh with git-SHA image tags, and align onboarding progress circles and labels on a shared grid.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 13:14:25 -04:00
soconnorandCursor 6b73c32c25 Add bulk invoice import with templates and refresh import UX
Move invoice import configuration into settings, redesign the import flow with shared components and sample templates, document the demo account in README, and polish upload and button styling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 12:39:46 -04:00
soconnorandCursor 5978c8d903 Fix opengraph image prerender so production builds succeed.
Drop file fetches and embedded fonts that fail during static OG generation; use default ImageResponse typography instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 03:45:51 -04:00
soconnorandCursor 3fb61ff4dd Polish onboarding, invoices, and time clock while promoting the first registrant to admin.
Refresh onboarding wizard and shell, tighten invoice edit/detail flows, align timer widgets with the redesigned clock panel, and assign admin role on first signup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 03:40:25 -04:00
soconnorandCursor c53f2e6c4d Unify the dashboard experience and retire the multi-theme engine so onboarding and day-to-day invoicing feel consistent and easier to maintain.
Shared layout, tabs, and sidebar timer; user onboarding and registration polish; settings danger zone and data export; chart and tRPC perf fixes; migrations for onboarding and dropped appearance columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 03:08:22 -04:00
soconnorandCursor 6ec26a4a0d Redesign marketing pages and isolate public routes from app auth.
Give the landing, legal, and sign-in flows a consistent product shell while keeping marketing pages free of tRPC/session calls, fixing dev auth URL handling, and refreshing env and deploy docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 02:00:06 -04:00
soconnorandCursor 158b9416bf Fix Docker signup and document deploy, migrate, and rebuild flow.
Use FormData and server-side sign-in after register, trust proxy origins for reverse-proxy deploys, pass public URL build args in Docker, and clarify that git pull plus up -d --build is required to ship code and run pending migrations.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 01:06:10 -04:00
soconnor eb9548b832 fix the shit 2026-06-26 00:12:09 -04:00
soconnorandCursor af1f4a5721 Fix signup by using better-auth signUp and clearer register errors.
Route web registration through authClient.signUp.email, set explicit better-auth baseURL/secret for Docker, and harden the mobile register API with safeParse and readable validation messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 00:00:29 -04:00
soconnorandCursor 463b1f503e Fix Docker signup, refresh docs, and improve blank invoice flow.
Parse DISABLE_SIGNUPS and related env booleans correctly for Compose string values, and derive auth trustedOrigins from BETTER_AUTH_URL. Rewrite README and architecture docs with the git.soconnor.dev remote and accurate deployment guidance. Allow zero-line-item draft invoices with validation when sending email.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 23:45:57 -04:00
soconnorandCursor 480c50981d Unify entities navigation, redesign time clock, and add invoice PDF preview.
Combine clients and businesses under entities, polish the web time clock,
and show live invoice PDF preview with tighter line-item editing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 01:08:23 -04:00
soconnorandCursor 1928084acb Add draft-only invoicing rules, send reminders, and time clock billing.
Restrict line item edits to draft invoices, auto-create drafts on clock-out,
and add sendReminderAt scheduling with dashboard due reminders.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 16:06:11 -04:00
soconnorandCursor 4cd8ad3c4c Redesign legal pages with readable paragraph layout and updated contact info.
Privacy Policy and Terms now share a document layout with table of contents,
plain-paragraph copy, and beenvoice.soconnor.dev contact details for App Store review.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 02:44:43 -04:00
soconnorandCursor 5019a7597d Expose public auth capabilities endpoint for mobile SSO detection.
Returns whether Authentik and signups are enabled so the app can show the right
sign-in options per instance at runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 02:27:31 -04:00
soconnor 40020b78f8 fix: auth lock privacy 2026-06-18 01:45:18 -04:00
soconnorandCursor 69da2bf71d Add shared legal pages and wire Privacy Policy and Terms across the app.
Extract privacy and terms content into reusable components, replace auth modals with links to /privacy and /terms, add settings legal section, and remove duplicate legal-modal markup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 01:33:34 -04:00
soconnorandCursor 5c28b33e9f Unify time tracking on server-backed entries with updateRunning.
Consolidates dashboard and invoice timers onto shared time-entry APIs so clock-in state, invoice linking, and clock-out flow stay consistent across surfaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 22:36:39 -04:00
soconnorandCursor 81a0ce33a4 Add better-auth Expo plugin for mobile app authentication.
Enable session-based auth from the Expo companion app via SecureStore cookies and trusted deep-link origins.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 15:56:53 -04:00
soconnor 190fbd433b fix: sort chronologically 2026-06-12 00:11:00 -04:00
soconnor 94e0a18bf5 fix: missing publicTokenExpiresAt 2026-06-11 12:19:13 -04:00
soconnor 48d3335f12 fix: auth redir memoization 2026-06-11 12:09:22 -04:00
soconnor 1c24c90189 fix: build errors 2026-06-11 12:01:19 -04:00
Claude b10cf5dd2e Force dynamic rendering for all dashboard pages
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
2026-06-11 06:18:00 +00:00
Claude 9c135d3289 Fix ESLint type import and add better-auth to serverExternalPackages
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
2026-06-11 05:45:55 +00:00
Claude e03c553b7f Add temporary PDF preview links via public token TTL
- 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
2026-06-11 05:37:17 +00:00
Claude c0a333710f Complete MCP coverage: 58 tools, invoice filters, templates, email config, profile
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
2026-06-11 05:33:13 +00:00
Claude c6b6641dfa Expand MCP from 24 to 49 tools — full coverage of all major features
New tools added:

Expenses (5): expenses_list, expenses_get, expenses_create,
expenses_update, expenses_delete

Recurring invoices (7): recurring_list, recurring_create,
recurring_update, recurring_pause, recurring_resume,
recurring_generate_now, recurring_delete

Dashboard (1): dashboard_get_stats — revenue, pending, overdue,
client count, MoM change, 6-month chart, recent invoices

Invoice extras (8): invoices_get_current_open, invoices_send (email
with PDF attachment), invoices_send_reminder, invoices_generate_public_token,
invoices_revoke_public_token, invoices_bulk_update_status,
invoices_bulk_delete

New Zod schemas and JSON schemas for all added tools.

https://claude.ai/code/session_014126WHVRT8mftmqkU6dajG
2026-06-11 05:30:16 +00:00
Claude 868c34f005 Expose invoiceId in MCP time_clock_in tool
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
2026-06-11 05:11:54 +00:00
Claude feb8f36ce7 Integrate time clock directly into invoices, remove standalone page
- 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
2026-06-11 00:23:50 +00:00
soconnorandClaude Sonnet 4.6 9762ede7ec feat: show live estimated hours/earnings while timer is running
Summary cards now include the in-progress session's hours and earnings,
rounded up to the nearest 15-min increment (matching clock-out billing
logic). A secondary "+Xh est." line appears below each stat when a timer
is active, updating every second as the elapsed counter ticks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 18:54:05 -04:00
soconnorandClaude Sonnet 4.6 2b4608bfb4 feat: add missing MCP tools and fix undefined content response
- Add time_entries_update, time_entries_delete, time_entries_get_summary tools
- Fix textResult to use `data ?? null` so JSON.stringify always returns a
  string — procedures returning undefined (e.g. getRunning with no timer,
  businesses.getById not found) were dropping the text field from the MCP
  content item, causing client SDK validation failures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 18:46:30 -04:00
soconnorandClaude Sonnet 4.6 839016532c fix: move ssr:false dynamic imports into client component
Turbopack disallows ssr:false in Server Components. Extracted the three
recharts dynamic imports into charts-client.tsx ("use client"), which
page.tsx now imports from directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 18:26:42 -04:00
soconnorandClaude Sonnet 4.6 b1f0c98fdd fix: use node standalone server instead of next start
Dynamically import recharts components with ssr:false to prevent
server-side rendering of DOM-dependent charts, eliminating the
width/height -1 warnings and redacted SSR errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 18:24:59 -04:00
soconnorandClaude Sonnet 4.6 d2f39bfc35 refactor: replace custom migrate.ts with standard Drizzle migrator
The baseline/bogus-entry logic was a one-time workaround for a db:push
→ migration transition that is long past. It required a per-migration
isMigrationApplied case — missing cases caused today's invoiceId bug.
Now both db:migrate (dev) and Docker startup use the same standard
migrate() call. Drizzle's own tracking table handles idempotency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 18:12:01 -04:00
soconnorandClaude Sonnet 4.6 960f0c2d17 fix: add isMigrationApplied cases for migrations 0009–0012
Baseline logic was falling through to false for all migrations after
0008, causing incorrect behaviour on fresh deploys. Now correctly
detects api_keys table, time_entry table, invoiceId column, and
verification token value column type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 18:07:35 -04:00
soconnorandClaude Sonnet 4.6 ef94b69e52 feat: show active timer on dashboard homepage with clock-out button
Adds a banner below the page header when a timer is running: shows
description, client, elapsed time (live), a Stop button that auto-links
to the latest invoice, and a Details link to the time clock page.
Query is prefetched server-side so the widget is instant on load.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 18:05:54 -04:00
soconnorandClaude Sonnet 4.6 d9e2bab779 feat: time clock links to latest client invoice + fix SSO verification token overflow
- Clock out and manual entry creation now auto-add a line item to the
  client's latest draft/sent invoice and return invoice info
- Time clock page shows invoice badge on each entry with a link
- Toast after clock-out/create includes "View Invoice" action when linked
- MCP time_clock_in now accepts optional startedAt for backdating
- MCP time_clock_out description updated to document invoice linking
- Migration 0012: widen beenvoice_verification_token.value to text to
  fix varchar(255) overflow during Authentik PKCE OAuth flow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 17:55:26 -04:00