🚀 Fettle OS Backend API
Production-ready Node.js Express API
Checking health...
✨ Status
Server Status: Loading...
API Version: -
🛠️ Tech Stack
Framework
Express.js 4.18
Authentication
Azure AD / JWT
📚 Available Endpoints
60+ RESTful endpoints for managing properties, tenants, maintenance, accounting, and more.
Health & Diagnostics No auth required
GET/healthServer heartbeat
GET/api/healthAPI health + Prisma connectivity
GET/startupStartup diagnostics and env checks
GET/dbtestDatabase reachability test
Authentication
GET/auth/configAzure AD tenant + client configuration
Properties
GET/api/propertiesList all properties with related data
GET/api/properties/:idRetrieve a single property
POST/api/propertiesCreate property
PUT/api/properties/:idUpdate property details
GET/api/properties/:propertyId/unitsList units for multi-unit assets
POST/api/properties/:propertyId/unitsAdd a unit to a property
PUT/api/properties/:propertyId/units/:idUpdate a specific unit
Tenants
GET/api/tenantsList all tenants
GET/api/tenants/:idGet tenant profile
POST/api/tenantsCreate tenant
PUT/api/tenants/:idUpdate tenant
Maintenance
GET/api/maintenanceList maintenance requests
GET/api/maintenance/:idGet maintenance request
POST/api/maintenanceCreate maintenance request
PUT/api/maintenance/:idUpdate maintenance request
Owners & Entities
GET/api/ownersList all owners
POST/api/ownersCreate owner
PUT/api/owners/:idUpdate owner
GET/api/legal-entitiesList legal entities
POST/api/legal-entitiesCreate legal entity
PUT/api/legal-entities/:idUpdate legal entity
Users & Roles
GET/api/users/meCurrent authenticated user
GET/api/usersList users (admin)
PUT/api/users/:id/roleUpdate user role
PUT/api/users/:id/statusActivate / deactivate user
Vendors & Payments
GET/api/vendorsList vendors
POST/api/vendorsCreate vendor
PUT/api/vendors/:idUpdate vendor
GET/api/paymentsList payments
POST/api/paymentsRecord payment
Communications
GET/api/communicationsList communications
POST/api/communicationsCreate communication entry
PUT/api/communications/:idUpdate communication
HOA & ARC
GET/api/hoaList HOA records
PUT/api/hoa/:idUpdate HOA
GET/api/hoa/violationsList HOA violations
POST/api/hoa/violationsCreate violation
PUT/api/hoa/violations/:idUpdate violation
GET/api/hoa/arcList ARC requests
POST/api/hoa/arcCreate ARC request
PUT/api/hoa/arc/:idUpdate ARC request
Tasks
GET/api/tasksList custom tasks
POST/api/tasksCreate task
PUT/api/tasks/:idUpdate task
DELETE/api/tasks/:idDelete task
Accounting & Financial Reports
POST/api/accounting/reconcileReconcile Mercury transactions
GET/api/accounting/chart-of-accountsList accounts
POST/api/accounting/chart-of-accountsCreate account
PUT/api/accounting/chart-of-accounts/:idUpdate account
GET/api/accounting/transactionsList transactions
POST/api/accounting/transactionsCreate transaction
PUT/api/accounting/transactions/:idUpdate transaction
GET/api/accounting/budgetsList budgets
POST/api/accounting/budgetsCreate budget
PUT/api/accounting/budgets/:idUpdate budget
GET/api/accounting/reports/profit-lossProfit & Loss report
GET/api/accounting/reports/balance-sheetBalance Sheet report
GET/api/accounting/reports/cash-flowCash Flow report
GET/api/reports/income-statementGlobal income statement
GET/api/reports/balance-sheetGlobal 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
- ✓ Full CRUD operations for all resources
- ✓ Azure AD authentication with JWT tokens
- ✓ Request/response logging with Morgan
- ✓ Security headers with Helmet.js
- ✓ CORS support for frontend integration
- ✓ Graceful shutdown handling
- ✓ Comprehensive error handling
- ✓ Database schema with Prisma
Fettle OS Backend API v1.0.0 | © 2025 Fettle Capital Corporation