Skip to content

Latest commit

 

History

History
171 lines (123 loc) · 3.9 KB

File metadata and controls

171 lines (123 loc) · 3.9 KB

API Reference

Base URL: http://localhost:5000/api

All endpoints accept and return JSON unless otherwise noted.


Clients

GET /api/clients

Returns all clients.

Response: 200 OK

[
  { "id": 1, "name": "John Doe", "email": "john@example.com", "company": "Acme Ltd", "created_at": "..." }
]

POST /api/clients

Create a new client.

Body:

Field Type Required
name string Yes
email string No
company string No

Response: 200 OK — Returns the created client with id.


Projects

GET /api/projects

Returns all projects with joined clientName.

POST /api/projects

Create a new project.

Body:

Field Type Required
clientId integer Yes
name string Yes
description string No
status string No

Status values: active (default), completed, on-hold

PUT /api/projects/:id

Update an existing project. Same body as POST.


Invoices

GET /api/invoices

Returns all invoices with projectName, clientName, clientEmail, and nested items array.

POST /api/invoices

Create a new invoice with line items.

Body:

Field Type Required
projectId integer Yes
amount number Yes
status string No
dueDate string No
notes string No
items array No

Item object:

Field Type Required
description string Yes
quantity number Yes
unitPrice number Yes
total number Yes

Status values: draft (default), sent, paid, cancelled

PUT /api/invoices/:id

Update an existing invoice. If items array is provided, existing items are replaced.

Additional fields for status tracking:

Field Type Description
sentAt string Date invoice was sent
paidAt string Date invoice was paid

GET /api/invoices/:id/pdf

Download the invoice as a PDF file.

Response: application/pdf — Branded Astrium invoice document.


Todos (Tasks)

GET /api/todos

Returns all tasks with projectName, ordered by creation date (newest first).

POST /api/todos

Create a new task.

Body:

Field Type Required
projectId integer No
task string Yes
description string No
startDate string No
endDate string No

PATCH /api/todos/:id

Toggle task status.

Body:

Field Type Required
status string Yes

Status values: pending, completed


Meetings

GET /api/meetings

Returns all meetings with projectName, ordered by date (newest first).

POST /api/meetings

Create a new meeting record.

Body:

Field Type Required
projectId integer No
title string Yes
date string Yes
duration string No
participants string No
notes string No

Notes support Markdown formatting.


Inbox

GET /api/inbox

Returns the current inbox content.

Response:

{ "content": "# My Notes\n..." }

POST /api/inbox

Update inbox content (overwrites the single document).

Body:

Field Type Required
content string Yes

Content supports Markdown formatting.