Thank you for your interest in contributing to the Requests & Offers project! This guide will help you get started with contributing to our codebase.
Please read and follow our Code of Conduct to maintain a welcoming and inclusive environment for all contributors.
- Fork the repository
- Clone your fork
- Set up the development environment following our Installation Guide
main
: Production-ready codedevelop
: Main development branch- Feature branches:
feature/your-feature-name
- Bug fix branches:
fix/bug-description
Follow the Conventional Commits specification:
type(scope): description
[optional body]
[optional footer]
Types:
feat
: New featurefix
: Bug fixdocs
: Documentation changesstyle
: Code style changesrefactor
: Code refactoringtest
: Adding or modifying testschore
: Maintenance tasks
Scopes:
ui
: Frontend changesusers
: Users Organizations zomeadmin
: Administration zomedocs
: Documentation updatestest
: Test infrastructurebuild
: Build system changes
- Create a new branch for your changes
- Make your changes
- Write or update tests
- Update documentation
- Submit a pull request to the
develop
branch
- Follow Rust style guidelines for zomes
- Use SvelteKit best practices for frontend
- Maintain consistent code formatting
- Write unit tests for zome functions
- Include integration tests for complex features
- Test frontend components
- Verify documentation accuracy
- Update relevant documentation
- Include code examples
- Maintain cross-references
- Follow documentation structure
We follow a systematic approach to feature development that ensures proper testing and integration at each level.
-
Zome Planning
- Define entry types and validation rules
- Plan link types and their relationships
- Document expected behaviors
-
Zome Implementation
// Example: New entry type in integrity zome #[hdk_entry_helper] pub struct NewFeature { pub field1: String, pub field2: Vec<String>, } // Coordinator zome function #[hdk_extern] pub fn create_new_feature(input: NewFeature) -> ExternResult<Record> { // Implementation }
-
DNA Testing with Tryorama
// tests/src/requests_and_offers/new_feature.test.ts test("should create new feature", async () => { const client = await player1.client(); const result = await createNewFeature(client, { field1: "test", field2: ["value1", "value2"], }); t.ok(result); });
-
Holochain Service
// ui/src/services/zomes/new-feature.service.ts export class NewFeatureService { constructor(private client: AppAgentClient) {} async createNewFeature(input: NewFeature): Promise<Record> { return await this.client.callZome({ zome_name: "new_feature", fn_name: "create_new_feature", payload: input, }); } }
-
Store Implementation
// ui/src/stores/new-feature.store.ts export const newFeatureStore = writable<NewFeature[]>([]); export const createNewFeature = async (input: NewFeature) => { const result = await service.createNewFeature(input); newFeatureStore.update((features) => [...features, result]); return result; };
-
Components
<!-- ui/src/lib/components/NewFeature.svelte --> <script lang="ts"> import { newFeatureStore, createNewFeature } from '@stores/new-feature.store'; async function handleSubmit(event) { const result = await createNewFeature({ field1: event.detail.value, field2: event.detail.options, }); } </script>
-
Pages
<!-- ui/src/routes/new-feature/+page.svelte --> <script lang="ts"> import NewFeature from '@components/NewFeature.svelte'; </script> <NewFeature />
-
DNA First
- Implement and test entry types
- Create and verify zome functions
- Write comprehensive Tryorama tests
-
Services and Stores (Parallel)
- Create Holochain service methods
- Implement store with state management
- Add store actions and subscriptions
-
UI Components
- Develop reusable components
- Create feature pages
- Implement user interactions
-
DNA Testing
# Test specific feature pnpm test:new-feature # Run all tests pnpm test
-
UI Testing
# Component tests pnpm test:ui # E2E tests (if applicable) pnpm test:e2e
-
Manual Testing
- Start development environment
- Test with multiple agents
- Verify all user flows
-
DNA Documentation
- Update zome documentation
- Document entry and link types
- Add usage examples
-
Frontend Documentation
- Document services and stores
- Add component documentation
- Update user guides
-
Testing Documentation
- Document test scenarios
- Add test data examples
- Update test instructions
- SvelteKit application
- Component documentation
- UI/UX guidelines
- Users Organizations Zome
- User management
- Organization handling
- Administration Zome
- System administration
- Status management
- Technical specifications
- User guides
- API documentation
- Development guides
- Join our Community
- Ask questions on Discord
- Check GitHub Issues
- Review Technical Documentation