Thank you for your interest in contributing! This guide covers development setup, running the project locally, testing, code style, and the PR workflow.
- GHCup — Haskell toolchain manager:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh - Docker & Docker Compose — For database and services
- Node.js 22 — For frontend assets (web-components, Tailwind CSS)
- LLVM — Required for GHC compilation
- libpq — PostgreSQL development libraries
# Clone the repository (fork first if contributing)
git clone https://github.com/monoscope-tech/monoscope.git
cd monoscope
# Install Haskell dependencies
cabal update
# Activate the pre-commit hook for auto-formatting
git config core.hooksPath .githooksThe fastest way to get a running instance:
docker-compose upVisit http://localhost:8080 — default credentials are admin / changeme.
Start additional services with Docker Compose profiles:
# pgAdmin for database management (http://localhost:5050)
docker-compose --profile dev up
# Ephemeral test database (port 5433)
docker-compose --profile test upCopy .env.example to .env and adjust as needed. The defaults are sufficient for local development.
# Build all targets
cabal build all -j
# Run the application
cabal run
# Or with live-reload using ghcid
make live-reloadcabal test unit-tests --ghc-options="-O0" --test-show-details=directOr via Makefile:
make test-unitcabal test doctests --ghc-options="-O0" --test-show-details=directOr via Makefile:
make test-doctestsUSE_EXTERNAL_DB=true cabal test integration-tests --ghc-options="-O0" --test-show-details=directOr via Makefile:
make test-integrationmake test# Match by test name pattern
cabal test unit-tests --test-options='--match="/pattern/"'
# Run with live file-watching
make live-test-reload-unitFourmolu is used for Haskell code formatting. It is automatically run via a GitHub Actions workflow on every push — any formatting changes are auto-committed to your branch. You don't need to format manually before opening a PR.
To format locally:
make fmtTo format on commit (pre-commit hook is in .githooks/pre-commit):
# Already activated via git config core.hooksPath .githooks
# To bypass for a single commit:
SKIP_FOURMOLU=1 git commit ...HLint checks for common Haskell code smells and style issues.
make lintTo auto-fix lint issues:
make fix-lintJavaScript/TypeScript uses Prettier (configured in .prettierrc). Run it via:
npx prettier --write .Tailwind CSS is processed during the build — run it manually with:
make post-css-
Fork the repository on GitHub.
-
Add your fork as a remote:
git remote add fork https://github.com/<your-username>/monoscope.git
-
Create a feature branch from
master:git checkout master git pull upstream master git checkout -b feat/your-feature-name
-
Make your changes, writing tests as needed.
-
Ensure tests pass:
cabal test unit-tests --ghc-options="-O0" cabal test doctests --ghc-options="-O0"
-
Run the linter:
make lint
-
Commit your changes. The pre-commit hook will run fourmolu on staged
.hsfiles. To bypass the hook for a specific commit (e.g., for documentation-only changes):SKIP_FOURMOLU=1 git commit -m "your message"
-
Push your branch to your fork:
git push fork feat/your-feature-name
-
Open a PR against
monoscope-tech/monoscopeon GitHub. -
Fill in the PR template with a clear description of the changes.
-
A maintainer will review and request changes if needed.
The fourmolu.yml GitHub Actions workflow runs on every push to the repository. It automatically formats any .hs files that don't match the fourmolu configuration and commits the changes back to your branch. This means:
- Don't worry about formatting — fourmolu will fix it for you after you push.
- Check the diff after pushing — the bot may have committed formatting fixes.
- Amend or rebase as needed if the bot's commit conflicts with your changes.
monoscope/
├── src/ # Haskell application source
├── static/ # Static assets, migrations, public files
├── web-components/ # TypeScript frontend components
├── cli/ # CLI tool source
├── proto/ # Protocol Buffer definitions
├── test/ # Test scripts and helpers
├── tests/ # Integration test suites
├── app/ # Application entry points
├── npm/ # Node.js helper scripts
├── config/ # Application configuration
├── docs/ # Documentation
└── cabal.project # Cabal build configuration
- Discord — Join the community at https://discord.gg/BSFCaUHxt4
- GitHub Issues — For bugs and feature requests
- Documentation — https://docs.monoscope.tech