feat(api): add OpenAPI documentation

This commit is contained in:
2026-09-21 17:48:27 +03:30
parent 6e0b718811
commit 5175d1dd65
5 changed files with 540 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ npm install
npm run dev
```
The frontend is available at `http://127.0.0.1:3000`. The backend health endpoint is available at `http://127.0.0.1:8080/health`.
The frontend is available at `http://127.0.0.1:3000`. The backend health endpoint is available at `http://127.0.0.1:8080/health`, and the interactive API documentation is available at `http://127.0.0.1:8080/docs`.
## Running with Docker Compose
@@ -86,6 +86,8 @@ The database volume is preserved by default. To remove it intentionally, run `do
## API Contract
The OpenAPI 3.0 document is served at `http://127.0.0.1:8080/openapi.json`. Swagger UI is available at `http://127.0.0.1:8080/swagger/`, with `/docs` provided as a shortcut. The OpenAPI document is embedded in the backend binary; only the Swagger UI assets are loaded from a CDN.
### Convert a card number to an IBAN
```http
@@ -167,5 +169,5 @@ The test suite covers card validation and masking, the conversion service, the Z
- The frontend normalizes Persian and Arabic digits and removes spaces or hyphens before submission.
- SQLite is sufficient for this assessment and uses a single writer connection for predictable behavior.
- Only the IBAN is exposed to the frontend. Account details, owner information, and raw ZarinHub responses remain internal.
- Retries, Docker, OpenAPI, CI, dark mode, and production infrastructure are intentionally outside the project scope.
- Retries, CI, dark mode, and production infrastructure are intentionally outside the project scope.
- The interface uses the existing ZarinPal design system's font and logo assets. The font license is stored in `frontend/public/fonts`.