Skip to content

Commit 4e0e4e0

Browse files
aldbrmezzeddine
authored andcommitted
docs: update diracx-web documentation (DIRACGrid#803)
1 parent 8d42a67 commit 4e0e4e0

8 files changed

Lines changed: 244 additions & 74 deletions

File tree

docs/dev/explanations/extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Okay, so you've decided you definitely do need an extension but not all extensio
3030
Before proceeding you should read and and understand the [structure of DiracX](./components/index.md) to know which components you want to extend.
3131
For most components you can extend them in isolation without needing to have an extension for the other components, for example:
3232

33-
- `diracx-web` can be extended to customize the web interface without needing to extend any of the Python packages.
33+
- `diracx-web` can be extended to customize the web interface without needing to extend any of the Python packages. For details, see the [Creating a web extension](../tutorials/web-extensions.md) tutorial.
3434
- `diracx-logic` can be extended without needing to extend `diracx-core` or `diracx-routers`
3535

3636
The exception to this is when extending `diracx-routers` you MUST also extend `diracx-client` and your client extension MUST be regenerated for every DiracX release.
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Repository Structure
2+
3+
DiracX is developed across three repositories, each with a distinct responsibility. They are combined into a single documentation site and a single deployment, but developed independently.
4+
5+
```mermaid
6+
---
7+
config:
8+
layout: elk
9+
---
10+
flowchart TD
11+
subgraph diracx["diracx (Python)"]
12+
direction TB
13+
subgraph backend["Backend"]
14+
core["diracx-core"]
15+
db["diracx-db"]
16+
logic["diracx-logic"]
17+
routers["diracx-routers"]
18+
tasks["diracx-tasks"]
19+
end
20+
subgraph frontend-py["Frontend (CLI)"]
21+
client["diracx-client"]
22+
api["diracx-api"]
23+
cli["diracx-cli"]
24+
end
25+
end
26+
subgraph diracx-web["diracx-web (TypeScript)"]
27+
direction TB
28+
subgraph frontend-web["Frontend (Web)"]
29+
components["diracx-web-components"]
30+
app["diracx-web app"]
31+
extensions["extensions (gubbins)"]
32+
end
33+
end
34+
subgraph diracx-charts["diracx-charts (Helm)"]
35+
direction TB
36+
charts["Helm charts"]
37+
demo["run_demo.sh"]
38+
end
39+
routers -- serves API --> client
40+
client -. "calls through OpenAPI" .-> routers
41+
charts -. deploys .-> diracx
42+
charts -. deploys .-> diracx-web
43+
app -. "calls through OpenAPI" .-> routers
44+
45+
core:::Pine
46+
db:::Pine
47+
logic:::Pine
48+
routers:::Pine
49+
tasks:::Pine
50+
client:::Sky
51+
api:::Sky
52+
cli:::Sky
53+
components:::Rose
54+
app:::Rose
55+
extensions:::Rose
56+
charts:::Aqua
57+
demo:::Aqua
58+
classDef Pine stroke-width:1px, stroke-dasharray:none, stroke:#254336, fill:#27654A, color:#FFFFFF
59+
classDef Sky stroke-width:1px, stroke-dasharray:none, stroke:#374D7C, fill:#E2EBFF, color:#374D7C
60+
classDef Rose stroke-width:1px, stroke-dasharray:none, stroke:#FF5978, fill:#FFDFE5, color:#8E2236
61+
classDef Aqua stroke-width:1px, stroke-dasharray:none, stroke:#46EDC8, fill:#DEFFF8, color:#378E7A
62+
```
63+
64+
## Repositories
65+
66+
### [`diracx`](https://github.com/DIRACGrid/diracx)
67+
68+
The main repository containing all Python packages. It holds both **backend** (server-side) and **frontend CLI** (client-side) code:
69+
70+
- **Backend**`diracx-core`, `diracx-db`, `diracx-logic`, `diracx-routers`, `diracx-tasks`: the server that exposes an OpenAPI-based REST API.
71+
- **Frontend (CLI)**`diracx-client`, `diracx-api`, `diracx-cli`: the Python client, higher-level API, and command-line interface that consume the REST API.
72+
73+
This repository also owns the `mkdocs.yml` that defines the navigation for the entire documentation site.
74+
75+
### [`diracx-web`](https://github.com/DIRACGrid/diracx-web)
76+
77+
The web interface, built with TypeScript / React / Next.js. It is a separate frontend that also consumes the REST API served by `diracx-routers`. See [Web architecture](web-architecture.md) for the internal package structure.
78+
79+
Documentation files in this repo are merged into the main site by the [mkdocs-diracx-plugin](https://github.com/DIRACGrid/mkdocs-diracx-plugin). See [Documentation system](documentation-system.md) for details on how the merge works.
80+
81+
### [`diracx-charts`](https://github.com/DIRACGrid/diracx-charts)
82+
83+
Helm charts for deploying DiracX (backend + web) on Kubernetes. Also provides `run_demo.sh` for running a local development instance. Documentation files are similarly merged into the main site.
84+
85+
## What "Backend" and "Frontend" mean in this project
86+
87+
The terms follow standard software architecture usage:
88+
89+
- **Backend** = server-side code that processes requests, accesses databases, and enforces business logic.
90+
- **Frontend** = client-side code that users interact with to consume backend services.
91+
92+
DiracX has two frontends:
93+
94+
| Frontend | Language | Repository | Interface |
95+
| -------- | ---------- | ------------ | -------------------------------------- |
96+
| **CLI** | Python | `diracx` | Command-line + programmatic Python API |
97+
| **Web** | TypeScript | `diracx-web` | Browser-based graphical interface |
98+
99+
Both communicate with the backend through the same OpenAPI-based REST API.
100+
101+
## Where to make changes
102+
103+
| I want to... | Repository | Relevant docs |
104+
| ------------------------------- | --------------- | -------------------------------------------------------------- |
105+
| Add or modify a REST endpoint | `diracx` | [Add a route](../how-to/add-a-route.md) |
106+
| Add or modify business logic | `diracx` | [Designing functionality](designing-functionality.md) |
107+
| Add or modify a database | `diracx` | [Add a DB](../how-to/add-a-db.md) |
108+
| Add or modify a CLI command | `diracx` | [Add a CLI command](../how-to/add-a-cli-command.md) |
109+
| Add or modify the web interface | `diracx-web` | [Getting started (web)](../tutorials/web-getting-started.md) |
110+
| Create a web extension | `diracx-web` | [Creating a web extension](../tutorials/web-extensions.md) |
111+
| Change deployment / Helm values | `diracx-charts` | [Chart structure](../../admin/explanations/chart-structure.md) |
112+
| Run the demo locally | `diracx-charts` | [Run demo](run_demo.md) |

docs/dev/how-to/contribute.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,9 @@
1919

2020
=== "DiracX Web"
2121

22-
**Requirements:** [Getting Started](../tutorials/getting-started.md)
23-
24-
- **Code Documentation:** Ensure that any code you write is well-documented. This includes:
25-
26-
- Inline comments where necessary to explain complex logic.
27-
- Updating or creating Storybook documentation if you are contributing to the `diracx-web-components` library.
28-
29-
- **Writing/Updating Tests:** When you change or add new code, make sure to write or update tests accordingly. This helps maintain the reliability and stability of the codebase.
22+
**Requirements:** [Setup web environment](setup-web-environment.md)
3023

31-
**Note:** Don't forget to update the `extensions` code if you integrate breaking changes in the `diracx-web-components` library. See [Managing the extension](../setup_environment.md) for further details.
24+
For web-specific contribution guidelines (code documentation, testing, accessibility, Husky hooks), see the [DiracX Web contribution guide](contribute-to-web.md).
3225

3326
### 3. Commit
3427

File renamed without changes.

docs/dev/reference/index.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Reference
2+
3+
Technical reference material for DiracX developers.
4+
5+
## General
6+
7+
- [Coding conventions](coding-conventions.md)
8+
- [Writing tests](writing-tests.md)
9+
- [Test recipes](test-recipes.md)
10+
- [Pixi tasks](pixi-tasks.md)
11+
- [Dev env variables](env-variables.md)
12+
13+
## Backend
14+
15+
- [Configuration](configuration.md)
16+
- [Dependency injection](dependency-injection.md)
17+
- [Application state](application-state.md)
18+
- [DB transaction model](db-transaction-model.md)
19+
- [Entrypoints](entrypoints.md)
20+
- [Security policies](security-policies.md)
21+
- [Security properties](security-properties.md)
22+
23+
## Frontend
24+
25+
### CLI
26+
27+
- [Client metapathfinder](client-metapathfinder.md)
28+
29+
### Web
30+
31+
- [Coding conventions](web-coding-conventions.md)

docs/dev/tutorials/develop-web.md

Whitespace-only changes.

docs/dev/tutorials/index.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Tutorials
2+
3+
Step-by-step guides to help you get started with DiracX development.
4+
5+
## Backend
6+
7+
- [Getting started](getting-started.md) — Set up your development environment and run DiracX locally
8+
- [Larger developments](larger-developments.md) — Working on bigger changes
9+
- [Advanced tutorial](advanced-tutorial.md) — Deeper dive into DiracX internals
10+
- [Making changes](making-changes.md) — How to make and test changes
11+
- [Run a full DiracX instance locally](run-locally.md) — Deploy the full stack on your machine
12+
- [Play with auth](play-with-auth.md) — Explore the authentication system
13+
14+
## Frontend
15+
16+
### Web
17+
18+
- [Getting started](web-getting-started.md) — Set up the web development environment
19+
- [Creating a web extension](web-extensions.md) — Build a custom DiracX web extension

mkdocs.yml

Lines changed: 79 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,18 @@ nav:
5959
- Tutorials:
6060
- user/tutorials/index.md
6161
- How-To:
62-
- user/how-to/index.md
62+
- Command Line: user/reference/programmatic-usage/command-line-interface.md
63+
- Programmatic Usage:
64+
- user/reference/programmatic-usage/index.md
65+
- Python: user/reference/programmatic-usage/python-interface.md
66+
- HTTPS: user/reference/programmatic-usage/https-interface.md
67+
- Web Interface:
68+
- user/how-to/index.md
69+
- Logging in: user/how-to/login-out.md
70+
- List and share applications: user/how-to/list-and-share-applications.md
71+
- Monitor jobs: user/how-to/monitor-jobs.md
6372
- Explanations:
6473
- user/explanations/index.md
65-
- Web:
66-
- user/web/index.md
67-
- Logging in: user/web/login_out.md
68-
- List and share applications: user/web/list_and_share_applications.md
69-
- Monitor jobs: user/web/monitor_jobs.md
70-
- Programmatic Usage:
71-
- user/reference/programmatic-usage/index.md
72-
- Command Line: user/reference/programmatic-usage/command-line-interface.md
73-
- Python: user/reference/programmatic-usage/python-interface.md
74-
- HTTPS: user/reference/programmatic-usage/https-interface.md
7574
- Reference:
7675
- user/reference/index.md
7776
- Client Config: user/reference/client-configuration.md
@@ -103,6 +102,7 @@ nav:
103102
- Chart structure: admin/explanations/chart-structure.md
104103
- Databases: admin/explanations/database-management.md
105104
- Sandbox Store: admin/explanations/sandbox-store.md
105+
- Web release process: admin/explanations/manage-web-release.md
106106
- Tutorials:
107107
- admin/tutorials/index.md
108108
- Authentication: admin/tutorials/authentication.md
@@ -117,76 +117,91 @@ nav:
117117

118118
- Developer Guide:
119119
- dev/index.md
120-
- Getting started: dev/tutorials/getting-started.md
121120
- Tutorials:
122121
- dev/tutorials/index.md
123-
- Larger developments: dev/tutorials/larger-developments.md
124-
- Advanced tutorial: dev/tutorials/advanced-tutorial.md
125-
- Making changes: dev/tutorials/making-changes.md
126-
- Developing DiracX Web: dev/tutorials/develop-web.md
127-
- Run a full DiracX instance locally: dev/tutorials/run-locally.md
128-
- Play with auth: dev/tutorials/play-with-auth.md
122+
- Backend:
123+
- Getting started: dev/tutorials/getting-started.md
124+
- Larger developments: dev/tutorials/larger-developments.md
125+
- Advanced tutorial: dev/tutorials/advanced-tutorial.md
126+
- Making changes: dev/tutorials/making-changes.md
127+
- Run a full DiracX instance locally: dev/tutorials/run-locally.md
128+
- Play with auth: dev/tutorials/play-with-auth.md
129+
- Frontend:
130+
- Web:
131+
- Getting started: dev/tutorials/web-getting-started.md
132+
- Creating a web extension: dev/tutorials/web-extensions.md
129133
- How-To:
130134
- dev/how-to/index.md
131135
- Contribute: dev/how-to/contribute.md
132-
- Write docs: dev/tutorials/write-docs.md
133-
- Add functionality:
134-
- dev/how-to/add-functionality/index.md
135-
- New route or router: dev/how-to/add-a-route.md
136-
- New task: dev/how-to/add-a-task.md
137-
- New DB: dev/how-to/add-a-db.md
138-
- New CLI command: dev/how-to/add-a-cli-command.md
139-
- New settings: dev/how-to/add-a-setting.md
140-
- Add a test: dev/how-to/add-a-test.md
141-
- Extend DiracX:
142-
- dev/how-to/extend-diracx/index.md
143-
- Develop legacy DIRAC: dev/how-to/develop-legacy-dirac.md
136+
- Write docs: dev/how-to/write-docs.md
144137
- Use the demo:
145138
- dev/how-to/use-the-demo/index.md
146139
- Accessing the client: dev/how-to/use-the-demo/swagger.md
147-
- Use swagger: dev/how-to/use-the-demo/swagger.md
148140
- Accessing DiracX Web: dev/how-to/use-the-demo/web.md
149-
- Client customization: dev/how-to/client-customization.md
150-
- Client generation: dev/how-to/client-generation.md
151-
- Client extensions: dev/how-to/client-extension.md
152-
- Web Development: # TODO: These should move to fit into the new unified structure
153-
- Setup environment: dev/setup_environment.md
154-
- Manage extensions: dev/manage_extension.md
155-
- Web architecture: dev/web-arch.md
156-
- Create application: dev/how-to/create_application.md
157-
- Setup: developer/setup_environment.md
158-
- Contribute: developer/contribute.md
159-
- Manage extensions: developer/manage_extension.md
141+
- Backend:
142+
- Add functionality:
143+
- dev/how-to/add-functionality/index.md
144+
- New route or router: dev/how-to/add-a-route.md
145+
- New task: dev/how-to/add-a-task.md
146+
- New DB: dev/how-to/add-a-db.md
147+
- New settings: dev/how-to/add-a-setting.md
148+
- Add a test: dev/how-to/add-a-test.md
149+
- Extend DiracX:
150+
- dev/how-to/extend-diracx/index.md
151+
- Develop legacy DIRAC: dev/how-to/develop-legacy-dirac.md
152+
- Frontend:
153+
- CLI:
154+
- New CLI command: dev/how-to/add-a-cli-command.md
155+
- Client customization: dev/how-to/client-customization.md
156+
- Client generation: dev/how-to/client-generation.md
157+
- Client extensions: dev/how-to/client-extension.md
158+
- Web:
159+
- Contribute to web: dev/how-to/contribute-to-web.md
160+
- Setup web environment: dev/how-to/setup-web-environment.md
161+
- Create a web application: dev/how-to/create-web-application.md
162+
- Manage web extensions: dev/how-to/manage-web-extension.md
160163
- Explanations:
161164
- dev/explanations/index.md
165+
- Repository structure: dev/explanations/repo-structure.md
162166
- Documentation system: dev/explanations/documentation-system.md
163-
- Components:
164-
- dev/explanations/components/index.md
165-
- API: dev/explanations/components/api.md
166-
- CLI: dev/explanations/components/cli.md
167-
- Databases: dev/explanations/components/db.md
168-
- Routes: dev/explanations/components/routes.md
169-
- Client: dev/explanations/components/client.md
170-
- Testing: dev/explanations/testing.md
171-
- Run demo: dev/explanations/run_demo.md
172-
- Extensions: dev/explanations/extensions.md
173-
- Designing functionality: dev/explanations/designing-functionality.md
167+
- Components overview: dev/explanations/components/index.md
174168
- Dependency management: dev/explanations/dependency-management.md
169+
- Run demo: dev/explanations/run_demo.md
170+
- Backend:
171+
- Components:
172+
- Databases: dev/explanations/components/db.md
173+
- Routes: dev/explanations/components/routes.md
174+
- Testing: dev/explanations/testing.md
175+
- Extensions: dev/explanations/extensions.md
176+
- Designing functionality: dev/explanations/designing-functionality.md
177+
- Frontend:
178+
- CLI:
179+
- API: dev/explanations/components/api.md
180+
- CLI: dev/explanations/components/cli.md
181+
- Client: dev/explanations/components/client.md
182+
- Web:
183+
- Architecture: dev/explanations/web-architecture.md
184+
- Testing: dev/explanations/web-testing.md
175185
- Reference:
176186
- dev/reference/index.md
177-
- Dev env variables: dev/reference/env-variables.md
178-
- Writing tests: dev/reference/writing-tests.md
179187
- Coding conventions: dev/reference/coding-conventions.md
180-
- Configuration: dev/reference/configuration.md
181-
- Dependency injection: dev/reference/dependency-injection.md
182-
- Application state: dev/reference/application-state.md
183-
- Client metapathfinder: dev/reference/client-metapathfinder.md
184-
- DB transaction model: dev/reference/db-transaction-model.md
185-
- Entrypoints: dev/reference/entrypoints.md
186-
- Pixi tasks: dev/reference/pixi-tasks.md
187-
- Security policies: dev/reference/security-policies.md
188-
- Security properties: dev/reference/security-properties.md
188+
- Writing tests: dev/reference/writing-tests.md
189189
- Test recipes: dev/reference/test-recipes.md
190+
- Pixi tasks: dev/reference/pixi-tasks.md
191+
- Dev env variables: dev/reference/env-variables.md
192+
- Backend:
193+
- Configuration: dev/reference/configuration.md
194+
- Dependency injection: dev/reference/dependency-injection.md
195+
- Application state: dev/reference/application-state.md
196+
- DB transaction model: dev/reference/db-transaction-model.md
197+
- Entrypoints: dev/reference/entrypoints.md
198+
- Security policies: dev/reference/security-policies.md
199+
- Security properties: dev/reference/security-properties.md
200+
- Frontend:
201+
- CLI:
202+
- Client metapathfinder: dev/reference/client-metapathfinder.md
203+
- Web:
204+
- Coding conventions: dev/reference/web-coding-conventions.md
190205

191206
markdown_extensions:
192207
- admonition

0 commit comments

Comments
 (0)