Contributing to DentalERP
Thank you for your interest in contributing to DentalERP! This guide will help you get started.
How to Contribute
Reporting Bugs
- Check the existing issues to avoid duplicates
- Use the Bug Report issue template
- Include steps to reproduce, expected behavior, and actual behavior
- Include screenshots if applicable
Suggesting Features
- Open a Feature Request issue
- Describe the use case and why it would benefit dental clinics
- Be as specific as possible about the expected behavior
Submitting Code
- Fork the repository
- Create a branch from
main:git checkout -b feature/your-feature-name - Make your changes following the coding standards below
- Write tests for new functionality
- Run the test suite to ensure nothing is broken:
npm test npm run lint npx tsc --noEmit - Commit with a clear message (see commit conventions below)
- Push to your fork and open a Pull Request
Development Setup
# Clone your fork
git clone https://github.com/YOUR_USERNAME/dental-erp.git
cd dental-erp
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Edit .env with your local MySQL credentials
# Set up the database
npx prisma db push
npx prisma db seed
# Start development server
npm run dev
Coding Standards
General
- Write TypeScript — avoid
anyunless absolutely necessary - Use functional components with hooks (no class components)
- Follow the existing code patterns and directory structure
Naming Conventions
- Files:
kebab-case.ts/kebab-case.tsx - Components:
PascalCase - Functions/variables:
camelCase - Database models:
PascalCase(Prisma convention) - API routes:
app/api/resource-name/route.ts
Code Style
- ESLint config is provided — run
npm run lintbefore committing - Use Zod for input validation on all API routes
- Use
requireAuthAndRole()fromlib/api-helpers.tsfor auth checks - All database queries should be scoped to
hospitalIdfor multi-tenancy
Testing
- Place unit tests in
__tests__/unit/ - Place integration tests in
__tests__/integration/ - Place component tests in
__tests__/components/ - Name test files to match source:
foo.test.tsforfoo.ts - Mock Prisma client — don't hit a real database in unit/integration tests
Commit Message Convention
We follow Conventional Commits:
type(scope): description
[optional body]
Types: feat, fix, docs, style, refactor, test, chore, perf
Examples:
feat(appointments): add drag-and-drop rescheduling
fix(billing): correct GST calculation for exempt items
docs(readme): add deployment instructions
test(api): add integration tests for patient routes
Pull Request Guidelines
- Keep PRs focused — one feature or fix per PR
- Fill out the PR template completely
- Ensure CI passes (lint, type check, tests)
- Add screenshots for UI changes
- Update documentation if adding new features
- Request review from maintainers
Architecture Notes
- App Router: All pages use Next.js App Router (
app/directory) - Auth: NextAuth v5 with credentials provider, hospital-scoped sessions
- API Pattern: Route handlers in
app/api/, userequireAuthAndRole()for auth - Database: Prisma ORM with MySQL, all queries scoped by
hospitalId - AI Skills: Defined in
lib/ai/, use OpenRouter for model access - UI: shadcn/ui components in
components/ui/, Tailwind CSS for styling
Code of Conduct
Please read and follow our Code of Conduct.
Questions?
Open a Discussion for general questions.