Ktor API for rally notes and related resources.
This project reads database and server settings from environment variables (see src/main/resources/application.yaml).
No secrets should be committed to git.
- Copy the example env file:
cp .env.example .env-
Edit
.envand set your local values. -
Load env vars in your shell before running the app:
set -a
source .env
set +aKtor does not load
.envautomatically. You must export these variables in your shell or configure them in your IDE run configuration.
| Variable | Purpose | Default |
|---|---|---|
DB_HOST |
Database host | localhost |
DB_PORT |
Database port | 3306 |
DB_NAME |
Database name | rally_notes |
DB_USERNAME |
Database username | rally_user |
DB_PASSWORD |
Database password | change_me |
DB_POOL_SIZE |
Hikari pool size | 20 |
./gradlew test
./gradlew runSwagger UI is enabled through configureOpenAPI() and exposed at:
http://localhost:8080/swagger
In this project, the OpenAPI spec is generated from route metadata added with Ktor's describe { ... } DSL. Route handlers stay in routes/*Routes.kt, while OpenAPI definitions are kept in parallel files under routes/docs/*OpenApi.kt and attached via helper functions (for example, attachRallyOpenApi(...)).
- Start the API (
./gradlew run). - Open
http://localhost:8080/swagger. - Expand a resource group (for example,
RalliesorTeams). - Inspect request/response schemas and status codes.
- Use Try it out to execute requests directly from the browser.
Note:
GET /healthis intentionally hidden from Swagger to keep API docs focused on business endpoints.