How mr-melenas/pathfinders42-back works
Pathfinders42 is a FastAPI backend that serves precomputed Earth-analogue results for lunar and Martian sites; it does not run the heavy comparison models in the API. The main workflow is API request → endpoint router → shared data access and domain-specific assembly → JSON, GeoJSON, or map response. Major branches include site and layer comparisons, ice verdicts, M1 candidate results, and explanations with document retrieval and optional web/LLM chat. The README documents several endpoints whose internal implementation was not sampled; those routes are represented without speculative internal call chains.
Main entry points: main.py FastAPI app · dependencias.py Data dependency · datos.py Manifest data access · router.py Explanation routes
Components 26
API surface
- FastAPI app
app/main.py - Health and metadata
app/routers/salud.py - Layer endpoints
app/routers/capas.py - Site endpoints
app/routers/sitios.py - Candidate endpoints
app/routers/candidatos.py - Ice endpoints
app/routers/hielo.py - Use endpoints
app/routers/usos.py - Analogue endpoints
app/routers/analogos.py - Data dependency
app/dependencias.py
Analogue domains
- Manifest data access
app/datos.py - Site layer index
app/sitios.py - Ice verdicts
app/hielo.py - Analogue results
app/analogos.py - Use results
app/usos.py
Explanations
- Explanation routes
app/explanations/router.py - BM25 text index
app/explanations/index.py - Document retrieval
app/explanations/retrieval.py - Validated writer
app/explanations/writer.py - Answer validator
app/explanations/validator.py - Web search
app/explanations/web.py - LLM API client
app/explanations/llm.py
M1 candidate model
- M1 result reader
app/m1.py - M1 training
modelos/m1/entrenar.py - Earth grid
modelos/m1/rejilla.py
Other components
- API client
- LLM service
Connections 36
- API client → FastAPI app: requests
README.md - FastAPI app → Health and metadata: routes to
app/main.py - FastAPI app → Layer endpoints: routes to
app/main.py - FastAPI app → Site endpoints: routes to
app/main.py - FastAPI app → Candidate endpoints: routes to
app/main.py - FastAPI app → Ice endpoints: routes to
app/main.py - FastAPI app → Use endpoints: routes to
app/main.py - FastAPI app → Analogue endpoints: routes to
app/main.py - FastAPI app → Explanation routes: routes to
app/main.py - Health and metadata → Data dependency: gets data
app/routers/salud.py - Layer endpoints → Data dependency: gets data
app/routers/capas.py - Site endpoints → Data dependency: gets data
app/routers/sitios.py - Candidate endpoints → Data dependency: gets data
app/routers/candidatos.py - Ice endpoints → Data dependency: gets data
app/routers/hielo.py - Use endpoints → Data dependency: gets data
app/routers/usos.py - Analogue endpoints → Data dependency: gets data
app/routers/analogos.py - Data dependency → Manifest data access: loads
app/dependencias.py - Manifest data access → Site layer index: builds
app/datos.py - Manifest data access → Ice verdicts: builds
app/datos.py - Manifest data access → Analogue results: builds
app/datos.py - Manifest data access → Use results: builds
app/datos.py - Manifest data access → M1 result reader: builds
app/datos.py - Site endpoints → Site layer index: serves site data
app/routers/sitios.py - Ice endpoints → Ice verdicts: serves ice data
app/routers/hielo.py - Use endpoints → Use results: serves use data
app/routers/usos.py - Analogue endpoints → Analogue results: serves analogues
app/routers/analogos.py - Candidate endpoints → M1 result reader: serves results
app/routers/candidatos.py - Explanation routes → Document retrieval: retrieves fragments
app/explanations/router.py - Explanation routes → Validated writer: writes answer
app/explanations/router.py - Explanation routes → Web search: optional search
app/explanations/router.py - Explanation routes → BM25 text index: loads explanations
app/explanations/router.py - Document retrieval → BM25 text index: searches
app/explanations/retrieval.py - Validated writer → Answer validator: validates
app/explanations/writer.py - Validated writer → LLM API client: generates draft
app/explanations/llm.py - LLM API client → LLM service: calls API
app/explanations/llm.py - M1 training → Earth grid: uses grid
modelos/m1/entrenar.py