Thank you for your interest in contributing! This guide covers everything you need to get started.
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold it.
- Node.js 20+ LTS
- PostgreSQL — or use SQLite for lightweight local dev (set
DATABASE_URL="file:./dev.db"in.env.local) - Git
-
Fork and clone the repository:
git clone https://github.com/<your-username>/divest.git cd divest
-
Install dependencies:
npm install
-
Copy the environment template and fill in local values:
cp .env.example .env.local
See README.md for a description of each variable.
-
Set up the database:
npx prisma db push # Apply schema npx prisma db seed # Optional: load sample data
-
Run the test suite to verify your setup:
npm test -
Start the dev server:
npm run dev # http://localhost:3000
Use the bug report issue template. Include:
- A clear description of what went wrong
- Steps to reproduce
- Expected vs actual behaviour
- Your environment details
Use the feature request issue template.
-
Create a branch from
mainusing the naming convention:feature/description-of-featurebugfix/description-of-bugchore/description-of-taskhotfix/critical-issue
-
Make your changes. All new features require tests; all bug fixes require a regression test.
-
Ensure all checks pass before opening a PR:
npm run typecheck # No TypeScript errors npm run lint # No ESLint errors npm test # Unit tests pass npm run test:integration # Integration tests pass
-
Push your branch and open a PR against
main. Fill in the PR template. -
PRs are merged by squash merge. The PR title becomes the squash commit message on
main, so it must follow the Conventional Commits format below (e.g.feat: add user preferences endpoint).
This project uses Conventional Commits:
type(scope): short description
feat(api): add user preferences endpoint
fix(parser): handle empty input gracefully
docs: update installation instructions
chore: bump dependencies
refactor(core): extract validation logic
test(auth): add missing edge-case coverage
| Type | Purpose | SemVer impact |
|---|---|---|
feat |
New feature | MINOR bump |
fix |
Bug fix | PATCH bump |
docs |
Documentation only | No bump |
chore |
Tooling, deps, build | No bump |
refactor |
Code restructure, no behaviour change | No bump |
test |
Adding or fixing tests | No bump |
ci |
CI/CD changes | No bump |
BREAKING CHANGE |
Footer or ! after type |
MAJOR bump |
npm test # Unit tests (Vitest)
npm run test:watch # Watch mode — primary TDD loop
npm run test:integration # Integration tests (real SQLite DB)
npm run test:e2e # E2E tests (Playwright)Tests live under tests/:
tests/unit/— unit tests for calculations, utilities, and componentstests/integration/— server action tests against a real SQLite databasetests/e2e/— Playwright end-to-end user flows
npm run lint # ESLint (reports errors; fix with --fix flag)
npm run typecheck # TypeScript strict type checkingThe project uses ESLint with the Next.js config and TypeScript strict mode. There are no separate formatting rules — just keep your code consistent with the surrounding style.