Controllers
VerseController
Location: lib/Controller/VerseController.php
Responsibilities:
Provide an endpoint for retrieving the daily Bible verse
Accept language and version parameters
Return JSON containing verse text, reference, and source URL
Handle API errors gracefully
Request flow:
JavaScript fetches the verse from the controller.
The controller delegates to
VerseService.The service calls the external API.
The controller returns normalised JSON.
SettingsController
Location: lib/Controller/SettingsController.php
Responsibilities:
Read and write admin and personal settings
Use Nextcloud’s
IConfigAPIEnforce admin/user separation
Provide JSON responses for the settings UI
Security considerations:
Admin settings are restricted to administrators.
Personal settings are restricted to the authenticated user.
CSRF protection is handled by Nextcloud.