The Ferreandina NoSQL REST API is a Java 21 backend built with Javalin 7, backed by MongoDB. All routes are mounted under theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/ferreandina-nosql/llms.txt
Use this file to discover all available pages before exploring further.
/api prefix, the server listens on port 7070, and CORS is globally enabled for all origins via it.anyHost() in App.java. Standard CRUD operations are wired through Javalin’s CrudHandler pattern, which maps HTTP verbs to collection-level and document-level actions automatically. In addition to CRUD, several resources expose custom aggregation endpoints for analytics — see the Advanced Queries page for details.
Base URL
The port is hardcoded as
7070 in App.java. To use a different port,
change the argument passed to .start(7070) in the main method and restart
the server.Authentication
This version of the API has no authentication layer. All endpoints are
publicly accessible without tokens, API keys, or sessions. The API is
intended for local development and academic use only — do not expose it on a
public network without adding your own security layer.
Response Format
All responses are produced byResultUtil, a shared utility class that serialises every result into a consistent JSON envelope. This means you can rely on the same top-level keys regardless of which resource or operation you are calling.
List and single-document responses include a data array, a human-readable message, the HTTP status code, and a size count of items in data:
data contains a single object with either an update_count or a delete_count key rather than document records:
error object with the exception details:
HTTP Methods
All seven resources are registered with Javalin’scrud() helper, which automatically binds the following HTTP method/path combinations to handler methods:
| Method | Path | Action |
|---|---|---|
GET | /api/{resource} | List all documents |
GET | /api/{resource}/{id} | Get one document by integer _id |
POST | /api/{resource} | Create a new document |
PATCH | /api/{resource}/{id} | Partial update by _id |
DELETE | /api/{resource}/{id} | Delete by _id |
Available Resources
Branches
Manage store branches. Each branch embeds its own products array.
Route prefix:
/api/branchesProducts
Global product catalogue. Supports filtering by category.
Route prefix:
/api/productsCategories
Product category definitions used to group products.
Route prefix:
/api/categoriesSuppliers
Supplier company records linked to supply transactions.
Route prefix:
/api/suppliersSupplies
Individual supply (inbound shipment) records, including defective quantity tracking.
Route prefix:
/api/suppliesCustomers
Customer account records.
Route prefix:
/api/customersWorkers
Employee/worker records assigned to branches.
Route prefix:
/api/workersContent Type
Every request body and every response body usesapplication/json. Always set the Content-Type header when sending data:
IDs
All_id values in the MongoDB collections are plain integers, not BSON ObjectId strings. When a route contains an {id} path parameter, pass the integer directly:
Error Responses
When an unhandled exception is thrown inside a controller method, it is caught and forwarded toResultUtil.javalinReturn(ctx, e). The server responds with HTTP 500 and a JSON body containing a nested error object:
{id} path parameter, or referencing a document _id that does not exist in the collection.