Skip to content

remake docs#40

Merged
grzanka merged 36 commits intomainfrom
remake-docs
Mar 12, 2026
Merged

remake docs#40
grzanka merged 36 commits intomainfrom
remake-docs

Conversation

@lythx
Copy link
Contributor

@lythx lythx commented Mar 10, 2026

I created new docs, some pages are rewrites of the old docs, some are new. The base was generated by AI, I reviewed and fixed all the generated pages. There's a few TODOs which I'll resolve before merging.
I used Starlight instead of mkdocs, so the commands are different now:

  • npm run start - run and test locally
  • npm run build - build the production website
  • npm run preview - run the build

Github Pages workflow needs to be tested before merging.

@grzanka
Copy link
Collaborator

grzanka commented Mar 10, 2026

Can you update main README with instruction how to deploy locally ?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the YAPTIDE developer documentation site from a MkDocs/Poetry setup to an Astro + Starlight site, adds a new documentation content structure (architecture/backend/frontend/converter/API reference), and updates CI/dependabot to match the new Node-based build.

Changes:

  • Replace MkDocs configuration/content with an Astro + Starlight documentation site (new astro.config.mjs, package.json, content under src/content/docs/).
  • Add extensive new/updated developer documentation pages across setup, architecture, backend, frontend, converter, and API reference.
  • Update GitHub Pages workflow and Dependabot to use npm + Astro build output (dist/), and adjust repo-level config files (.gitignore, VSCode configs).

Reviewed changes

