Contributing
How to contribute to Emberly — development setup, code standards, and the pull request process.
Thanks for your interest in contributing to Emberly. This guide covers the development workflow, code standards, and how to submit a pull request.
For initial setup, see the Development Setup guide.
Workflow
1. Fork and Clone
Fork the repo on GitHub, then clone your fork:
2. Create a Branch
Branch from main using the appropriate prefix:
| Prefix | Use for |
|---|---|
feat/ | New features |
fix/ | Bug fixes |
docs/ | Documentation only |
refactor/ | Code cleanup with no behavior change |
perf/ | Performance improvements |
3. Make Changes and Commit
Commit messages must follow Conventional Commits:
Common types: feat, fix, docs, refactor, perf, test, ci.
4. Verify Before Pushing
5. Open a Pull Request
Push to your fork and open a PR against main. Fill out the PR template:
- What does this change?
- Why is it needed?
- How was it tested?
- Are there breaking changes?
Code Standards
TypeScript
All code uses strict: true. Avoid any — use unknown and narrow it:
API Routes
API handlers live in app/api/. Use the shared response helpers — do not construct raw NextResponse objects:
Logging
Never use console.*. Use named loggers from @/packages/lib/logger:
Path Aliases
Always use path aliases — never relative paths that cross package boundaries:
| Alias | Resolves to |
|---|---|
@/lib/* | packages/lib/* |
@/components/* | packages/components/* |
@/hooks/* | packages/hooks/* |
@/types/* | packages/types/* |
Common Tasks
Adding a Database Field
- Edit
prisma/schema.prisma - Run
bun run db:migrateto create and apply the migration - Run
bun run db:generateto regenerate the Prisma client - Update any affected TypeScript types in
packages/types/
Adding a New API Endpoint
- Create the route file in
app/api/ - Use
apiResponse/apiErrorhelpers - Gate admin routes with
requireAdmin() - Document the endpoint in the relevant API reference page in
docs.embrly.ca
Pull Request Checklist
Before requesting review, ensure:
bun run typecheckpassesbun run lintpasses (runbun run lint:fixto auto-fix)bun run buildsucceeds- New features have corresponding documentation updates
- Commit messages follow Conventional Commits
Reporting Issues
Create a GitHub issue with:
- A clear title describing the problem (not "it's broken")
- Steps to reproduce, including exact actions
- What you expected vs what happened
- Your environment: OS, Node version, browser if relevant
- The full error message or stack trace
Getting Help
- Questions: GitHub Discussions
- Bugs: GitHub Issues
- Chat: Join the Emberly Discord
All contributions are licensed under AGPL-3.0, the same as the project. By submitting a PR you agree to these terms.