Clean dev tooling layout
This commit is contained in:
@@ -95,6 +95,7 @@ build/
|
|||||||
.cache/
|
.cache/
|
||||||
.env
|
.env
|
||||||
uploads/
|
uploads/
|
||||||
|
lab/.venv/
|
||||||
|
|
||||||
### CMake Patch ###
|
### CMake Patch ###
|
||||||
# External projects
|
# External projects
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
- Build: `cmake --build build`
|
- Build: `cmake --build build`
|
||||||
- Test: `ctest --test-dir build --output-on-failure`
|
- Test: `ctest --test-dir build --output-on-failure`
|
||||||
- OpenAPI: `cmake --build build --target openapi`
|
- 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`
|
- Local services: `docker compose up -d`
|
||||||
- App: `./build/visione-backend`
|
- App: `./build/visione-backend`
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -77,13 +77,13 @@ set(OPENAPI_OUTPUT ${CMAKE_BINARY_DIR}/openapi/visione.openapi.json)
|
|||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${OPENAPI_OUTPUT}
|
OUTPUT ${OPENAPI_OUTPUT}
|
||||||
COMMAND ${Python3_EXECUTABLE}
|
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
|
--controllers ${CMAKE_CURRENT_SOURCE_DIR}/controllers
|
||||||
--out ${OPENAPI_OUTPUT}
|
--out ${OPENAPI_OUTPUT}
|
||||||
--title "Visione API"
|
--title "Visione API"
|
||||||
--version ${PROJECT_VERSION}
|
--version ${PROJECT_VERSION}
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/drogon-openapi-gen/generate.py
|
${CMAKE_CURRENT_SOURCE_DIR}/generate_openapi.py
|
||||||
${CONTROLLER_HEADERS}
|
${CONTROLLER_HEADERS}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
VERBATIM
|
VERBATIM
|
||||||
|
|||||||
@@ -90,14 +90,13 @@ The app serves the generated JSON at `/api/v1/openapi.json` and Swagger UI at
|
|||||||
|
|
||||||
## Visione Lab
|
## Visione Lab
|
||||||
|
|
||||||
`tools/visione-lab` is a small Streamlit frontend used only to test the backend
|
`lab/` is a small Streamlit frontend used only to test the backend visually
|
||||||
visually while the real frontend is not ready.
|
while the real frontend is not ready.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m venv .venv-lab
|
cd lab
|
||||||
. .venv-lab/bin/activate
|
uv sync
|
||||||
pip install -r tools/visione-lab/requirements.txt
|
uv run streamlit run app.py
|
||||||
streamlit run tools/visione-lab/app.py
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Keep the backend running on `http://127.0.0.1:5555`. The lab calls the API from
|
Keep the backend running on `http://127.0.0.1:5555`. The lab calls the API from
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
- `repositories/`: database helpers and migrations.
|
- `repositories/`: database helpers and migrations.
|
||||||
- `common/`: reusable HTTP, auth, crypto, email and validation utilities.
|
- `common/`: reusable HTTP, auth, crypto, email and validation utilities.
|
||||||
- `migrations/`: versioned SQL files.
|
- `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.
|
- `docs/`: product, API, schema and milestone documentation.
|
||||||
|
|
||||||
## Drogon Usage
|
## 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.
|
Legacy `sha256$` password hashes are rejected instead of silently accepted.
|
||||||
|
|
||||||
## OpenAPI Generation
|
## OpenAPI Generation
|
||||||
`tools/drogon-openapi-gen/generate.py` scans Drogon `ADD_METHOD_TO` route macros
|
`generate_openapi.py` scans Drogon `ADD_METHOD_TO` route macros in
|
||||||
in `controllers/*.h` and generates `build/openapi/visione.openapi.json`.
|
`controllers/*.h` and generates `build/openapi/visione.openapi.json`.
|
||||||
|
|
||||||
This is a contract-last generator: the source of truth is the C++ controller
|
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
|
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.
|
teaching the generator project-specific conventions or comments.
|
||||||
|
|
||||||
## Visione Lab
|
## Visione Lab
|
||||||
`tools/visione-lab` is a Streamlit dev frontend for visual endpoint testing. It
|
`lab/` is a Streamlit dev frontend for visual endpoint testing. It is
|
||||||
is intentionally separate from the real product frontend and should stay small:
|
intentionally separate from the real product frontend and should stay small:
|
||||||
forms, uploads and response rendering only.
|
forms, uploads and response rendering only. Run it with uv from `lab/`.
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
## To do next
|
## To do next
|
||||||
- Add richer OpenAPI schema metadata for request and response bodies.
|
- 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.
|
project once the conventions stabilize.
|
||||||
- Add minimal media upload integration tests after endpoint contracts settle.
|
- Add minimal media upload integration tests after endpoint contracts settle.
|
||||||
- Keep API and docs on `media` terminology only.
|
- Keep API and docs on `media` terminology only.
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "tools"
|
name = "visione-lab"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"requests>=2.32.5",
|
||||||
"streamlit>=1.58.0",
|
"streamlit>=1.58.0",
|
||||||
]
|
]
|
||||||
Generated
+15
-11
@@ -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" },
|
{ 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]]
|
[[package]]
|
||||||
name = "typing-extensions"
|
name = "typing-extensions"
|
||||||
version = "4.15.0"
|
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" },
|
{ 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]]
|
[[package]]
|
||||||
name = "watchdog"
|
name = "watchdog"
|
||||||
version = "6.0.0"
|
version = "6.0.0"
|
||||||
Reference in New Issue
Block a user