Getting Started
Prerequisites
Before contributing, make sure you have:- Completed the Local Setup guide
- Read the Project Structure documentation
- Familiarized yourself with the tech stack:
- Next.js 14 (App Router)
- TypeScript
- Drizzle ORM
- oRPC
- Tailwind CSS + shadcn/ui
Fork and Clone
- Fork the repository on GitHub
-
Clone your fork:
-
Add upstream remote:
Development Workflow
1. Create a Feature Branch
Always create a new branch for your changes:feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Adding or updating tests
2. Make Your Changes
- Write clean, readable code that follows the existing patterns
- Add comments for complex logic
- Update relevant documentation
- Test your changes thoroughly
3. Follow Code Standards
Budgetron uses automated tooling to maintain code quality:Linting
Run ESLint to check for issues:- ESLint with Next.js config
eslint-plugin-boundariesfor architectural boundaries@tanstack/eslint-plugin-queryfor React Query
Formatting
Format your code with Prettier:- Tailwind CSS plugin for class sorting
- Automatic formatting on save (if using recommended VS Code settings)
4. Pre-Commit Hooks
Budgetron uses Husky and lint-staged to automatically format code before commits:5. Commit Your Changes
Write clear, descriptive commit messages:feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
6. Keep Your Branch Updated
Regularly sync with the upstream repository:7. Push Your Changes
8. Open a Pull Request
- Go to the Budgetron repository
- Click New Pull Request
- Select your fork and branch
- Fill in the PR template with:
- Description of changes
- Related issue numbers
- Screenshots (for UI changes)
- Testing steps
Code Guidelines
Feature Development
When adding a new feature:-
Create a feature module in
src/features/[feature-name]/ -
Structure it following the pattern:
-
Add database tables in
src/server/db/schemas/ - Generate and apply migrations (see Database Migrations)
-
Export feature router from
src/server/api/router.ts
Component Guidelines
- Use shadcn/ui components when possible
- Keep components small and focused
- Use TypeScript for props
- Co-locate component-specific styles
API Development (oRPC)
Follow the oRPC pattern:-
Define validators in
validators.ts: -
Implement procedures in
rpc/procedures.ts: -
Export router in
rpc/router.ts:
Database Guidelines
- Define schemas in
src/server/db/schemas/ - Use Drizzle ORM helpers (
pgTable,serial,text, etc.) - Follow snake_case for column names (handled by
casing: 'snake_case') - Add indexes for frequently queried columns
- Use transactions for multi-step operations
Testing
Manual Testing
Before submitting a PR:- Test your changes in the browser
- Test on different screen sizes (mobile, tablet, desktop)
- Test edge cases and error states
- Verify database migrations work correctly
Automated Testing
While the project doesn’t currently have a comprehensive test suite, contributions that add tests are welcome:- Unit tests for utility functions
- Integration tests for API procedures
- E2E tests for critical user flows
Pull Request Process
PR Checklist
Before submitting, ensure:- Code follows project conventions
- All lint checks pass (
pnpm lint) - Code is formatted (
pnpm format) - Changes are tested locally
- Database migrations are included (if applicable)
- Documentation is updated (if applicable)
- Commit messages are clear and descriptive
Review Process
- Maintainers will review your PR
- Address feedback by pushing new commits
- Keep discussions productive and respectful
- Squash commits if requested before merging
After Your PR is Merged
- Delete your feature branch
-
Update your fork:
Getting Help
Questions?
- Check existing GitHub Issues
- Review the documentation
- Ask in PR comments or create a discussion
Found a Bug?
- Search existing issues
- Create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
- Environment details
Have a Feature Idea?
- Check if it’s already requested
- Open an issue to discuss the feature
- Wait for feedback before starting work
Code of Conduct
Be respectful and professional:- Use welcoming and inclusive language
- Respect differing viewpoints
- Accept constructive criticism gracefully
- Focus on what’s best for the project