Architecture
API Conventions
How every route is named and which method it takes.
Every route a Crudy app serves follows the same rules, so a client can guess a path before reading its reference. The API is versioned as a whole: every path is also served under /v1, and each response names the version in Crudy-Api-Version.
Paths
- Domains. The first segment is the domain, one per module or framework area:
/alerts,/assets,/phishings,/emails. Everything a module serves lives under its domain. - Nouns. Segments are plural nouns in kebab-case:
/alerts/responses,/emails/layouts. Parameters are ids:/alerts/responses/{id}. - Nesting. A resource that belongs to another nests under it:
/alerts/responses/{id}/replies.
Methods
| Method | Meaning |
|---|---|
GET | Reads. Never changes anything and never ends in a verb. |
POST | Creates, or runs an action named by a trailing verb: /access-reviews/{id}/close. |
PATCH | Updates part of a record. |
PUT | Replaces a whole thing: a settings singleton, a list. |
DELETE | Deletes. |
A query without side effects is a GET with its parameters in the query string: GET /search?p_q=vpn. A query whose parameters do not fit a query string is a POST to a query or preview noun.
Enforced at boot
The backend refuses to start when a route has a segment that is not lowercase kebab-case or a parameter, or when a GET ends in a verb (routes_unconventional). Protocol paths keep the shape their protocol sets: /.well-known/* and the container registry's /v2/*.