Repository navigation
Development
Chen Asraf edited this page Mar 18, 2026
·
2 revisions
Most development processes are automated:
- GitHub Actions run tests, builds, and validations on each push or pull request.
- Pre-commit formatting is handled by lint-staged, which automatically formats code before committing.
🛠️ The NPM package husky takes care of installing the pre-commit hook automatically after
pnpm install.
While automation handles most workflows, the following commands are available for local development and debugging:
| Command | Description | Notes |
|---|---|---|
make |
Installs dependencies and compiles frontend/backend assets | |
make test |
Runs PHP unit tests | |
make test-frontend |
Runs frontend (Vitest) tests | |
make format |
Auto-fix code style | |
make lint |
Check code quality | |
make openapi |
Generate OpenAPI documentation | Output saved to openapi.json
|
make appstore |
Production build for Nextcloud app store | |
make source |
Create full source package | |
make distclean |
Clean build artifacts and dependencies | |
make sign |
Sign release archive with SHA-512 signature | Run after uploading .tar.gz to GitHub. Uses ~/.nextcloud/certificates/forum.key
|
Generate boilerplate for common app pieces with:
pnpm gen <type> [name]
nameis required for every type exceptmigration.
| Type | Purpose | Output directory | Name required? | Template folder | Notes |
|---|---|---|---|---|---|
component |
Vue single-file component for reusable UI | src/components |
✅ | gen/component |
For user-facing building blocks. |
view |
Vue view / route view | src/views |
✅ | gen/view |
Pair with your router. |
api |
PHP controller (API endpoint) | lib/Controller |
✅ | gen/api |
PSR-4 namespace: OCA\<App>\Controller. |
service |
PHP service class | lib/Service |
✅ | gen/service |
Business logic; DI-friendly. |
util |
PHP utility/helper | lib/Util |
✅ | gen/util |
Pure helpers / small utilities. |
model |
PHP DB model / entity | lib/Db |
✅ | gen/model |
Pair with migrations. |
command |
Nextcloud OCC console command | lib/Command |
✅ | gen/command |
Shows up in occ. |
task-queued |
Queued background job | lib/Cron |
✅ | gen/task-queued |
Extend queued job base. |
task-timed |
Timed background job (cron) | lib/Cron |
✅ | gen/task-timed |
Scheduled execution. |
migration |
Database migration | lib/Migration |
❌ | gen/migration |
Auto-numbers version; injects version and dt. |
The scaffolder looks at lib/Migration, finds the latest VersionNNNN... file, and increments
it for you. It also injects:
-
version— the next numeric version -
dt— a timestamp likeYYYYMMDDHHmmss(viadate-fns)
You don't pass a name for migrations.
- Nextcloud App Development Guide
- Nextcloud Developer Manual
- Nextcloud Vue Components
- Publishing to the App Store
- Frontend: Vue 3, Vite, TypeScript
- Backend: PHP 8.1+, Nextcloud OCP API
- Database: SQLite, MySQL, or PostgreSQL (via Nextcloud)
- BBCode Parsing: ChrisKonnertz/BBCode
- Testing: PHPUnit (backend), Vitest + Vue Test Utils (frontend)