A minimal Health Information System built with Ktor (Kotlin) and Exposed ORM, focused on an API-first development approach.
- Backend: Ktor, Exposed ORM, HikariCP, SQLite
- Serialization & Logging: kotlinx-serialization, ContentNegotiation, CallLogging
- Frontend: Static HTML/CSS/JS served via Ktor’s
staticplugin (partially included — home and programs pages only) - Testing: Ktor server testing framework + Kotlin test
backend/
└─ src/main/kotlin/com/example/
├─ Application.kt # Server bootstrap: DB setup, plugins, routing
└─ configs/
├─ Database.kt # configureDatabase() extension
├─ Routing.kt # programRoutes(), clientRoutes(), enrollmentRoutes()
├─ Security.kt # (not used — retained for future extension)
├─ Tables.kt # Exposed table definitions
└─ db/
└─ DatabaseFactory.kt # Exposed database configurations
├─ models/
├─ ProgramDTO.kt # @Serializable for POST /api/programs
├─ ClientDTO.kt # For client creation
├─ ClientResponseDTO.kt # For search results
├─ ClientProfileDTO.kt # For profile with enrolled programs
├─ EnrollmentDTO.kt # For client enrollment into a program
├─ routes/
├─ ProgramRoutes.kt # GET and POST /api/programs
└─ ClientRoutes.kt # Client-related endpoints: create, search, profile
test/
├─ ProgramRoutesTest.kt # Unit tests for program routes
└─ ClientRoutesTest.kt # Unit tests for client and enrollment logic
resources/
└─ static/ # Static UI files (partially used)
build.gradle.kts # Dependencies & Kotlin serialization plugin
docs/
├─ HealthInfoSystem.pptx # Presentation PowerPoint file
└─ HealthInfoSystem_Demo.mp4 # Video prototype demonstration
-
Clone the repo
git clone https://github.com/devcavin/healthinfo-system.git cd healthinfo-system -
Build, Run, and Test
./gradlew clean build # Clean and build ./gradlew run # Start the server ./gradlew test # Run tests
The server listens on
http://localhost:8080. -
Database
The SQLite file is automatically created at./data/.
Access the full project presentation explaining the approach, design, and solution here:
➡️ HealthInfoSystem_Presentation.pptx
Watch the full prototype demonstration here:
➡️ HealthInfoSystem_Demo.mp4
- POST
/api/programs - Request Body:
{ "name": "Malaria", "description": "Prevention and treatment" } - Responses:
201 Created400 Bad Requestfor malformed JSON422 Unprocessable Entityifnameis blank500 Internal Server Erroron DB failure
- GET
/api/programs - Response:
[ { "id": 1, "name": "TB", "description": "Tuberculosis program" }, { "id": 2, "name": "Malaria", "description": "Malaria prevention" } ]
- POST
/api/clients - Request Body:
{ "firstName": "Jane", "lastName": "Doe", "email": "jane.doe@example.com" } - Response:
{ "id": 1 }
- POST
/api/clients/{id}/enroll - Request Body:
{ "programId": 2 } - Response:
{ "message": "Client enrolled successfully" }
- GET
/api/clients?q=searchText - Response:
[ { "id": 1, "firstName": "Jane", "lastName": "Doe", "email": "jane.doe@example.com" } ]
- GET
/api/clients/{id} - Response:
{ "id": 1, "firstName": "Jane", "lastName": "Doe", "email": "jane.doe@example.com", "programs": [ { "id": 2, "name": "Malaria", "description": "Prevention and treatment" } ] }
- ✅ All required API endpoints implemented
- ✅ Client profile successfully exposed for integration
- ✅ CORS enabled for
localhost:8080to allow external system access - ✅ API tests written for program and client workflows
- ✅ Fully focused and delivered API-first implementation
- ✅ Presentation and prototype demonstration completed
Progress Summary:
✓ Full backend setup with Ktor, Exposed & SQLite
✓ Program and Client CRUD features tested
✓ Enrollment and profile APIs connected
✓ Automated test cases written
✓ Documentation, presentation, and prototype ready