How sti-233/localserverkt works
LocalServerKt is a Ktor-based LAN server offering authenticated chat and AI, administrative controls, file browsing, music and video search, and a browser/download proxy. The main flow is a client request entering the server, passing realm checks where required, reaching a feature route, and receiving a page, API response, stream, or file. The graph preserves the README’s major capabilities; several routes and integrations are documented but their implementation excerpts were not provided, so those relationships are shown only when supported by the README or source index.
Main entry points: Server.kt Ktor server · Chat.kt Chat routes · Ai.kt AI routes · Network.kt Browser and download
Components 23
Server and access
- Ktor server
src/main/kotlin/localserver/Server.kt - Access realms
src/main/kotlin/localserver/Server.kt
Chat and AI
- Chat routes
src/main/kotlin/localserver/module/Chat.kt - Chat page
src/main/resources/chat.html - AI routes
src/main/kotlin/localserver/module/Ai.kt - AI page
src/main/resources/ai.html - AI model service
Media search
- Music routes
src/main/kotlin/localserver/module/Music.kt - Music API client
src/main/kotlin/localserver/lib/NeteaseMusicApi/network/MusicNetwork.kt - Music service API
src/main/kotlin/localserver/lib/NeteaseMusicApi/network/MusicService.kt - Netease service
- Video routes
src/main/kotlin/localserver/module/Video.kt - Bilibili search
src/main/kotlin/localserver/lib/bilibili/Search.kt - Bilibili service
Control and files
- Control routes
src/main/kotlin/localserver/module/Control.kt - File browser routes
src/main/kotlin/localserver/module/File.kt - File browser page
src/main/resources/file.html - Browser and download
src/main/kotlin/localserver/utils/Network.kt - Browser page
src/main/resources/browser.html
Shared services
- User and history data
src/main/kotlin/localserver/utils/Util.kt - HTTP client
src/main/kotlin/localserver/utils/HttpClient.kt - Logging
src/main/kotlin/localserver/utils/Logger.kt
Other components
- Browser client
Connections 24
- Browser client → Ktor server: requests
README.md - Ktor server → Access realms: checks access
src/main/kotlin/localserver/Server.kt - Ktor server → Chat routes: routes to
src/main/kotlin/localserver/Server.kt - Ktor server → AI routes: routes to
src/main/kotlin/localserver/Server.kt - Ktor server → Control routes: routes to
src/main/kotlin/localserver/Server.kt - Ktor server → Music routes: routes to
src/main/kotlin/localserver/Server.kt - Ktor server → Video routes: routes to
src/main/kotlin/localserver/Server.kt - Ktor server → Browser and download: routes to
src/main/kotlin/localserver/Server.kt - Chat routes → User and history data: reads and writes
src/main/kotlin/localserver/module/Chat.kt - Chat routes → Chat page: redirects to
README.md - AI routes → AI page: redirects to
README.md - AI routes → AI model service: streams requests
src/main/kotlin/localserver/module/Ai.kt - Music routes → Music API client: calls
src/main/kotlin/localserver/module/Music.kt - Music API client → Music service API: uses
src/main/kotlin/localserver/lib/NeteaseMusicApi/network/MusicNetwork.kt - Music service API → Netease service: requests
src/main/kotlin/localserver/lib/NeteaseMusicApi/network/MusicService.kt - Video routes → Bilibili search: calls
src/main/kotlin/localserver/module/Video.kt - Bilibili search → Bilibili service: searches
src/main/kotlin/localserver/lib/bilibili/Search.kt - Browser client → File browser routes: browses files
README.md - File browser routes → File browser page: redirects to
README.md - Browser client → Browser and download: uses proxy
README.md - Browser and download → HTTP client: uses
src/main/kotlin/localserver/utils/Network.kt - Ktor server → Browser page: serves page
- Control routes → User and history data: manages users
src/main/kotlin/localserver/module/Control.kt - Ktor server → Logging: logs errors
src/main/kotlin/localserver/Server.kt