Getting started
Before contributing, make sure you have:- Completed the development environment setup
- Familiarized yourself with the project structure
- Read through these contribution guidelines
Development workflow
Create a feature branch
Create a new branch for your feature or bug fix:Use descriptive branch names:
feature/add-pull-requestsfor new featuresfix/authentication-bugfor bug fixesdocs/update-setup-guidefor documentation
Run the linter
After making code changes, always run the linter with auto-fix:This ensures code quality and adherence to the project’s style guidelines.
Commit your changes
Commit your changes with a descriptive message:Write clear, concise commit messages that describe what changed and why.
Code style guidelines
Gitflare uses Biome for linting and formatting via the Ultracite preset. Follow these guidelines:TypeScript
- Use strict mode: Enable strict TypeScript checking
- Explicit types: Provide explicit types for function parameters and return values
- Prefer
unknownoverany: Useunknownwhen the type is truly unknown - Use const assertions: Apply
as constfor literal types
JavaScript/TypeScript conventions
- Quotes: Use double quotes for strings
- Variables: Use
constby default,letonly when reassignment is needed - Functions: Prefer arrow functions for callbacks and non-method functions
- Optional chaining: Use
?.for safe property access - Nullish coalescing: Use
??instead of||for default values - Destructuring: Use object and array destructuring where appropriate
- No magic numbers: Extract numeric constants with descriptive names
React conventions
- Function components: Always use function components, not class components
- Hooks: Place hooks at the top level with correct dependencies
- Semantic HTML: Use semantic HTML elements with ARIA attributes
- Accessibility: Ensure components are accessible
Imports
- Prefer specific imports: Import only what you need
- Avoid barrel files: Don’t use index.ts re-exports (barrel files)
Error handling
- Throw Error objects: Always throw
Errorobjects with descriptive messages - Early returns: Prefer early returns over nested conditionals
- Remove debug code: Remove
console.loganddebuggerstatements from production code
Available commands
Root level
pnpm dev- Start all applications in development mode (Turborepo)pnpm build- Build all applicationspnpm test- Run tests across all workspacespnpm typecheck- Run TypeScript type checkingpnpm check- Check for linting and formatting issuespnpm check:fix- Check and auto-fix linting and formatting issues
Web app (apps/web)
pnpm dev- Start the web development server (Alchemy)pnpm build- Build the web application for productionpnpm serve- Preview production build locallypnpm deploy- Deploy to Cloudflare Workerspnpm typecheck- Run TypeScript type checkingpnpm cf-typegen- Generate TypeScript types for Cloudflare Workerspnpm db:generate- Generate Drizzle migrations from schema changespnpm db:migrate:local- Apply migrations to local D1 databasepnpm db:migrate:remote- Apply migrations to production D1 database
Important notes
- Always run the linter: Run
pnpm check:fixafter making code changes to ensure code quality - Fetch latest docs: When working with external libraries, always fetch the latest documentation:
- For shadcn/ui components, refer to https://ui.shadcn.com/
- For other libraries, consult their official documentation
- No test suite yet: Gitflare currently does not have a comprehensive test suite configured
- Use pnpm: This project uses pnpm as the package manager, not npm or yarn
Pull request guidelines
- Provide a clear description of the changes and their purpose
- Reference any related issues using GitHub keywords (e.g., “Fixes #123”)
- Ensure all checks pass (linting, type checking)
- Keep pull requests focused on a single feature or fix
- Respond to review feedback promptly
Documentation
When adding new features:- Update relevant documentation pages
- Add code comments for complex logic
- Update the README if user-facing functionality changes
- Document any new environment variables or configuration options
Getting help
If you need assistance:- Open an issue on GitHub for bugs or feature requests
- Check the TanStack documentation for framework-specific questions
- Refer to the Cloudflare documentation for Workers and Durable Objects