api / app /README.md
lljz66's picture
assets-only app README
346d3bc verified
|
Raw
History Blame Contribute Delete
1.01 kB
# app/ — application package
FastAPI application code for the **Asset Extractor API**. Monolith-modular
layout: the HTTP layer (`routers/`) is kept separate from business logic
(`services/`), with shared Pydantic models in `schemas.py` and central
settings in `config.py`.
## Files
| File | Purpose |
|------|---------|
| `main.py` | Assembles the FastAPI app and registers the `assets` router. |
| `config.py` | Central settings (fetch timeouts, size caps, SSRF block-list). |
| `schemas.py`| Pydantic request/response models. |
| `routers/` | HTTP layer: `assets.py` (`POST /assets`). |
| `services/` | Business logic: `fetcher`, `resolver`, `asset_service`, and `extractors/`. |
## Adding a new endpoint
1. Add request/response models to `schemas.py`.
2. Create a router under `routers/` (HTTP + error mapping only).
3. Put the real logic in a `services/` module.
4. Register the router in `main.py`.
Keep routers thin and services testable — that keeps the monolith modular
and easy to grow.