forked from NuQloud/nc-talk-ai
- Rewrite the four longest guides (RAG background jobs, webhook debug, bot setup, onboarding) at roughly half the length: drop historical bug-fix notes, duplicated command blocks, ASCII mega-diagrams and filler sections, keep everything operationally useful. - Remove provider-specific recommendations; examples are now neutral OpenAI-compatible endpoints. - Fix stale content: dead doc links in docs/README.md, old repo issue URLs, catalogue tools (now provided via the tool-provider extension point, not built-in), supported NC versions, clone URL in quick start. - Slim DEVELOPMENT.md down to build/test/migration essentials. docs/ shrinks from 2850 to 1278 lines with no loss of setup, debugging or architecture coverage.
2.0 KiB
2.0 KiB
Development
Build, test, and local verification. Requirements: Nextcloud 30–34, PHP 8.1+, Node.js 22, npm 10.5+. The package scripts expect the app inside a Nextcloud checkout, usually under apps-extra/educai.
Frontend
npm ci # install dependencies
npm run build # production build (writes bundles to js/)
npm run watch # rebuild on change
npm run lint # eslint
npm run stylelint
Commit the generated js/ assets — the repository ships deployable bundles. After frontend changes, run a build and hard-refresh the browser (Nextcloud caches bundles aggressively).
PHP
# unit tests (lightweight bootstrap — no server install needed)
vendor/bin/phpunit --bootstrap tests/unit/bootstrap.php tests/unit
# single test file
vendor/bin/phpunit --bootstrap tests/unit/bootstrap.php tests/unit/Service/SettingsServiceTest.php
# syntax check
php -l lib/Service/BotService.php
Migrations
Migrations live in lib/Migration/ and run on app enable and occ upgrade:
sudo -u www-data php occ app:enable educai
sudo -u www-data php occ upgrade --no-interaction
sudo -u www-data php occ migrations:status educai
Useful occ Commands
Adapt the prefix to your setup (e.g. docker exec -u www-data <container> php occ …):
sudo -u www-data php occ app:enable educai # also re-runs repair steps
sudo -u www-data php occ app:disable educai
sudo -u www-data php occ talk:bot:list # shared Talk bot registration
sudo -u www-data php cron.php # run background jobs (RAG etc.)
sudo -u www-data php occ background-job:list --limit=200
sudo -u www-data php occ background-job:execute --force-execute <job-id>
When testing Talk behavior, watch nextcloud.log for EducAI: entries.
Documentation
Keep the root README short; details belong in docs/. When changing behavior, update the closest guide (see docs/README.md for the index).