Why nginx sub_filter?Por que nginx sub_filter?
+Framework agnostic: Works with any frontend. No app changes needed. Easy to disable.
+Agnostico de framework: Funciona con cualquier frontend. Sin cambios en la app. Facil de deshabilitar.
+diff --git a/docs/architecture/sidebar-injection.html b/docs/architecture/sidebar-injection.html new file mode 100644 index 0000000..b3c9d1b --- /dev/null +++ b/docs/architecture/sidebar-injection.html @@ -0,0 +1,191 @@ + + +
+ + ++ How managed room sidebar works + Como funciona el sidebar del managed room +
+The soleprint sidebar is injected into managed app pages using a hybrid nginx + JavaScript approach. This allows any frontend framework (React, Next.js, static HTML) to receive the sidebar without code modifications.
+El sidebar de soleprint se inyecta en las paginas de apps manejadas usando un enfoque hibrido nginx + JavaScript. Esto permite que cualquier framework frontend (React, Next.js, HTML estatico) reciba el sidebar sin modificaciones de codigo.
++┌─────────────────────────────────────────────────────────────────┐ +│ Browser Request │ +│ http://room.spr.local.ar/ │ +└─────────────────────────────────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ Nginx │ +│ │ +│ 1. Routes /spr/* → soleprint:PORT (sidebar assets + API) │ +│ 2. Routes /* → frontend:PORT (app pages) │ +│ 3. Injects CSS+JS into HTML responses via sub_filter │ +└─────────────────────────────────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ Browser Renders │ +│ │ +│ 1. Page loads with injected CSS (sidebar styles ready) │ +│ 2. sidebar.js executes (deferred, after DOM ready) │ +│ 3. JS fetches /spr/api/sidebar/config │ +│ 4. JS creates sidebar DOM elements and injects into page │ +│ 5. Sidebar appears on left side, pushes content with margin │ +└─────────────────────────────────────────────────────────────────┘+
Framework agnostic: Works with any frontend. No app changes needed. Easy to disable.
+Agnostico de framework: Funciona con cualquier frontend. Sin cambios en la app. Facil de deshabilitar.
+Next.js and streaming SSR may not include </body> in initial response. </head> is always present.
+Next.js y SSR streaming pueden no incluir </body> en la respuesta inicial. </head> siempre esta presente.
+No isolation issues, better UX (no double scrollbars), simpler CSS with margin-left.
+Sin problemas de aislamiento, mejor UX (sin doble scrollbar), CSS mas simple con margin-left.
+The nginx config injects CSS+JS into HTML responses:
+La config de nginx inyecta CSS+JS en las respuestas HTML:
+location / {
+ proxy_pass http://frontend:PORT;
+ proxy_set_header Accept-Encoding ""; # Required for sub_filter
+
+ # Inject sidebar
+ sub_filter '</head>'
+ '<link rel="stylesheet" href="/spr/sidebar.css">
+ <script src="/spr/sidebar.js" defer></script></head>';
+ sub_filter_once off;
+ sub_filter_types text/html;
+}
+ Each room uses unique ports for concurrent operation:
+Cada room usa puertos unicos para operacion concurrente:
+| Room | Soleprint | Frontend | Backend |
|---|---|---|---|
| amar | 12000 | 3000 | 8001 |
| dlt | 12010 | 3010 | - |
| sample | 12020 | 3020 | 8020 |
The sidebar JS fetches configuration from /spr/api/sidebar/config:
El JS del sidebar obtiene configuracion de /spr/api/sidebar/config:
{
+ "room": "amar",
+ "soleprint_base": "/spr",
+ "auth_enabled": true,
+ "tools": {
+ "artery": "/spr/artery",
+ "atlas": "/spr/atlas",
+ "station": "/spr/station"
+ }
+}
+ Check if soleprint is running. Verify nginx has Accept-Encoding "". Hard refresh (Ctrl+Shift+R).
Verificar que soleprint esta corriendo. Verificar que nginx tiene Accept-Encoding "". Refresco forzado (Ctrl+Shift+R).
Ensure proxy_set_header Accept-Encoding "" is set. Check response is text/html.
Asegurar que proxy_set_header Accept-Encoding "" esta seteado. Verificar que la respuesta es text/html.
Todo lo vital
++ Composed data flow: a vein configured for a room + with storage +
++ Flujo de datos compuesto: vein configurado para un + room con almacenamiento +
+API connector
+Conector API
+Config/env
+Config/entorno
+Data storage
+Almacenamiento
++ Mock connector for testing - same interface, fake + data +
++ Conector mock para testing - misma interfaz, datos + falsos +
+Same API shape
+Misma forma de API
+Fake responses
+Respuestas falsas
++ Full application when you need more than data flow +
++ Aplicacion completa cuando necesitas mas que flujo + de datos +
+FastAPI server
+Web UI
+DB, queues, etc
+DB, colas, etc
++ Stateless API connector. Connects to external + services like Google Sheets, Jira, Slack. Pure data + flow - no state, no storage. +
++ Conector API sin estado. Conecta a servicios + externos como Google Sheets, Jira, Slack. Flujo de + datos puro. +
++ Mock connector for testing. Same interface as a vein + but returns fake data. +
++ Conector mock para testing. Misma interfaz que un + vein pero devuelve datos falsos. +
++ Composed data flow. Formula: + Vein + Room + Depot. +
++ Flujo de datos compuesto. Formula: + Vein + Room + Depot. +
++ Full application with backend, frontend, and + infrastructure. +
++ Aplicacion completa con backend, frontend e + infraestructura. +
++ Runtime environment configuration. Each room is an + isolated instance with its own config and + credentials. +
++ Configuracion del entorno. Cada room es una + instancia aislada con su propia config y + credenciales. +
++ Data storage / provisions. JSON files, configs, + cached responses. +
++ Almacenamiento de datos. Archivos JSON, configs, + respuestas cacheadas. +
++ Google Sheets API. OAuth authentication, read/write + spreadsheets. +
++ Google Sheets API. Autenticacion OAuth, + leer/escribir hojas de calculo. +
+ + ++ Jira Cloud API. Query issues, projects, sprints. +
++ Jira Cloud API. Consultar issues, proyectos, + sprints. +
+ + ++ Slack API. Channels, messages, users. +
++ Slack API. Canales, mensajes, usuarios. +
+ +Todo lo escrito
++ Static documentation with an index page +
++ Documentacion estatica con una pagina indice +
+Entry point
+Punto de entrada
+Static content
+Contenido estatico
++ Dynamic docs from template + data elements +
++ Docs dinamicos desde template + elementos de datos +
+Jinja2 pattern
+Patron Jinja2
+Data elements
+Elementos de datos
++ Collection of related documentation. Can be plain + (static HTML) or templated (template + depot + elements). +
++ Coleccion de documentacion relacionada. Puede ser + plain (HTML estatico) o templated (template + + elementos de depot). +
++ Jinja2 templates that generate documentation. Define + the structure once, fill with data from depot. +
++ Templates Jinja2 que generan documentacion. Definen + la estructura una vez, llenan con datos del depot. +
++ Runtime environment configuration. Each room can + have its own atlas with project-specific books. +
++ Configuracion del entorno. Cada room puede tener su + propio atlas con books especificos del proyecto. +
++ Data storage. For plain books: static files. For + templated books: elements that fill the template. +
++ Almacenamiento de datos. Para plain books: archivos + estaticos. Para templated books: elementos que + llenan el template. +
++ Plain book - HTML presentation explaining the + standardization pipeline. +
++ Plain book - Presentacion HTML explicando el + pipeline de estandarizacion. +
++ Templated book - Form template + depot of actual + feature forms. +
++ Templated book - Template de formulario + depot de + feature forms reales. +
++ Templated book - Gherkin viewer + depot of .feature + files. +
++ Templated book - Visor Gherkin + depot de archivos + .feature. +
++ Plain book - Static site with architecture diagrams. +
++ Plain book - Sitio estatico con diagramas de + arquitectura. +
+- Cada paso deja huella / Each step leaves a mark +
Cada paso deja huella
++ Pluggable stuff to tackle any challenge + Piezas enchufables para cualquier desafio
+ + Try the Demo + Ver Demo +- System overview, connector hierarchy, build flow, - and room configuration diagrams. +
+ API connectors and data flow. Veins for real APIs, + shunts for mocks. +
++ Conectores y flujo de datos. Veins para APIs reales, + shunts para mocks.
-- API connectors (Jira, Slack, Google) and mock - connectors for testing. +
+ Actionable documentation. Templates that generate + living docs. +
++ Documentacion accionable. Templates que generan docs + vivos. +
+ + ++ Tools and monitors. Everything to run, test, and + observe. +
++ Herramientas y monitores. Todo para correr, testear, + y observar.
-# Build standalone -python build.py -cd gen/standalone && .venv/bin/python run.py ++# Clone +git clone https://git.mcrn.ar/soleprint +cd soleprint -# Build with room config -python build.py --cfg amar -cd gen/amar && .venv/bin/python run.py +# Setup (once) +python -m venv .venv && source .venv/bin/activate +pip install -r requirements.txt -# Visit http://localhost:12000-
+ Minimal config example: + Ejemplo de config minima: +
+
+// cfg/myroom/config.json
+{
+ "room": "myroom",
+ "artery": {
+ "veins": ["google", "jira", "slack"],
+ "shunts": ["mercadopago"]
+ },
+ "atlas": {
+ "books": ["gherkin", "feature-flow"]
+ },
+ "station": {
+ "tools": ["tester", "modelgen"],
+ "monitors": ["databrowse"]
+ }
+}
Deep dive into how soleprint works.
+Profundizando en como funciona soleprint.
Consistent framework across projects.
-
- Mock systems not ready yet - DBs, APIs, Kubernetes.
+
+
+ System overview, artery hierarchy, build flow, room
+ configuration.
+ Architecture Diagrams →Diagramas de Arquitectura →
+
+
BDD -> Gherkin -> Tests.
-+ Vista general, jerarquia de artery, flujo de build, + configuracion de rooms. +
+ + ++ How the managed room sidebar works with nginx + + JavaScript. +
++ Como funciona el sidebar del managed room con nginx + + JavaScript. +
+