feat: build x0 github2stackfield application#1
Conversation
- static/menu.json: 3 navigation links (User Credentials, Issue/Task Mapping, Connect Stackfield Task) - static/object.json: all x0 UI objects for 3 screens (formfields, lists, buttons, service connectors, context menu) - static/skeleton.json: screen layout wiring objects to screens - python/service_implementation.py: GitHubService + StackfieldService ClassHandlers (python-micro-esb) - python/user_routing.py: ServiceRouter routing functions for all 5 backend operations - python/VerifyGitHubCredentials.py: WSGI endpoint - python/VerifyStackfieldCredentials.py: WSGI endpoint - python/SearchGitHubIssues.py: WSGI endpoint – populates issue list - python/GetGitHubIssueDetails.py: WSGI endpoint – pre-populates Screen 3 - python/CreateStackfieldTask.py: WSGI endpoint – creates Stackfield task - python/POSTData.py + StdoutLogger.py: x0 helper modules - database/01-create-schema.sql: github2sf schema, credentials + mapping tables - database/02-insert-config.sql: x0 app configuration rows - database/03-insert-text.sql: EN + DE UI text entries - docker/Dockerfile + docker-compose.yml + apache2.conf: containerised deployment - README.md: full setup and architecture documentation Agent-Logs-Url: https://github.com/WEBcodeX1/github2stackfield/sessions/9b620d8f-bd1b-45df-84a8-b2f02204213e Co-authored-by: clauspruefer <17313789+clauspruefer@users.noreply.github.com>
clauspruefer
left a comment
There was a problem hiding this comment.
The x0 application is a native javascript application, not a Python app.
# Install x0 framework Python modules
RUN pip install --no-cache-dir \
git+https://github.com/WEBcodeX1/x0.git
Use the official https://github.com/WEBcodeX1/x0/pkgs/container/x0-app and https://github.com/WEBcodeX1/x0/pkgs/container/x0-db instead.
Fixed in commit Changes made:
|
clauspruefer
left a comment
There was a problem hiding this comment.
@copilot Please ensure that everything is atomatically put inside the correct containers / databases so that the containers will be started and the application runs without the need of configuring anything. The database scripts /database/* must use the x0 database. Also check if all web-server content and web-server wsgi content is put at the correct location. Ensure that from README.md "## Installation" section everything will be put automatically in the correct container(s) and afterwards remove the section completely from the README.md.
Done in commit
|
clauspruefer
left a comment
There was a problem hiding this comment.
@copilot: 1. the following default stylesheets from the x0 base system are missing: bootstrap.css, all-min.css and globalstyles.css 2. The Python WSGI scripts are missing / not working (XHRPOST
http://127.0.0.1:8080/python/VerifyGitHubCredentials.py?a__=9216039810
[HTTP/1.1 404 Not Found 2ms])
Fixed in commit 1. Missing stylesheets — RUN ln -s /var/www/vhosts/x0/static/bootstrap.css /var/www/vhosts/x0/static/github2sf/bootstrap.css \
&& ln -s /var/www/vhosts/x0/static/globalstyles.css /var/www/vhosts/x0/static/github2sf/globalstyles.css \
&& ln -s /var/www/vhosts/x0/static/fontawesome /var/www/vhosts/x0/static/github2sf/fontawesomeThe x0 framework generates HTML 2. WSGI 404 — Two root causes, both fixed:
|
clauspruefer
left a comment
There was a problem hiding this comment.
@copilot the menu buttons currently are displayed side by side, the must be displayed among themselves.
Fixed in commit Changed the menu link styles in |
There was a problem hiding this comment.
Please correct the style for unsuccessful notifications, currently it is green with a black small exlamation mark (where it should be red), the icon also should be better fitted (e.g. with a circle border or similar). An successful notoification must be green with a green hook icon.
…(red circled exclamation)
Fixed in commit The x0 framework's Changes made:
|
clauspruefer
left a comment
There was a problem hiding this comment.
Not tested with correct credentials.
There was a problem hiding this comment.
Pull request overview
Implements a complete github2stackfield x0 application stack (x0 UI + Python WSGI backend + PostgreSQL schema/seed + Docker packaging) to search GitHub issues and create Stackfield tasks from them.
Changes:
- Added x0 UI configuration (menu, objects, skeleton) for 3 screens and their service connectors.
- Added Python WSGI endpoints + python-micro-esb routing + service classes for GitHub/Stackfield API integration.
- Added PostgreSQL schema + seed data and Docker images/compose to run the full stack with one command.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| static/skeleton.json | Wires UI objects/connectors to Screen1–3 layouts. |
| static/object.json | Defines x0 UI objects (forms, list, connectors, buttons) and field mappings. |
| static/menu.json | Adds 3 navigation links for the three screens. |
| static/globalstyles.css | Adds app-specific CSS overrides (incl. notification indicator styles). |
| README.md | Documents architecture, screens, and Docker quick start for the new app. |
| python/VerifyStackfieldCredentials.py | WSGI endpoint to verify Stackfield creds via router. |
| python/VerifyGitHubCredentials.py | WSGI endpoint to verify GitHub creds via router. |
| python/user_routing.py | micro-esb routing functions; DB credential persistence and orchestration. |
| python/StdoutLogger.py | Logging setup for WSGI scripts. |
| python/service_implementation.py | GitHub/Stackfield API client logic (verify/search/details/create). |
| python/SearchGitHubIssues.py | WSGI endpoint for issue search list population. |
| python/POSTData.py | Helper to read POST bodies from WSGI environ. |
| python/GetGitHubIssueDetails.py | WSGI endpoint to fetch issue details for Screen3 population. |
| python/CreateStackfieldTask.py | WSGI endpoint to create Stackfield tasks from Screen3 data. |
| docker/Dockerfile.db | Builds a DB image that runs init SQL automatically on startup. |
| docker/Dockerfile | Builds an app image bundling static configs + Python scripts + Apache conf. |
| docker/docker-compose.yml | Compose stack for app + DB containers on a fixed bridge network. |
| docker/db-init.sh | Custom DB entrypoint: starts Postgres, runs init SQL, keeps server alive. |
| docker/apache2.conf | Apache snippet granting access to static and WSGI directories. |
| database/03-insert-text.sql | Seeds i18n UI text labels (EN/DE) into webui.text. |
| database/02-insert-config.sql | Seeds x0 system.config entries for appid=github2sf. |
| database/01-create-schema.sql | Creates github2sf schema and tables for credentials/config/mapping log. |
| AI-prompt.md | Captures the original build prompt/spec for the app. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Repo may be stored as a mapping state or passed via global var. | ||
| # Fall back to a stored repo config entry. | ||
| repo = metadata.get('repo', '') | ||
| if not repo: | ||
| with pool.Handler('x0') as db: |
| svc.room_id = metadata.get('StackfieldRoomInput', '') | ||
| svc.task_title = metadata.get('TaskTitleInput', '') | ||
| svc.task_description = metadata.get('TaskDescInput', '') | ||
| svc.task_priority = metadata.get('TaskPriorityPulldown', 'medium') |
| request_data = service_json.get('RequestData', {}) | ||
|
|
||
| logger.debug('VerifyGitHubCredentials RequestData:{}'.format(request_data)) | ||
|
|
| request_data = service_json.get('RequestData', {}) | ||
|
|
||
| logger.debug('VerifyStackfieldCredentials RequestData:{}'.format(request_data)) | ||
|
|
| logger.debug('user_routing.verify_github() metadata:{}'.format(metadata)) | ||
|
|
||
| svc = GitHubService() | ||
| svc.github_user = metadata.get('GitHubUserInput', '') | ||
| svc.github_token = metadata.get('GitHubTokenInput', '') |
| class Environment: | ||
| @staticmethod | ||
| def getPOSTData(environ): | ||
| ContentLength = int(environ.get('CONTENT_LENGTH', 0)) |
| requests \ | ||
| psycopg2-binary \ | ||
| pgdbpool \ | ||
| git+https://github.com/clauspruefer/python-micro-esb.git |
| ports: | ||
| - "5432:5432" | ||
| networks: |
| CREATE TABLE IF NOT EXISTS github2sf.credentials ( | ||
| credential_type VARCHAR(20) NOT NULL, | ||
| username_or_email TEXT NOT NULL, | ||
| api_token TEXT NOT NULL, | ||
| updated_at TIMESTAMP NOT NULL DEFAULT NOW(), | ||
| CONSTRAINT pk_credentials PRIMARY KEY (credential_type) |
Summary
Full implementation of the github2stackfield x0 application — a modern Bootstrap-styled browser frontend that connects GitHub Issues with Stackfield Tasks via Python backend services built on the python-micro-esb framework.
The entire stack starts with a single
docker compose up --build— no manual configuration, no post-start database commands.Changes
static/menu.json— 3 navigation links (User Credentials, Issue / Task Mapping, Connect Stackfield Task)static/object.json— all x0 UI objects for 3 screens:sysObjectFormfieldList,sysObjectList,sysObjContextMenu,sysObjButton,ServiceConnectorstatic/skeleton.json— screen layout wiring objects to screens / connectorspython/service_implementation.py—GitHubService+StackfieldServicesubclassingmicroesb.ClassHandlerpython/user_routing.py— python-micro-esbServiceRouterrouting functions for all 5 backend operationspython/VerifyGitHubCredentials.py— WSGI endpoint: validate + persist GitHub credentialspython/VerifyStackfieldCredentials.py— WSGI endpoint: validate + persist Stackfield credentialspython/SearchGitHubIssues.py— WSGI endpoint: search GitHub issues, return indexed rows for x0 Listpython/GetGitHubIssueDetails.py— WSGI endpoint: fetch full issue data, pre-populate Screen 3 formfieldspython/CreateStackfieldTask.py— WSGI endpoint: create Stackfield task via REST APIpython/POSTData.py+python/StdoutLogger.py— x0 helper modulesdatabase/01-create-schema.sql—github2sfschema:credentials,app_config,issue_task_mappingtables (targets thex0database)database/02-insert-config.sql— x0system.configrows forappid=github2sf(idempotent: DELETE + INSERT)database/03-insert-text.sql—webui.textentries in English and German for all UI labels (idempotent:ON CONFLICT (id) DO NOTHING)docker/Dockerfile— extendsghcr.io/webcodex1/x0-app; installs Python deps;COPYsstatic/,python/, andapache2.confinto the image at build timedocker/Dockerfile.db— extendsghcr.io/webcodex1/x0-db; copies SQL scripts; overridesCMDwithdb-init.shfor automatic schema + data init on startupdocker/db-init.sh— starts PostgreSQL in background, waits forpg_isready, runs all three SQL scripts against thex0database, then keeps the container alivedocker/docker-compose.yml— both services built from custom Dockerfiles; no volume mounts (all content baked in)docker/apache2.conf—conf-enabledsnippet granting Apache2 access to the github2sf static and WSGI pathsREADME.md— architecture, screen overview, and Docker quick-start documentation;## Installationsection removed (everything is automated)Screen Overview
Screen 1 — User Credentials
Two
sysObjectFormfieldListgroups (GitHub + Stackfield), each with a Verify credentials button. On success the credentials are stored in the database.Screen 2 — Issue / Task Mapping
Search
sysObjectFormfieldList+ search button (firesSearchGitHubIssuesevent) →ServiceConnector→sysObjectListwithsysObjContextMenuentry Connect Stackfield Task (right-click → navigate to Screen 3, fireConnectStackfieldTaskevent).Screen 3 — Connect Stackfield Task
IssueDetailsConnector(ServiceConnector, listens toConnectStackfieldTask) populates twosysObjectFormfieldListinstances:sysObjButtonCreate New Stackfield Task calls the backend to POST to Stackfield's task API.Container architecture
Both services use the official x0 container images as their base:
ghcr.io/webcodex1/x0-app— Apache2 + mod_wsgi with the x0 JavaScript framework pre-installed. The customdocker/Dockerfilecopies all static JSON configs, Python WSGI scripts, and the Apache2 config snippet directly into the image at build time.ghcr.io/webcodex1/x0-db— PostgreSQL 16 with the x0 schema pre-installed. The customdocker/Dockerfile.dbbundles thedatabase/0*.sqlscripts and overrides the containerCMDwithdocker/db-init.sh, which auto-initialises thegithub2sfschema and seed data in thex0database on every container start (all scripts are idempotent).python-micro-esb integration
GitHubServiceandStackfieldServiceboth extendmicroesb.ClassHandler. Each WSGI endpoint constructs aServiceRouterand callsrouter.send(routing_function, request_data), dispatching to the appropriate function inuser_routing.py.