How glitchmymind/five-rule-server works
Project type and purpose
• From the file tree and README we see:
• A Gradle-Kotlin project (build.gradle.kts, settings.gradle.kts)
• A Ktor application entry point (Application.kt) plus Routing, Authentication, Serialization plugins
• Feature packages for authentication, feed, rules
• Database models under db/models and DbSettings pointing at PostgreSQL (pg_hba.conf)
• A small in-memory cache (TimedCache) and OTP session management
• A Procfile hinting at deployment (e.g., Heroku)
⇒ This is a standalone backend microservice (Ktor + Koin DI) that exposes REST endpoints for authentication, feeds, rule management, token handling, and uses PostgreSQL and external OTP/FlashCall services.
File structure
Top-level:
• Application.kt – Ktor server bootstrap
• plugins/ – Ktor plugin registration (Routing, Authentication, Serialization)
• di/ – KoinModule DI definitions
• features/ – Modular domain logic, each with Data, Interactor, Routing subpackages
• db/ – Database configuration and Exposed table definitions (models)
• cache/ – In-memory timed cache abstraction
• sessions/ – OTP session store
• models/ – DTOs bridging domain→API
• resources/logback.xml – logging
• Procfile, system.properties – deployment
README for additional insights
• The only note is a Gist on token handling. This confirms an emphasis on secure token management and OTP flows.