You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- PR titles become the squash-merge commit message — they must also follow conventional commits.
30
+
- Messages should explain **why** a change was made, not just what.
31
+
32
+
---
33
+
34
+
## Architecture Notes
35
+
36
+
-**State in URL**: View state (filters, selected variants) is stored as query parameters so pages are bookmarkable and shareable.
37
+
-**LAPIS**: All genomic data queries go directly from the browser to LAPIS instances — they do not go through the backend.
38
+
-**Backend**: Only handles subscriptions and collections features; authentication is handled in the frontend (Astro middleware) and proxied to the backend.
39
+
-**Organisms**: Adding a new organism requires entries in `website/src/types/Organism.ts`, `website/src/views/`, and corresponding Astro pages.
Kotlin + Spring Boot backend. All commands run from `backend/`. Docker must be running (tests use Testcontainers).
4
+
5
+
---
6
+
7
+
## Build & Dev Commands
8
+
9
+
```bash
10
+
./gradlew build # Build
11
+
./gradlew test# Run all tests
12
+
./gradlew bootRun --args='--spring.profiles.active=local-db,dashboards-prod'# Run locally
13
+
```
14
+
15
+
The backend will be available at `http://localhost:8080`. Swagger UI at `http://localhost:8080/swagger-ui/index.html`.
16
+
The database from the top-level Docker Compose file needs to be running.
17
+
18
+
## Running a Single Test
19
+
20
+
```bash
21
+
# Run a single test class:
22
+
./gradlew test --tests "org.genspectrum.dashboardsbackend.controller.SubscriptionsControllerTest"
23
+
24
+
# Run a single test method (use the full backtick-quoted name):
25
+
./gradlew test --tests "org.genspectrum.dashboardsbackend.controller.SubscriptionsControllerTest.GIVEN I created a subscription WHEN getting subscriptions THEN contains created subscription"
26
+
```
27
+
28
+
## Lint
29
+
30
+
```bash
31
+
./gradlew ktlintCheck
32
+
./gradlew ktlintFormat
33
+
```
34
+
35
+
---
36
+
37
+
## Code Style
38
+
39
+
### Style
40
+
- Enforced by **ktlint** (version 1.4.1). Run `./gradlew ktlintFormat` to auto-fix.
41
+
- Follow standard Kotlin idioms: data classes, sealed interfaces, extension functions.
42
+
43
+
### Naming
44
+
- Classes/interfaces: `PascalCase`
45
+
- Functions/variables: `camelCase`
46
+
- Constants: `UPPER_CASE`
47
+
- Test method names use backtick syntax describing behavior:
48
+
```kotlin
49
+
@Test
50
+
fun`GIVEN some state WHEN action THEN expected result`() { ... }
51
+
```
52
+
53
+
### Logging
54
+
Use `kotlin-logging` (`io.github.microutils:kotlin-logging-jvm`):
55
+
```kotlin
56
+
privateval log =KotlinLogging.logger {}
57
+
log.info { "message" }
58
+
```
59
+
60
+
(There should be one global logger instance that can be reused everywhere)
0 commit comments