Endpoints
endpoint describes how UI operations map to backend routes.
Endpoint schema does not move business logic into the frontend. It only tells FluiKit where an operation should send or load data.
String endpoint
Use a string endpoint for simple resources.
schemas/users/users.schema.ts
export const usersSchema = {
version: "1.0.0",
resource: "users",
endpoint: "/api/users",
table: {
mode: "server",
columns: ["name", "email"]
}
} as const;Endpoint map
Use an endpoint map when operations need different URLs or methods.
schemas/users/users.schema.ts
export const usersSchema = {
version: "1.0.0",
resource: "users",
identity: {
key: "id",
param: "id"
},
endpoint: {
list: { url: "/api/users", method: "GET" },
detail: { url: "/api/users/:id", method: "GET" },
create: { url: "/api/users", method: "POST" },
update: { url: "/api/users/:id", method: "PATCH" },
delete: { url: "/api/users/:id", method: "DELETE" },
archive: { url: "/api/users/:id/archive", method: "POST" },
options: { url: "/api/roles/options", method: "GET" }
}
} as const;Endpoint item
Endpoint items can be strings or objects.
schemas/users/endpoints.ts
export const stringEndpoint = "/api/users";schemas/users/endpoints.ts
export const objectEndpoint = {
url: "/api/users",
method: "GET",
headers: {
"Accept": "application/json"
},
query: {
include: "role"
}
} as const;Endpoint placeholders
Use placeholders with identity.
schemas/users/delete-endpoint.schema.ts
export const deleteEndpointSchema = {
version: "1.0.0",
resource: "users",
identity: {
key: "id",
param: "id"
},
endpoint: {
delete: { url: "/api/users/:id", method: "DELETE" }
}
} as const;When the selected row is { "id": "user_1" }, /api/users/:id resolves to /api/users/user_1.
Server-side table query
Server-side table schemas may use search, filter, sort, and pagination config to build query parameters.
schemas/users/server-table.schema.ts
export const serverTableSchema = {
version: "1.0.0",
resource: "users",
endpoint: "/api/users",
table: {
mode: "server",
search: {
enabled: true,
param: "q"
},
pagination: {
enabled: true,
pageParam: "page",
pageSizeParam: "pageSize"
},
sort: {
enabled: true,
defaultKey: "name",
defaultDirection: "asc"
},
columns: ["name", "email", "status"]
}
} as const;Response contract
{
"status": true,
"code": 200,
"message": "Users loaded",
"data": [],
"pagination": {
"page": 1,
"pageSize": 10,
"total": 0
}
}Demo safety
Use mock data and static response examples for demos. Examples should not create real backend services.