Loading...
'; + openDocs(); + fetch(url, { headers: { 'Accept': 'application/json' } }) + .then(function (res) { return res.json(); }) + .then(function (payload) { + if (!payload || !payload.ok) { + docsBody.innerHTML = 'Failed to load deployment model.
'; + return; + } + docsBody.innerHTML = payload.html || 'No content.
'; + }) + .catch(function () { + docsBody.innerHTML = 'Network error while loading deployment model.
'; + }); + } + + compassHit.addEventListener('click', function () { loadDocs('intro'); }); + docsModal.addEventListener('click', function (ev) { + var target = ev.target; + if (!(target instanceof Element)) return; + if (target.hasAttribute('data-close-docs')) { + closeDocs(); + return; + } + var link = target.closest('[data-doc-link]'); + if (link) { + ev.preventDefault(); + loadDocs(link.getAttribute('data-doc-link') || 'intro'); + } + }); + document.addEventListener('keydown', function (ev) { + if (ev.key === 'Escape' && !docsModal.hidden) closeDocs(); + }); })(); diff --git a/examples/crash_reporter/backend/public/api/hub_deploy_docs.php b/examples/crash_reporter/backend/public/api/hub_deploy_docs.php new file mode 100644 index 0000000..e0001b7 --- /dev/null +++ b/examples/crash_reporter/backend/public/api/hub_deploy_docs.php @@ -0,0 +1,96 @@ +(2) TABLE OF CONTENTS- '
+ . '
- (1) INTRODUCTION ' + . '
- (3) LOCAL SINGLE-STEP TEST DEPLOYMENT ' + . '
- (4) ORCHESTRATION MODEL ' + . '
- (5) XHR SUPERVISED VIEW MODEL ' + . '
- (6) OPERATIONS CHECKLIST ' + . '
(1) INTRODUCTION
' + . '(1.1) authors
' + . 'Project owner: Anton Afanaasyeu. Implementation assistant: Cursor coding agent.
' + . '(1.2) revision details
' + . 'Revision scope: landing compass interaction, XHR-driven deployment docs view, Docker orchestration model integration for next branch.
' + . hub_docs_nav(); +} + +function hub_docs_deploy(): string { + return '(3) LOCAL SINGLE-STEP TEST DEPLOYMENT
' + . '(3.1) preparations, environment
' + . 'Prerequisites: docker + docker compose plugin, git checkout of android cast on branch next.
Run one command from repo: cd orchestration && ./deploy.sh
(3.2) package prerequisites by distro
' + . '| Distro | Install steps |
|---|---|
| Alpine | apk add docker docker-cli-compose bash git curlrc-update add docker default && service docker start |
| Debian / Ubuntu | apt update && apt install -y docker.io docker-compose-plugin git curlsystemctl enable --now docker |
| Fedora | dnf install -y docker docker-compose-plugin git curlsystemctl enable --now docker |
| Arch | pacman -S --noconfirm docker docker-compose git curlsystemctl enable --now docker |
(3.3) local checks
' + . 'http://localhost:8080/app/androidcast_project/(hub) '
+ . 'http://localhost:8080/app/androidcast_project/crashes/(crashes/tasks) '
+ . 'http://localhost:8080/app/androidcast_project/git/(redirect to gitea FE)
(4) ORCHESTRATION MODEL
' + . 'All infra runs in docker with shared source bind-mount where possible.
' + . '- '
+ . '
- landing FE (nginx): serves hub and routes subpaths ' + . '
- gitea FE (nginx) + gitea app ' + . '
- crashes FE (nginx) + php-fpm + mariadb ' + . '
- single command create/update:
orchestration/deploy.sh'
+ . '
Base images: nginx, php-fpm, mariadb. This stays minimal and reproducible on laptop devices.
' + . hub_docs_nav(); +} + +function hub_docs_routing(): string { + return '(5) XHR SUPERVISED VIEW MODEL
' + . 'The Compass click opens a modal. Content is requested via XMLHttpRequest/fetch from BE endpoint '
+ . '/app/androidcast_project/crashes/api/hub_deploy_docs.php.
Internal links in this modal use data-doc-link and are intercepted on frontend, then re-requested through BE. '
+ . 'Browser URL bar is not changed.
Static assets remain at original paths and are not rewritten in this view.
' + . hub_docs_nav(); +} + +function hub_docs_ops(): string { + return '(6) OPERATIONS CHECKLIST
' + . '- '
+ . '
- Pull latest
next'
+ . ' - Run
orchestration/deploy.sh'
+ . ' - Verify hub/crashes/gitea endpoints ' + . '
- For app changes: edit source in repo, rerun deploy script ' + . '