Skip to content

Commit 94a2993

Browse files
authored
Merge pull request #726 from GenSpectrum/main
Update prod from main
2 parents a6c86e2 + db1555f commit 94a2993

24 files changed

Lines changed: 616 additions & 330 deletions

.github/pull_request_template.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ When applicable, add a screenshot showing the main effect this PR has, even if "
1616
e.g. changed layout, changed button text, different logging in backend.
1717
This helps others quickly grasping what you did even if they are not familiar with the code base.
1818
-->
19+
20+
## PR Checklist
21+
- [ ] All necessary documentation has been adapted.
22+
- [ ] The implemented feature is covered by an appropriate test.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Every view has a section that lets the user set filters on the sequence data tha
3434
- selecting a region (sequences from Germany, the US or Asia),
3535
- considering only sequences with a certain mutation.
3636

37-
Every view also has a section that shows a number of diagrams that visualize the data that match the filters that the user set.
37+
Every view also has a section that shows diagrams that visualize the data that match the filters that the user set.
3838

3939
The currently set filters are considered the "state" of the view.
4040

@@ -59,7 +59,7 @@ Think: `prevalence = count(variant in Germany) / count(all sequences in Germany)
5959

6060
### Basic guidelines
6161

62-
We make use of some major libraries: Astro, React, Daisyui, and Tailwindcss.
62+
We make use of some major libraries: Astro, React, DaisyUI, and Tailwindcss.
6363

6464
- Render pages using Astro when possible
6565
- Astro render HTML on the server, which is faster than rendering on the client.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Currently, we support the following organisms:
1919
- West Nile Virus
2020
- RSV-A
2121
- RSV-B
22+
- Mpox
23+
- Ebola Sudan
24+
- Ebola Zaire
25+
- Crimean-Congo Hemorrhagic Fever (CCHF)
2226

2327
The dashboards also allow users to create subscriptions to receive notifications
2428
when there is new data above a configurable threshold for certain variant of an organism.

docs/arc42/01-introduction.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Introduction and Goals
2+
3+
> Files in this folder document the architecture of the project using the [arc42](https://arc42.org/) template.
4+
5+
The GenSpectrum dashboards visualize pathogen genomic data obtained from [LAPIS](https://github.com/GenSpectrum/LAPIS) instances.
6+
7+
Important requirements are:
8+
9+
* **interactive**:
10+
Users can set filters on the data (such as restricting the data to a certain date range, region, or mutation).
11+
This allows users to explore the data in a flexible way.
12+
* **realtime**:
13+
The visualizations update in realtime when the user changes the filters.
14+
This allows users to be ahead of time since they don't depend on us providing them with precomputed data.
15+
16+
One important use case is that users should be able to search for new emerging variants of pathogens.
17+
Interactivity and realtime updates are crucial for this use case,
18+
since users can browse the data.
19+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Architecture Constraints
2+
3+
* The dashboards are an app that run in a standard web browser.
4+
We host an instance that is accessible via the internet.
5+
* The genomic data is obtained from LAPIS instances.
6+
* We want to use the [Dashboard Components](https://github.com/GenSpectrum/dashboard-components/tree/main/components)
7+
as much as possible.
8+
9+
Non-constraints:
10+
11+
* In contrast to other GenSpectrum applications, the dashboards do not need to be reusable.
12+
It is not intended to be hosted by anyone else (although of course it is possible to do so).
13+
It is not intended to be configurable by the user.

docs/arc42/03-context.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# System Context
2+
3+
![context](../plantuml/03-context.svg)
4+
5+
* Users access the dashboards website via HTTP.
6+
* The backend is not publicly accessible since it does not have authorization implemented.
7+
All access should be proxied through the website.
8+
* To log in, we use a GitHub OAuth app.
9+
Users can log in with their GitHub account to access additional account related features.
10+
* Since the subscription feature is currently on hold and not fully implemented yet,
11+
the backend is not used and the login functionality is disabled.
12+
* No login is required to access the visualization pages.

docs/arc42/04-solution-strategy.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Solution Strategy
2+
3+
We decided to use Astro and React for the frontend.
4+
Astro comes with a server application that is deployed to our servers.
5+
Thus, we don't need a separate infrastructure that serves files for the frontend,
6+
and we can use it as a proxy for the backend.
7+
Where more interactivity is needed, we use React components within the static Astro pages.
8+
9+
For data visualization, we use the [GenSpectrum Dashboards Components](https://github.com/GenSpectrum/dashboard-components).
10+
Every organism that the dashboards support has several pages that are composed of dashboard components
11+
to support a certain view on the data.
12+
A filter section lets the user specify which data should be considered.
13+
The filter is persisted in the URL as query parameters so that users can share the current view with others or bookmark it.
14+
15+
The backend is a Spring Boot application that provides a REST API. Data is stored in a PostgreSQL database.
16+
The backend was developed to support the subscriptions features of the dashboards.
17+
The subscriptions are stored in the database and can be managed via the backend API.
18+
They are linked to the GitHub account of the user.
19+
At the time of implementation, setting up a GitHub app was the easiest way to authenticate users.
20+

docs/arc42/06-runtime-view.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Runtime View
2+
3+
This depicts an example use case of a user using the GenSpectrum dashboards to explore pathogen genomic data:
4+
5+
![runtime-view](../plantuml/06-runtime-view-filter-sequences.svg)
6+
7+
This diagram shows the login process that is required before adding a subscription:
8+
9+
![add-subscription](../plantuml/06-runtime-view-add-subscription.svg)
10+

docs/arc42/07-deployment-view.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Deployment View
2+
3+
The dashboards are deployed on the staging and production servers of GenSpectrum.
4+
Every commit builds a Docker image of the backend and the website.
5+
The Docker images are then deployed via Docker compose.
6+
7+
The staging server has the `latest` Docker tag deployed which is built on the `main` branch,
8+
while the production server has the `prod` tag deployed which is built on the `prod` branch.
9+
Deployment happens automatically via [Watchtower](https://github.com/containrrr/watchtower).
10+
It pulls and starts new images once they are available.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Architecture Decisions
2+
3+
## Login Solution
4+
5+
### Context
6+
7+
For the subscriptions feature, we need a way to authenticate users.
8+
Every user should be able to manage their subscriptions and see their data.
9+
We also need a way to notify users in case the subscription triggers (via e-mail or Slack hook).
10+
11+
We considered several options for authentication:
12+
13+
* Using Keycloak
14+
* Using GitHub OAuth
15+
* Using a managed service
16+
17+
### Decision
18+
19+
We decided to use a GitHub OAuth app for authentication.
20+
It was an easy and straightforward way to authenticate users.
21+
We don't need to host or maintain an authentication service ourselves.
22+
23+
We also decided to use [auth-astro](https://github.com/nowaythatworked/auth-astro)
24+
to handle the authentication flow in the Astro application.
25+
It supports GitHub OAuth out of the box.
26+
27+
We refrained from using Keycloak since setting it up is more effort.
28+
We would have needed to host it on one of our servers and configure it properly.
29+
Although is it relatively easy to get a Keycloak Docker image running,
30+
it is still difficult to get the configuration right.
31+
None of the team members was an expert in Keycloak and misconfigurations can lead to security issues.

0 commit comments

Comments
 (0)