File size: 1,009 Bytes
164f94d
 
346d3bc
 
 
 
164f94d
 
 
 
 
346d3bc
 
 
 
 
164f94d
 
 
 
346d3bc
164f94d
 
 
 
 
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
# 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.