# Ongoing Deployment Best Practices and Tricks This codebase has been configured and deployed to the Hugging Face Space `Leon4gr45/postio`. Below are the details, tricks, and guidelines for future agents. ## 1. Target Space Configuration - **Profile:** Leon4gr45 - **Space:** postio - **Frontend Port:** 7860 - **SDK:** Docker ## 2. API Exposure & Documentation ### Exposed Endpoints - **`/health`** - **Method:** `GET` - **Purpose:** Used by Hugging Face to confirm application is ready. Returns a simple JSON check status. - **Response Example:** ```json { "status": "OK", "timestamp": "2026-07-16T12:00:00.000Z" } ``` - **`/api-docs`** - **Method:** `GET` - **Purpose:** Serves Swagger API documentation for all available endpoints. ### Functional Endpoints (Exposed via API) All endpoints listed in Swagger are exposed. Some notable functional endpoints include: - **`GET /health`** - **Purpose:** Return health status of the application. - **`GET /api-docs`** - **Purpose:** Expose Swagger OpenAPI JSON documentation. ## 3. Important deployment details - Nginx acts as a reverse proxy, listening on port `7860`. - The Next.js frontend runs on `http://localhost:4200/`. - The NestJS backend runs on `http://localhost:3000/`. - `NODE_OPTIONS="--max-old-space-size=4096"` is used during the build phase to prevent NestJS and NextJS from running out of memory.