| .. | ||
| app | ||
| common | ||
| docker/keycloak | ||
| gradle/wrapper | ||
| modules | ||
| workers/notification-worker | ||
| .gitignore | ||
| build.gradle.kts | ||
| docker-compose.yml | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| requests.http | ||
| settings.gradle.kts | ||
Mosenioring Backend
Production-ready Kotlin/Spring Boot 3 modular monolith skeleton for patient-caregiver-doctor coordination.
Requirements
- Java 21
- Docker + Docker Compose
Local run
- Start dependencies:
docker compose up -d
- Run the API (local profile, local auth enabled):
SPRING_PROFILES_ACTIVE=local \
ALLOW_LOCAL_AUTH=true \
./gradlew :app:bootRun
SPRING_PROFILES_ACTIVE=dev \
ALLOW_LOCAL_AUTH=false \
./gradlew :app:bootRun
- (Optional) Run the worker:
./gradlew :workers:notification-worker:bootRun
Required env flags (local/dev):
SPRING_PROFILES_ACTIVE=localALLOW_LOCAL_AUTH=true(enables local auth headers)KEYCLOAK_ISSUER_URI=http://localhost:8081/realms/mosenioring(if using Keycloak)- Frontend should set
USE_LOCAL_AUTH=truewhen using local auth headers.
Auth
- The backend is a JWT resource server and does not handle user passwords.
- Local auth shortcut is available only when
SPRING_PROFILES_ACTIVE=localandALLOW_LOCAL_AUTH=true.
Local headers (dev only):
X-Local-Email: user id/emailX-Local-Roles: comma-separated roles (ADMIN, DOCTOR, CAREGIVER)X-Tenant-Id: tenant id
OpenAPI
Health
Key services
- Postgres: localhost:5432 (mosenioring/mosenioring)
- Keycloak: http://localhost:8081 (admin/admin)
- RabbitMQ: http://localhost:15672 (guest/guest)
- MinIO: http://localhost:9001 (minio/minio123)
Notes
- Tenant ID is enforced via
TenantFilterusing JWT claimtenant_id, orX-Tenant-Idheader (local). - Medication plan creation publishes a
MedicationPlanCreatedoutbox event. - Worker consumes and emits
NotificationRequestedevents with idempotency via Redis.