File size: 1,401 Bytes
e372349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 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.