# Nextcloud Forum
[](https://github.com/chenasraf/nextcloud-forum/releases/latest)
[](https://github.com/chenasraf/nextcloud-forum/actions/workflows/phpunit-mysql.yml)
[](https://github.com/chenasraf/nextcloud-forum/actions/workflows/phpunit-pgsql.yml)
A full-featured forum application for Nextcloud, allowing users to create discussion categories,
threads, and posts within their Nextcloud instance.

## β οΈ Early Development Notice
**This app is in early stages of development.** While functional, you may encounter bugs or
incomplete features. Please report any issues on
[GitHub](https://github.com/chenasraf/nextcloud-forum/issues/new/choose) and consider backing up
your data regularly.
## Features
- **Category Management**: Organize discussions into categories with headers and custom permissions
- **Threaded Discussions**: Create and participate in threaded conversations
- **BBCode Support**: Rich text formatting with built-in and custom BBCode tags
- **File Attachments**: Attach files from Nextcloud to posts with secure permission-based access
- **Reactions**: React to posts with emoji reactions
- **User Roles & Permissions**: Fine-grained permission system for moderators and administrators
- **Read Markers**: Track unread posts and threads
- **Search**: Full-text search across threads and posts
- **Modern UI**: Built with Vue 3 and Nextcloud Vue components
## Documentation
For detailed usage instructions, administration guides, and more, visit the
[Forum Wiki](https://github.com/chenasraf/nextcloud-forum/wiki).
## Installation
### From the Nextcloud App Store
Install Forum directly from your Nextcloud instance through the Apps page.
### Manual Installation
1. Download the latest release from the [releases page](https://github.com/chenasraf/forum/releases)
2. Extract to your Nextcloud apps directory:
```bash
cd /path/to/nextcloud/custom_apps
tar xfv forum-vX.X.X.tar.gz
```
3. Enable the app from Nextcloud's Apps page or via command line:
```bash
php occ app:enable forum
```
## Administration
### OCC Commands
The Forum app provides several OCC commands for administration and maintenance, including commands
for repairing installations, rebuilding statistics, and managing user roles.
For a complete list of available commands, usage examples, and detailed documentation, see the
[OCC Commands Wiki page](https://github.com/chenasraf/nextcloud-forum/wiki/OCC-Commands).
## Contributing
I am developing this app on my free time, so any support, whether code, issues, or just stars is
very helpful to sustaining its life. If you are feeling incredibly generous and would like to donate
just a small amount to help sustain this project, I would be very very thankful!
I welcome any issues or pull requests on GitHub. If you find a bug, or would like a new feature,
don't hesitate to open an appropriate issue and I will do my best to reply promptly.
## Development
### Automation
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](https://github.com/okonet/lint-staged),
which automatically formats code before committing.
> π οΈ The NPM package [husky](https://www.npmjs.com/package/husky) takes care of installing the
> pre-commit hook automatically after `pnpm install`.
---
### Manual Commands
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 unit and integration 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` |
---
### Scaffolding
Generate boilerplate for common app pieces with:
```bash
pnpm gen [name]
```
> **`name` is required** for every type **except** `migration`.
#### Available generators
| 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\\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`. |
##### How migrations are numbered
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 like `YYYYMMDDHHmmss` (via `date-fns`)
You donβt pass a name for migrations.
## Resources
### Nextcloud Development
- [Nextcloud App Development Guide](https://nextcloud.com/developer/)
- [Nextcloud Developer Manual](https://docs.nextcloud.com/server/latest/developer_manual/)
- [Nextcloud Vue Components](https://github.com/nextcloud/nextcloud-vue)
- [Publishing to the App Store](https://nextcloudappstore.readthedocs.io/en/latest/developer.html)
### Technologies Used
- **Frontend**: [Vue 3](https://vuejs.org/), [Vite](https://vitejs.dev/),
[TypeScript](https://www.typescriptlang.org/)
- **Backend**: PHP 8.1+,
[Nextcloud OCP API](https://docs.nextcloud.com/server/latest/developer_manual/)
- **Database**: SQLite, MySQL, or PostgreSQL (via Nextcloud)
- **BBCode Parsing**: [ChrisKonnertz/BBCode](https://github.com/chriskonnertz/bbcode)
## License
This app is licensed under the [AGPL-3.0-or-later](LICENSE) license.