Copilot reviewed 73 out of 157 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
astro.config.mjs Starlight site configuration (site/base/sidebar/logo/edit link).
package.json Introduces Astro/Starlight dependencies and build scripts.
tsconfig.json Adds Astro strict TS config for the docs project.
src/content.config.ts Configures Starlight docs collection loader/schema.
src/styles/custom.css Custom theme tokens + landing-page card/badge styling.
public/favicon.svg Adds SVG favicon with light/dark fill via media query.
public/assets/logo.svg Adds static logo asset for the site.
src/assets/yaptide-logo.svg Adds logo used by Starlight config.
.gitignore Updates ignores for Astro (dist/, .astro/, node_modules/, env files).
.vscode/launch.json Adds VSCode launch config for astro dev.
.vscode/extensions.json Recommends Astro VSCode extension.
.github/workflows/docs.yml Switches GitHub Pages build/deploy from MkDocs/Python to Astro/Node (dist/).
.github/dependabot.yml Switches dependency updates from pip to npm (+ GitHub Actions).
src/content/docs/index.mdx New developer docs landing page with mode matrix and navigation cards.
src/content/docs/local-setup/local-frontend-demo.mdx Local “demo mode” (frontend-only) setup guide.
src/content/docs/docker-setup/docker-frontend-demo.mdx Docker guide for serving demo build (currently includes TODO placeholders).
src/content/docs/docker-setup/docker-celery.mdx Docker setup guide for backend + Celery workers (currently includes TODO placeholders).
src/content/docs/docker-setup/docker-slurm.mdx Docker SLURM setup stub (currently TODO + tip block).
src/content/docs/architecture/overview.md System-level architecture overview + diagram.
src/content/docs/architecture/data-flow.md End-to-end data flow across direct/batch/local execution paths.
src/content/docs/architecture/auth-model.md Auth model for native vs Keycloak + demo mode behavior.
src/content/docs/backend/overview.md Backend architecture overview (Flask/Celery/Postgres).
src/content/docs/backend/api-endpoints.md Narrative guide to backend endpoints and usage.
src/content/docs/backend/database.md Database schema/model documentation and migration workflow.
src/content/docs/backend/simulation-lifecycle.md Job/task state machine and direct vs batch execution details.
src/content/docs/backend/simulator-management.md Simulator binary management via S3 + encryption.
src/content/docs/backend/docker-deployment.md Docker Compose deployment guide for backend stack.
src/content/docs/backend/testing.md Backend testing approach and fixtures.
src/content/docs/frontend/overview.md Frontend architecture overview and directory structure.
src/content/docs/frontend/3d-editor.md 3D editor (Three.js) architecture and core patterns.
src/content/docs/frontend/simulation-services.md Frontend simulation service abstraction and flows.
src/content/docs/frontend/pyodide-converter.md In-browser converter via Pyodide + build pipeline.
src/content/docs/frontend/geant4-wasm.md Geant4 WebAssembly runtime architecture and limitations.
src/content/docs/frontend/auth-flows.md Standard vs Keycloak auth flows + demo mode behavior.
src/content/docs/frontend/adding-commands.md Command-pattern guide for undo/redo and testing.
src/content/docs/frontend/testing.md Frontend test strategy (Jest/RTL) + mocking patterns.
src/content/docs/converter/overview.md Converter purpose, supported engines, and structure.
src/content/docs/converter/conversion-flow.md End-to-end conversion pipeline explanation.
src/content/docs/converter/adding-a-simulator.md How-to guide for adding a new converter engine.
src/content/docs/converter/shieldhit.md SHIELD-HIT12A converter internals and formats.
src/content/docs/converter/fluka.md FLUKA converter internals and card-based format.
src/content/docs/converter/geant4.md Geant4 converter internals (GDML + macro).
src/content/docs/converter/testing.md Converter testing strategy (golden files + unit tests).
src/content/docs/contributing/guide.md Contribution workflow across repos.
src/content/docs/contributing/code-style.md Style/lint conventions across Python/TS repos.
src/content/docs/contributing/glossary.md Project glossary for domain and architecture terms.
src/content/docs/api-reference/overview.md API reference overview + endpoint grouping.
src/content/docs/api-reference/auth.md Auth endpoint reference.
src/content/docs/api-reference/jobs.md Jobs endpoint reference.
src/content/docs/api-reference/results.md Results/inputs/logs endpoint reference.
src/content/docs/api-reference/user.md User/clusters endpoint reference.
mkdocs.yml Removes MkDocs site config.
pyproject.toml Removes Poetry/MkDocs dependency definition.
docs/index.md Removes old MkDocs landing stub.
docs/gen_ref_pages.py Removes MkDocs auto-reference generator script.
docs/backend/* Removes old MkDocs backend docs.
docs/frontend/* Removes old MkDocs frontend docs.
docs/converter/* Removes old MkDocs converter docs.
docs/documentation/index.md Removes old MkDocs “how docs work” page.
Comments suppressed due to low confidence (1)

.github/workflows/docs.yml:56

  • actions/configure-pages runs for pull_request events as well, but PRs (especially from forks) typically don't have GitHub Pages write permissions. Consider gating Pages-specific steps (configure-pages, upload-pages-artifact, deploy-pages) behind the same push && refs/heads/main condition, and keep PR runs to just npm ci/npm run build to avoid CI failures.
      - name: Setup Pages
        uses: actions/configure-pages@v5
      - name: Upload artifact if on main
        if: github.event_name == 'push' && github.ref == 'refs/heads/main'
        uses: actions/upload-pages-artifact@v4
        with:
          path: 'dist'
      - name: Deploy to GitHub Pages if on main
        if: github.event_name == 'push' && github.ref == 'refs/heads/main'
        id: deployment
        uses: actions/deploy-pages@v4


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +20
:::tip
Prefer a local setup? See [Local — SLURM](/docs/local-setup/local-slurm/) for the non-containerized version.
:::
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The admonition block appears to be closed with ::: followed by trailing whitespace. Starlight/markdown-it container syntax typically expects the closing fence to be exactly :::; the extra spaces can prevent the tip block from closing/rendering correctly. Remove the trailing whitespace so the closing line is just :::.

Copilot uses AI. Check for mistakes.
astro.config.mjs Outdated
}
],
},
{
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sidebar config for the "Docker Setup" section has inconsistent indentation (the opening { is indented differently than the rest of the array items). While it still parses, it reads like an accidental nesting/copy-paste error and makes future edits risky. Reformat this block (e.g., run the repo formatter) so the sidebar array items are consistently aligned.

Suggested change
{
{

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +29
## Prerequisites

TODO Docker setup should not require Node.js or Python - change the dockerfile and update this guide

- **Node.js 20+** with npm
- **Python 3.9+** with pip and venv — needed to build the converter into a Pyodide/WebAssembly module (only if building locally)
- **Docker**
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a TODO placeholder in the published docs. If this page is meant to be user-facing, replace the TODO with actual prerequisites (or move it into an explicit "Known limitations" callout) so the guide is actionable.

Copilot uses AI. Check for mistakes.
Comment on lines +81 to +86
## Step 3: Start the frontend

TODO change this to use Docker instructions — the frontend currently requires a local setup

The backend API is available at **http://localhost:5000** (via NGINX). Start the frontend in a separate terminal:
```bash
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO indicates the core instructions are not yet Docker-based ("change this to use Docker instructions"). If the page is going into the sidebar/navigation, consider either completing this section or adding an explicit note that the Docker setup is currently backend-only and the frontend must be run locally, to avoid misleading readers.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@grzanka grzanka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments inline

```

2. **Install dependencies**
```bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its a very bad practice to put two commands in one copy-pasteable block


## Architecture Diagram

```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this could be converted to mermaid or something better looking ?

## Setup

```bash
git clone https://github.com/yaptide/ui.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid everywhere putting multiline multiple commands into single copy-pasteable block. If I copy-paste I would like to do it command-by-command. everywhere.

│ UI │ │ Backend │
└────┬─────┘ └────┬────┘
│ │
│ PUT /auth/register │
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have such endpoint ? I always believed that user registration was disabled by purpose as architecture desgin decision (to be document here!).
We only allow registration by command line script.

Local users (where we store username and password) are only required for the development mode.

On production we don't store user passwords, we only use keycloak.

Maybe we should have somewhere a documentation on decisions made ?


| Token | Lifetime | Storage |
|---|---|---|
| Access token | 10 minutes | httpOnly cookie |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you confirmed these numbers ?
Are they specific to the cyfronet keycloak instance ?

When a Keycloak token arrives, the backend checks the `PLG_YAPTIDE_ACCESS` claim in the token. This ensures the user has been granted access to the YAPTIDE service in the PLGrid infrastructure.

The backend also:
1. Fetches **SSH certificates** from a dedicated cert-auth service (`CERT_AUTH_URL`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't be confiused with SSH public-private key pair here. Those are short lived certificatates. Maybe we should point the developer to some documentation of that ?

Maybe you find something better than this:
https://goteleport.com/blog/how-to-configure-ssh-certificate-based-authentication/

Image

run: |
poetry lock
poetry install
node-version: '20'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 73 out of 80 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

README.md Outdated
# Yaptide developer documentation
https://yaptide.github.io/for_developers/

[](https://yaptide.github.io/for_developers/)
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README contains an empty Markdown link ([](https://yaptide.github.io/for_developers/)), which renders as a blank clickable area. Replace it with a proper link label (or plain URL) so the landing link is visible/readable.

Suggested change
[](https://yaptide.github.io/for_developers/)
[Yaptide developer site](https://yaptide.github.io/for_developers/)

Copilot uses AI. Check for mistakes.
description: Run the YAPTIDE backend locally with Keycloak authentication for SLURM integration development.
---

import { Tabs, TabItem } from "@astrojs/starlight/components";
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs/TabItem are imported but never used in this MDX file. With strict TS settings, unused imports can cause type-check failures and should be removed (or add the corresponding <Tabs> usage if intended).

Copilot uses AI. Check for mistakes.
description: Run the full YAPTIDE backend with Celery workers in Docker containers for integration testing and development.
---

import { Tabs, TabItem, Aside } from "@astrojs/starlight/components";
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside is imported but not used anywhere in this page. Please remove it from the import list to avoid unused-import/type-check issues.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +8
import SwaggerUI from 'swagger-ui-react'
import 'swagger-ui-react/swagger-ui.css'

<SwaggerUI client:only="react" url="/for_developers/openapi.yaml" /> No newline at end of file
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Swagger spec URL is hard-coded to /for_developers/openapi.yaml, which couples this page to a specific base path. Use the runtime base (e.g. import.meta.env.BASE_URL) to build the URL so it keeps working if the site base changes or if this page is reused under a different deployment path.

Copilot uses AI. Check for mistakes.
git push origin feature/my-change
```

Open a pull request on GitHub against `master`. Include:
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guide says to open PRs against master, but this repository/workflow is clearly using main as the default branch (e.g. Pages workflow triggers on main). Please update the text to avoid sending contributors to the wrong target branch.

Copilot uses AI. Check for mistakes.
@grzanka grzanka merged commit ad157fb into main Mar 12, 2026
3 checks passed
@grzanka grzanka deleted the remake-docs branch March 12, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants