Clean dev tooling layout

This commit is contained in:
gabdevele
2026-06-03 01:21:38 +02:00 Unverified
parent 84e8aadf11
commit 74ff09fefe
10 changed files with 33 additions and 28 deletions
+1
View File
@@ -95,6 +95,7 @@ build/
.cache/
.env
uploads/
lab/.venv/
### CMake Patch ###
# External projects
+1 -1
View File
@@ -24,7 +24,7 @@
- Build: `cmake --build build`
- Test: `ctest --test-dir build --output-on-failure`
- OpenAPI: `cmake --build build --target openapi`
- Lab frontend: `streamlit run tools/visione-lab/app.py`
- Lab frontend: `cd lab && uv run streamlit run app.py`
- Local services: `docker compose up -d`
- App: `./build/visione-backend`
+2 -2
View File
@@ -77,13 +77,13 @@ set(OPENAPI_OUTPUT ${CMAKE_BINARY_DIR}/openapi/visione.openapi.json)
add_custom_command(
OUTPUT ${OPENAPI_OUTPUT}
COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/tools/drogon-openapi-gen/generate.py
${CMAKE_CURRENT_SOURCE_DIR}/generate_openapi.py
--controllers ${CMAKE_CURRENT_SOURCE_DIR}/controllers
--out ${OPENAPI_OUTPUT}
--title "Visione API"
--version ${PROJECT_VERSION}
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/tools/drogon-openapi-gen/generate.py
${CMAKE_CURRENT_SOURCE_DIR}/generate_openapi.py
${CONTROLLER_HEADERS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
+5 -6
View File
@@ -90,14 +90,13 @@ The app serves the generated JSON at `/api/v1/openapi.json` and Swagger UI at
## Visione Lab
`tools/visione-lab` is a small Streamlit frontend used only to test the backend
visually while the real frontend is not ready.
`lab/` is a small Streamlit frontend used only to test the backend visually
while the real frontend is not ready.
```bash
python3 -m venv .venv-lab
. .venv-lab/bin/activate
pip install -r tools/visione-lab/requirements.txt
streamlit run tools/visione-lab/app.py
cd lab
uv sync
uv run streamlit run app.py
```
Keep the backend running on `http://127.0.0.1:5555`. The lab calls the API from
+6 -6
View File
@@ -6,7 +6,7 @@
- `repositories/`: database helpers and migrations.
- `common/`: reusable HTTP, auth, crypto, email and validation utilities.
- `migrations/`: versioned SQL files.
- `tools/`: local developer tools such as OpenAPI generation.
- `lab/`: local Streamlit frontend for visual endpoint testing.
- `docs/`: product, API, schema and milestone documentation.
## Drogon Usage
@@ -29,8 +29,8 @@ available through OpenSSL, which is already a Drogon dependency in this project.
Legacy `sha256$` password hashes are rejected instead of silently accepted.
## OpenAPI Generation
`tools/drogon-openapi-gen/generate.py` scans Drogon `ADD_METHOD_TO` route macros
in `controllers/*.h` and generates `build/openapi/visione.openapi.json`.
`generate_openapi.py` scans Drogon `ADD_METHOD_TO` route macros in
`controllers/*.h` and generates `build/openapi/visione.openapi.json`.
This is a contract-last generator: the source of truth is the C++ controller
route list, not a manually maintained static Swagger document. The current tool
@@ -39,6 +39,6 @@ multipart request bodies. Deeper request/response schemas can be added later by
teaching the generator project-specific conventions or comments.
## Visione Lab
`tools/visione-lab` is a Streamlit dev frontend for visual endpoint testing. It
is intentionally separate from the real product frontend and should stay small:
forms, uploads and response rendering only.
`lab/` is a Streamlit dev frontend for visual endpoint testing. It is
intentionally separate from the real product frontend and should stay small:
forms, uploads and response rendering only. Run it with uv from `lab/`.
+1 -1
View File
@@ -14,7 +14,7 @@
## To do next
- Add richer OpenAPI schema metadata for request and response bodies.
- Consider extracting `tools/drogon-openapi-gen` into an open-source standalone
- Consider extracting `generate_openapi.py` into an open-source standalone
project once the conventions stabilize.
- Add minimal media upload integration tests after endpoint contracts settle.
- Keep API and docs on `media` terminology only.
+2 -1
View File
@@ -1,7 +1,8 @@
[project]
name = "tools"
name = "visione-lab"
version = "0.1.0"
requires-python = ">=3.13"
dependencies = [
"requests>=2.32.5",
"streamlit>=1.58.0",
]
+15 -11
View File
@@ -784,17 +784,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", size = 16588, upload-time = "2020-11-01T01:40:20.672Z" },
]
[[package]]
name = "tools"
version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "streamlit" },
]
[package.metadata]
requires-dist = [{ name = "streamlit", specifier = ">=1.58.0" }]
[[package]]
name = "typing-extensions"
version = "4.15.0"
@@ -835,6 +824,21 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/01/be/72532be3da7acc5fdfbccdb95215cd04f995a0886532a5b423f929cda4cc/uvicorn-0.48.0-py3-none-any.whl", hash = "sha256:48097851328b87ec36117d3d575234519eb58c2b22d79666e9bbc6c49a761dad", size = 71410, upload-time = "2026-05-24T12:08:40.258Z" },
]
[[package]]
name = "visione-lab"
version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "requests" },
{ name = "streamlit" },
]
[package.metadata]
requires-dist = [
{ name = "requests", specifier = ">=2.32.5" },
{ name = "streamlit", specifier = ">=1.58.0" },
]
[[package]]
name = "watchdog"
version = "6.0.0"