mosenioring/back001/README.md
2026-01-09 18:35:06 +01:00

47 lines
1.1 KiB
Markdown

# Mosenioring Backend
Production-ready Kotlin/Spring Boot 3 modular monolith skeleton for patient-caregiver-doctor coordination.
## Requirements
- Java 21
- Docker + Docker Compose
## Local Dev
1) Start dependencies:
```bash
docker compose up -d
```
2) Run the API:
```bash
./gradlew :app:bootRun -Dspring.profiles.active=local
```
3) Run the worker:
```bash
./gradlew :workers:notification-worker:bootRun
```
## Auth (local profile)
For local development, add headers:
- `X-Local-User`: user id
- `X-Local-Tenant`: tenant id
- `X-Local-Roles`: comma-separated roles (ADMIN, DOCTOR, CAREGIVER)
## OpenAPI
- http://localhost:8080/swagger-ui/index.html
## 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 `TenantFilter` using JWT claim `tenant_id`, or `X-Tenant-Id` header (local).
- Medication plan creation publishes a `MedicationPlanCreated` outbox event.
- Worker consumes and emits `NotificationRequested` events with idempotency via Redis.