- Base URL:
VITE_API_URLif set; otherwise by frontend hostname:http://localhost:8080/api(local),https://api.jobrythm.aricummings.com/api(aricummings),https://api.jobrythm.com/api(production). Seesrc/api/hosts.ts. - No MSW or mock API; all traffic hits a real backend.
- Docker: the image is built with
VITE_API_URL=/api. SetAPI_URLto1,2, or3indocker-compose.ymlto choose the nginx proxy target (see comments there). - Auth: bearer token is attached by
src/api/client.ts - Refresh: automatic single-flight refresh on near-expiry and
401replay - Errors: all Axios errors normalized to
ApiErrorinsrc/api/errors.ts
- Auth (
/login,/register)POST /api/auth/loginPOST /api/auth/registerPOST /api/auth/refreshPOST /api/auth/logout
- Settings/Profile (
/settings)GET /api/users/mePUT /api/users/mePOST /api/users/me/logoPOST /api/billing/checkoutPOST /api/billing/portal
- Clients (
/clients,/clients/:id)GET /api/clientsGET /api/clients/{id}POST /api/clientsPUT /api/clients/{id}DELETE /api/clients/{id}
- Jobs (
/jobs,/jobs/:id,/jobs/:id/edit)GET /api/jobsGET /api/jobs/{id}POST /api/jobsPUT /api/jobs/{id}PATCH /api/jobs/{id}/statusDELETE /api/jobs/{id}
- Line Items (job detail line-item tab)
POST /api/jobs/{jobId}/line-itemsPUT /api/line-items/{id}DELETE /api/line-items/{id}
- Quotes (
/quotes,/quotes/:id, job quote tab)GET /api/quotesGET /api/quotes/{id}POST /api/jobs/{jobId}/quotesPUT /api/quotes/{id}GET /api/quotes/{id}/pdfPOST /api/quotes/{id}/send
- Invoices (
/invoices,/invoices/:id, job invoice tab)GET /api/invoicesGET /api/invoices/{id}POST /api/jobs/{jobId}/invoicesPUT /api/invoices/{id}PATCH /api/invoices/{id}/paidGET /api/invoices/{id}/pdfPOST /api/invoices/{id}/send
- Dashboard (
/dashboard)GET /api/dashboard
- List endpoints are now treated as paginated (
{ items, page, pageSize, total }). - Dashboard response supports both direct stats payloads and wrapped widget/data payloads.
- When backend payloads differ, update
src/api/types.tsfirst and keep feature hooks typed against shared DTOs.