1
0
mirror of git://f0xx.org/android_cast synced 2026-07-29 05:17:39 +03:00
This commit is contained in:
Anton Afanasyeu
2026-05-27 16:44:50 +02:00
parent 92fc65e02e
commit 43f802de5d
19 changed files with 957 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/../../src/bootstrap.php';
header('Content-Type: application/json; charset=utf-8');
$section = strtolower(trim((string)($_GET['section'] ?? 'intro')));
if ($section === '') $section = 'intro';
function hub_docs_nav(): string {
return '<nav><strong>(2) TABLE OF CONTENTS</strong><ul>'
. '<li><a data-doc-link="intro" href="?section=intro">(1) INTRODUCTION</a></li>'
. '<li><a data-doc-link="deploy" href="?section=deploy">(3) LOCAL SINGLE-STEP TEST DEPLOYMENT</a></li>'
. '<li><a data-doc-link="orchestration" href="?section=orchestration">(4) ORCHESTRATION MODEL</a></li>'
. '<li><a data-doc-link="routing" href="?section=routing">(5) XHR SUPERVISED VIEW MODEL</a></li>'
. '<li><a data-doc-link="ops" href="?section=ops">(6) OPERATIONS CHECKLIST</a></li>'
. '</ul></nav>';
}
function hub_docs_intro(): string {
return '<h3>(1) INTRODUCTION</h3>'
. '<h4>(1.1) authors</h4>'
. '<p>Project owner: Anton Afanaasyeu. Implementation assistant: Cursor coding agent.</p>'
. '<h4>(1.2) revision details</h4>'
. '<p>Revision scope: landing compass interaction, XHR-driven deployment docs view, Docker orchestration model integration for next branch.</p>'
. hub_docs_nav();
}
function hub_docs_deploy(): string {
return '<h3>(3) LOCAL SINGLE-STEP TEST DEPLOYMENT</h3>'
. '<h4>(3.1) preparations, environment</h4>'
. '<p>Prerequisites: docker + docker compose plugin, git checkout of android cast on branch <code>next</code>.</p>'
. '<p>Run one command from repo: <code>cd orchestration && ./deploy.sh</code></p>'
. '<h4>(3.2) package prerequisites by distro</h4>'
. '<table><thead><tr><th>Distro</th><th>Install steps</th></tr></thead><tbody>'
. '<tr><td>Alpine</td><td><code>apk add docker docker-cli-compose bash git curl</code><br><code>rc-update add docker default && service docker start</code></td></tr>'
. '<tr><td>Debian / Ubuntu</td><td><code>apt update && apt install -y docker.io docker-compose-plugin git curl</code><br><code>systemctl enable --now docker</code></td></tr>'
. '<tr><td>Fedora</td><td><code>dnf install -y docker docker-compose-plugin git curl</code><br><code>systemctl enable --now docker</code></td></tr>'
. '<tr><td>Arch</td><td><code>pacman -S --noconfirm docker docker-compose git curl</code><br><code>systemctl enable --now docker</code></td></tr>'
. '</tbody></table>'
. '<h4>(3.3) local checks</h4>'
. '<ul><li><code>http://localhost:8080/app/androidcast_project/</code> (hub)</li>'
. '<li><code>http://localhost:8080/app/androidcast_project/crashes/</code> (crashes/tasks)</li>'
. '<li><code>http://localhost:8080/app/androidcast_project/git/</code> (redirect to gitea FE)</li></ul>'
. hub_docs_nav();
}
function hub_docs_orchestration(): string {
return '<h3>(4) ORCHESTRATION MODEL</h3>'
. '<p>All infra runs in docker with shared source bind-mount where possible.</p>'
. '<ul>'
. '<li>landing FE (nginx): serves hub and routes subpaths</li>'
. '<li>gitea FE (nginx) + gitea app</li>'
. '<li>crashes FE (nginx) + php-fpm + mariadb</li>'
. '<li>single command create/update: <code>orchestration/deploy.sh</code></li>'
. '</ul>'
. '<p>Base images: nginx, php-fpm, mariadb. This stays minimal and reproducible on laptop devices.</p>'
. hub_docs_nav();
}
function hub_docs_routing(): string {
return '<h3>(5) XHR SUPERVISED VIEW MODEL</h3>'
. '<p>The Compass click opens a modal. Content is requested via XMLHttpRequest/fetch from BE endpoint '
. '<code>/app/androidcast_project/crashes/api/hub_deploy_docs.php</code>.</p>'
. '<p>Internal links in this modal use <code>data-doc-link</code> and are intercepted on frontend, then re-requested through BE. '
. 'Browser URL bar is not changed.</p>'
. '<p>Static assets remain at original paths and are not rewritten in this view.</p>'
. hub_docs_nav();
}
function hub_docs_ops(): string {
return '<h3>(6) OPERATIONS CHECKLIST</h3>'
. '<ol>'
. '<li>Pull latest <code>next</code></li>'
. '<li>Run <code>orchestration/deploy.sh</code></li>'
. '<li>Verify hub/crashes/gitea endpoints</li>'
. '<li>For app changes: edit source in repo, rerun deploy script</li>'
. '</ol>'
. hub_docs_nav();
}
$map = [
'intro' => 'hub_docs_intro',
'deploy' => 'hub_docs_deploy',
'orchestration' => 'hub_docs_orchestration',
'routing' => 'hub_docs_routing',
'ops' => 'hub_docs_ops',
];
if (!isset($map[$section])) $section = 'intro';
echo safe_json_encode([
'ok' => true,
'section' => $section,
'html' => $map[$section](),
]);

View File

@@ -85,6 +85,11 @@ if ($route === '/api/ticket_attachment.php' || str_ends_with($route, '/api/ticke
exit;
}
if ($route === '/api/hub_deploy_docs.php' || str_ends_with($route, '/api/hub_deploy_docs.php')) {
require __DIR__ . '/api/hub_deploy_docs.php';
exit;
}
if ($route === '/logout') {
Auth::logout();
header('Location: ' . $base . '/login');