🚀 Fettle OS Backend API

Production-ready Node.js Express API

Checking health...

✨ Status

Server Status: Loading...

API Version: -

🛠️ Tech Stack

Runtime
Node.js 24.x
Framework
Express.js 4.18
Language
TypeScript 5.0
Database ORM
Prisma 5.10
Authentication
Azure AD / JWT
Security
Helmet.js, CORS

📚 Available Endpoints

60+ RESTful endpoints for managing properties, tenants, maintenance, accounting, and more.

Health & Diagnostics No auth required
GET/health
Server heartbeat
GET/api/health
API health + Prisma connectivity
GET/startup
Startup diagnostics and env checks
GET/dbtest
Database reachability test
Authentication
GET/auth/config
Azure AD tenant + client configuration
Properties
GET/api/properties
List all properties with related data
GET/api/properties/:id
Retrieve a single property
POST/api/properties
Create property
PUT/api/properties/:id
Update property details
GET/api/properties/:propertyId/units
List units for multi-unit assets
POST/api/properties/:propertyId/units
Add a unit to a property
PUT/api/properties/:propertyId/units/:id
Update a specific unit
Tenants
GET/api/tenants
List all tenants
GET/api/tenants/:id
Get tenant profile
POST/api/tenants
Create tenant
PUT/api/tenants/:id
Update tenant
Maintenance
GET/api/maintenance
List maintenance requests
GET/api/maintenance/:id
Get maintenance request
POST/api/maintenance
Create maintenance request
PUT/api/maintenance/:id
Update maintenance request
Owners & Entities
GET/api/owners
List all owners
POST/api/owners
Create owner
PUT/api/owners/:id
Update owner
GET/api/legal-entities
List legal entities
POST/api/legal-entities
Create legal entity
PUT/api/legal-entities/:id
Update legal entity
Users & Roles
GET/api/users/me
Current authenticated user
GET/api/users
List users (admin)
PUT/api/users/:id/role
Update user role
PUT/api/users/:id/status
Activate / deactivate user
Vendors & Payments
GET/api/vendors
List vendors
POST/api/vendors
Create vendor
PUT/api/vendors/:id
Update vendor
GET/api/payments
List payments
POST/api/payments
Record payment
Communications
GET/api/communications
List communications
POST/api/communications
Create communication entry
PUT/api/communications/:id
Update communication
HOA & ARC
GET/api/hoa
List HOA records
POST/api/hoa
Create HOA
PUT/api/hoa/:id
Update HOA
GET/api/hoa/violations
List HOA violations
POST/api/hoa/violations
Create violation
PUT/api/hoa/violations/:id
Update violation
GET/api/hoa/arc
List ARC requests
POST/api/hoa/arc
Create ARC request
PUT/api/hoa/arc/:id
Update ARC request
Tasks
GET/api/tasks
List custom tasks
POST/api/tasks
Create task
PUT/api/tasks/:id
Update task
DELETE/api/tasks/:id
Delete task
Accounting & Financial Reports
POST/api/accounting/reconcile
Reconcile Mercury transactions
GET/api/accounting/chart-of-accounts
List accounts
POST/api/accounting/chart-of-accounts
Create account
PUT/api/accounting/chart-of-accounts/:id
Update account
GET/api/accounting/transactions
List transactions
POST/api/accounting/transactions
Create transaction
PUT/api/accounting/transactions/:id
Update transaction
GET/api/accounting/budgets
List budgets
POST/api/accounting/budgets
Create budget
PUT/api/accounting/budgets/:id
Update budget
GET/api/accounting/reports/profit-loss
Profit & Loss report
GET/api/accounting/reports/balance-sheet
Balance Sheet report
GET/api/accounting/reports/cash-flow
Cash Flow report
GET/api/reports/income-statement
Global income statement
GET/api/reports/balance-sheet
Global balance sheet

📖 Documentation & Resources

# Test the API with curl curl -X GET http://localhost:3001/health # Response { "status": "OK", "timestamp": "2025-11-25T..." }

🚀 Getting Started

Local Development:

npm install npm run dev

Production Build:

npm run build npm start

Environment Variables:

PORT=3001 NODE_ENV=production AZURE_AD_TENANT_ID=your-tenant-id AZURE_AD_CLIENT_ID=your-client-id DATABASE_URL=your-database-url

✅ Features

Fettle OS Backend API v1.0.0 | © 2025 Fettle Capital Corporation