Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DragonesMagicos/ferromax_v0.8/llms.txt

Use this file to discover all available pages before exploring further.

All Ferromax ERP backend configuration is managed through a single file: src/main/resources/application.properties. Every category of settings — from the HTTP port to the OCR integration key — lives here. This page catalogs every property, its default value, and when you should change it.

Server

The embedded Tomcat server is pre-configured to expose the API under the /api context path on port 8081. Response compression is enabled by default to reduce bandwidth for JSON and HTML payloads.
PropertyDefaultDescription
server.port8081The TCP port the application listens on. Change this if 8081 conflicts with another local service.
server.servlet.context-path/apiAll endpoints are prefixed with this path. For example, the login endpoint resolves to http://localhost:8081/api/auth/login.
server.compression.enabledtrueEnables GZIP compression for responses whose Content-Type matches application/json, application/xml, text/html, or text/plain.

WebSocket / STOMP

Ferromax ERP uses STOMP over SockJS for real-time features such as low-stock alerts and live dashboard updates. The app.websocket.* properties in application.properties document the intended topology of the WebSocket broker. Note that WebSocketConfig.java currently uses a hardcoded .setAllowedOriginPatterns("*") for the SockJS endpoint — the app.websocket.allowed-origins property is defined in application.properties but is not yet injected into WebSocketConfig.java.
PropertyDefaultDescription
app.websocket.endpoint/wsThe SockJS handshake endpoint. The full URL in development is http://localhost:8081/ws.
app.websocket.topic-prefix/topicPrefix for server-to-client broadcast destinations (e.g., /topic/alertas).
app.websocket.app-prefix/appPrefix for client-to-server message destinations handled by @MessageMapping controllers.
app.websocket.allowed-originshttp://localhost:3000,http://localhost:4200,http://localhost:5173,http://localhost:5174,http://localhost:5175Intended comma-separated list of origins permitted to open a WebSocket connection. The frontend .env also exposes VITE_WS_URL=http://localhost:8081/ws for the client-side connection string.
WebSocketConfig.java currently calls .setAllowedOriginPatterns("*"), which allows WebSocket connections from any origin. Before deploying to production, wire app.websocket.allowed-origins into WebSocketConfig.java via @Value and replace the wildcard with that explicit list to restrict WebSocket access to known frontend origins only.

Caching

Ferromax uses Caffeine as its in-memory cache provider. The product catalog and category trees are cached to avoid redundant database round-trips on every page load.
PropertyDefaultDescription
spring.cache.typecaffeineSelects the Caffeine cache implementation.
spring.cache.caffeine.specmaximumSize=500,expireAfterWrite=600sThe cache policy applied to all named caches: up to 500 entries, each expiring 10 minutes after it was last written.
Once an entry expires, the next request for that data triggers a fresh database query and repopulates the cache. No manual cache invalidation is required for normal catalog updates.

OCR Integration

The invoice-scanning feature sends uploaded images to the OCR.space REST API and parses the resulting text to pre-fill reception forms.
PropertyDefaultDescription
ocr.space.api.keyhelloworldThe API key sent in every OCR request. The default value helloworld is OCR.space’s publicly documented free test key.
The helloworld key is rate-limited to 25,000 requests per month and is shared across all developers who use it as a demo key. For any non-trivial usage, register at ocr.space/ocrapi to obtain a dedicated free key (also 25k req/month) or a paid key with higher limits.

File Upload

These limits apply to multipart form-data requests, primarily the invoice image uploads consumed by the OCR feature.
PropertyDefaultDescription
spring.servlet.multipart.enabledtrueActivates Spring’s multipart resolver.
spring.servlet.multipart.max-file-size20MBMaximum size of a single uploaded file.
spring.servlet.multipart.max-request-size20MBMaximum total size of the entire multipart request (all parts combined).

Jackson (JSON)

Spring’s Jackson ObjectMapper is pre-configured for Argentine locale conventions and a clean JSON output.
PropertyDefaultDescription
spring.jackson.serialization.write-dates-as-timestampsfalseDates are serialized as ISO 8601 strings (e.g., 2024-08-15T10:30:00) instead of Unix millisecond integers.
spring.jackson.time-zoneAmerica/Argentina/Buenos_AiresAll date/time values are rendered in UTC-3 (Argentina Standard Time).
spring.jackson.localees_ARSets the default locale for number formatting and locale-sensitive serialization.
spring.jackson.default-property-inclusionnon_nullFields with a null value are omitted from JSON responses, keeping payloads lean.

Actuator

Spring Boot Actuator exposes operational endpoints for health checks and metrics. Only the three safest endpoints are exposed.
PropertyDefaultDescription
management.endpoints.web.exposure.includehealth,info,metricsLimits the exposed Actuator endpoints to health, application info, and JVM/HTTP metrics.
management.endpoint.health.show-detailswhen-authorizedFull datasource and disk-space details are only visible to authenticated users.
The health endpoint is available at GET http://localhost:8081/api/actuator/health and returns { "status": "UP" } when the application and database connection are healthy.

Logging

PropertyDefaultDescription
logging.level.rootINFODefault log level for all frameworks and third-party libraries.
logging.level.com.ferromaxDEBUGVerbose debug logging for all Ferromax application classes.
logging.level.org.springframework.securityINFOSpring Security logs at INFO to avoid leaking sensitive authentication detail.
logging.level.org.hibernate.SQLWARNSQL statement logging is suppressed unless there is a warning or error.
For production, set logging.level.com.ferromax=INFO to reduce log volume. The DEBUG level logs internal service method calls and is intended for local development only.
The console log pattern is:
%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n

Frontend Environment (.env)

The Vite frontend (ferromax-web/) reads its own environment file at ferromax-web/.env. This file configures the base URLs the browser uses to reach the backend.
# ferromax-web/.env
VITE_API_URL=http://localhost:8081/api
VITE_WS_URL=http://localhost:8081/ws
VariableValueDescription
VITE_API_URLhttp://localhost:8081/apiBase URL for the backend REST API. Useful for tooling, scripts, and any custom integrations that need to reference the API origin directly.
VITE_WS_URLhttp://localhost:8081/wsWebSocket endpoint URL passed to the SockJS client constructor.
In ferromax-web/src/api/axiosClient.js, baseURL is hardcoded to the relative path '/api'. Vite’s dev-server proxy transparently forwards those requests to the backend. VITE_API_URL is not read by axiosClient.js — it is available for scripts and custom integrations that need the full backend origin.

Build docs developers (and LLMs) love