First off, thank you for considering contributing to Diskus! It's people like you that make Diskus a great modern commenting platform.
Diskus is built as an open-source monorepo. This document will guide you through our development process and how to get your contributions merged.
Diskus is organized into three main components:
backend/: The core API server built with Bun, Hono, Drizzle ORM, and SQLite.dashboard/: The management interface for site owners, built with Vite and Preact.widget/: The highly optimized, lightweight comment embed script for websites, built with Vite and Preact.
Diskus requires Bun as the primary runtime and package manager.
- Install Bun (v1.1+ recommended):
curl -fsSL https://bun.sh/install | bash - Node.js is not required as we use Bun natively.
Clone the repository and install all dependencies:
git clone https://github.com/fadhilbarkah/diskus.git
cd diskus
bun installCopy the .env.example file (if available) or create a .env file in the root directory. At minimum, ensure SQLite database configurations are set.
You can run all three development servers concurrently from the root directory:
bun run devAlternatively, you can run them individually by navigating to their respective directories and running bun run dev.
We take code quality seriously. Diskus maintains strict global coverage thresholds. Pull requests that lower code coverage will automatically be rejected by our CI/CD pipeline.
To ensure your changes don't break existing functionality, run the test suites:
-
Backend Tests (Uses native
bun testwith in-memory SQLite):cd backend bun test --coverage
(Coverage threshold: 65%)
-
Dashboard Tests (Uses
vitest+happy-dom):cd dashboard bun run test:coverage(Coverage threshold: 80%)
-
Widget Tests (Uses
vitest+happy-dom):cd widget bun run test:coverage(Coverage threshold: 80%)
Tips for Backend Mocking:
If you are adding new controllers, use spyOn and mock from "bun:test" to mock the Service layers. We avoid mocking the database directly to keep the integration layer robust.
Diskus uses Biome to enforce consistent code styling and catch errors quickly.
Before committing, please ensure your code passes the linter:
bun run lint(To automatically fix formatting issues, you can usually run bunx biome check --apply . or follow the instructions provided by the linter.)
- Fork the repo and create your branch from
main. - Write clear code and add tests if you are adding new functionality or fixing a bug.
- Run tests & linter locally to ensure everything is green.
- Create a Pull Request with a clear title and description.
- Describe why you are making the change.
- Link any relevant issues.
- CI/CD Checks: Our GitHub Actions will automatically run Biome (Linter) and all Test Coverage suites on your PR. Ensure they pass!
- Code Review: A maintainer will review your PR, suggest any tweaks, and merge it.
We use GitHub Issues to track bugs and feature requests.
- Bugs: Provide detailed steps to reproduce the issue, what you expected to happen, and what actually happened. Include error logs if applicable.
- Features: Provide a clear explanation of what the feature is and why it would be beneficial to the Diskus ecosystem.
Thank you for helping make Diskus better! Happy coding! 🎉