Thanks for your interest in contributing! Here's how to get started.
# Clone the repo
git clone https://github.com/draftmark-app/draftmark.git
cd draftmark
# Start the database
docker compose up -d postgres
# Install dependencies and set up Prisma
npm install
npx prisma generate
npx prisma migrate dev
# Copy env template
cp .env.example .env
# Start dev server (port 3333)
npm run devNote: Restart the dev server after running npx prisma generate — Next.js won't pick up schema changes otherwise.
# Start the test database
docker compose up -d postgres-test
# Run all tests
npm test
# Watch mode
npm run test:watchTests are split into unit tests (no DB) and integration tests (with DB). Integration tests run sequentially to avoid cleanup race conditions.
- Fork the repo and create a branch from
main - Make your changes
- Add or update tests as needed
- Run
npm testandnpm run lintto verify - Open a pull request
- Keep PRs focused — one feature or fix per PR
- Write a clear description of what changed and why
- Include test coverage for new functionality
- Make sure all tests pass before requesting review
prisma/schema.prisma — Data models
src/app/api/v1/ — API routes
src/app/ — Next.js pages
src/components/ — React components
src/lib/ — Shared utilities (auth, db, markdown)
src/__tests__/ — Unit and integration tests
- TypeScript throughout
- Follow existing patterns in the codebase
- Use Prisma for all database access
- API routes return JSON with consistent error shapes
Some features require external API keys (see .env.example):
- Resend — email notifications
- OpenRouter — AI-powered stakeholder views
These are optional. The app works without them — those features just won't be available.
Open an issue and we'll help you out.