Thanks for helping improve OpenPasture! See docs/vision.md for the product thesis before diving in.
- First-Time Contributors
- Development Setup
- Development Workflow
- Running Tests
- Code Style
- Git Workflow
- Pull Requests
- Code Review Process
- Issues
- Code of Conduct
Welcome! Here's how to get started:
- Fork the repository - Click the "Fork" button on GitHub
- Clone your fork -
git clone https://github.com/YOUR_USERNAME/pan.git - Set up the development environment - Follow the steps below
- Find an issue - Look for issues labeled
good first issueorhelp wanted - Ask questions - Open a discussion if you need clarification
- Node.js 18+ and pnpm
- A Convex account (free tier available)
- A Clerk account (free tier available) - or use dev auth mode
cd app
pnpm installCopy the app example environment file:
cp app/.env.example app/.env.localEdit app/.env.local with your values:
# Convex - Get from your Convex dashboard
VITE_CONVEX_URL=https://your-project.convex.cloud
# Clerk Authentication (choose one option)
# Option A: Use Clerk (production-like)
VITE_CLERK_PUBLISHABLE_KEY=pk_test_your_key_here
# Option B: Skip Clerk for local development
VITE_DEV_AUTH=trueIf you work on the ingestion layer (the satellite pipeline lives in ingestion/satellite/), also copy:
cp ingestion/satellite/.env.example ingestion/satellite/.env.localFor the complete env matrix (including Convex Dashboard server-side vars like AI_GATEWAY_API_KEY), see docs/environment.md.
If you haven't already, create a Convex project:
npx convex devThis will:
- Prompt you to log in or create a Convex account
- Create a new project (or link to existing)
- Start the Convex dev server
For full authentication:
- Create a Clerk application at clerk.dev
- Copy your publishable key to
.env.local - Configure your Clerk application settings
Alternatively, set VITE_DEV_AUTH=true to bypass authentication during development.
In separate terminals:
# Terminal 1: Start Convex backend
npx convex dev
# Terminal 2: Start Vite dev server
pnpm run devThe app will be available at http://localhost:5173
- Create a branch from
devfor your work - Make small, focused changes - One feature or fix per PR
- Run checks before committing:
pnpm run lint # Check for linting errors pnpm run test # Run unit tests npx tsc -b # TypeScript compilation check
- Include tests for new functionality when possible
- Update documentation if behavior changes
# Run all tests once
pnpm run test
# Run tests in watch mode during development
pnpm run test:watchTests are located alongside source files with .test.ts or .test.tsx extensions.
- Use Vitest for unit tests
- Place test files next to the code they test
- Focus on testing pure functions and business logic
- See
src/lib/*.test.tsfor examples
We use ESLint and Prettier for code consistency.
# Check for linting issues
pnpm run lint
# Check formatting
pnpm run format:check
# Auto-fix formatting
pnpm run format- Use TypeScript strict mode
- Prefer functional components with hooks
- Keep components small and focused
- Use meaningful variable and function names
- Add comments only when the code isn't self-explanatory
main- Production-ready codedev- Integration branch for ongoing development- Feature branches - Created from
dev, merged back via PR
Use descriptive branch names:
feat/add-pasture-editing- New featuresfix/map-zoom-issue- Bug fixesdocs/update-setup-guide- Documentationrefactor/simplify-auth-flow- Code improvements
Write clear, concise commit messages:
feat: add pasture boundary editing
- Add drag handles for boundary vertices
- Implement save confirmation dialog
- Update map component to handle edit mode
Format:
- Start with type:
feat,fix,docs,refactor,test,chore - Use imperative mood ("add" not "added")
- Keep first line under 72 characters
- Add details in body when needed
- Ensure all checks pass locally:
pnpm run lint && pnpm run test && npx tsc -b
- Rebase your branch on latest
dev - Write a clear PR description
## Summary
Brief description of what this PR does.
## Changes
- Bullet points of specific changes
- Be specific about what files/components changed
## Test Plan
- How you tested these changes
- Include screenshots for UI changes
## Related Issues
Closes #123- Keep PRs small and focused (under 400 lines when possible)
- Include screenshots or videos for UI changes
- Respond to review feedback promptly
- Squash commits if requested
All PRs require at least one approval before merging.
- Be responsive to feedback
- Explain your decisions when asked
- Make requested changes or discuss alternatives
- Review within 1-2 business days when possible
- Be constructive and specific in feedback
- Approve when ready, request changes when needed
- Focus on correctness, maintainability, and clarity
- Code correctness and edge cases
- TypeScript types are accurate
- No unnecessary complexity
- Tests for new functionality
- Documentation updates if needed
Use the bug report template and include:
- Steps to reproduce
- Expected vs actual behavior
- Browser/OS information
- Screenshots if applicable
Use the feature request template and include:
- Clear description of the feature
- Use case and motivation
- Potential implementation approach (optional)
bug- Something isn't workingenhancement- New feature requestgood first issue- Good for newcomershelp wanted- Extra attention neededdocumentation- Documentation improvements
By participating, you agree to follow the Code of Conduct. We are committed to providing a welcoming and inclusive environment for all contributors.
Questions? Open a discussion or reach out to the maintainers. Thanks for contributing!