Thank you for your interest in contributing to AidLink! This document provides guidelines and instructions for contributing to the project.
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what is best for the community
- Show empathy towards other community members
- Node.js 20 or higher
- npm or yarn
- Git
- A GitHub account
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/aidlink-frontend.git
cd aidlink-frontend- Install dependencies:
npm install- Create a branch for your feature:
git checkout -b feature/your-feature-name- Make your changes and commit:
git add .
git commit -m "feat: add your feature description"- Push to your fork:
git push origin feature/your-feature-name- Create a pull request
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Test additions or changeschore/- Maintenance tasks
Follow the Conventional Commits specification:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Example:
feat: add campaign creation form
fix: resolve wallet connection issue on mobile
docs: update API documentation
- Use TypeScript for type safety
- Follow the existing code style
- Use Prettier for formatting
- Run ESLint before committing
- Write meaningful variable and function names
- Write unit tests for new features
- Write integration tests for API routes
- Write E2E tests for critical user flows
- Ensure all tests pass before submitting PR
- Update documentation if needed
- Ensure all tests pass
- Update the CHANGELOG.md
- Submit a pull request with:
- Clear description of changes
- Related issue numbers
- Screenshots for UI changes
- Testing instructions
src/
├── app/ # Next.js app router pages
├── components/ # React components
│ ├── features/ # Feature-specific components
│ ├── layout/ # Layout components
│ └── ui/ # shadcn/ui components
├── hooks/ # Custom React hooks
├── lib/ # Utility libraries
├── store/ # Zustand stores
├── types/ # TypeScript types
├── config/ # Configuration files
└── utils/ # Utility functions
- Place components in appropriate directories
- Use TypeScript for type safety
- Add JSDoc comments for complex functions
- Make components reusable and composable
- Use props interfaces for type definitions
Example:
interface ButtonProps {
variant: 'primary' | 'secondary'
size: 'sm' | 'md' | 'lg'
children: React.ReactNode
onClick?: () => void
}
export function Button({ variant, size, children, onClick }: ButtonProps) {
// Component implementation
}- Use TailwindCSS for styling
- Follow the design system
- Use shadcn/ui components when possible
- Keep styles responsive
- Place routes in
src/app/api/ - Use TypeScript for request/response types
- Add error handling
- Validate input data
- Return appropriate HTTP status codes
Example:
import { NextRequest, NextResponse } from 'next/server'
export async function POST(request: NextRequest) {
try {
const body = await request.json()
// Process request
return NextResponse.json({ success: true }, { status: 200 })
} catch (error) {
return NextResponse.json(
{ error: 'Internal server error' },
{ status: 500 }
)
}
}- Use the Soroban SDK from
src/lib/soroban/sdk.ts - Handle transaction errors gracefully
- Provide loading states for blockchain operations
- Verify transactions before submission
Example:
import { sorobanSDK } from '@/lib/soroban/sdk'
async function donateToCampaign(contractId: string, amount: number) {
try {
const result = await sorobanSDK.invokeContract(
contractId,
'donate',
[amount]
)
return result
} catch (error) {
console.error('Donation failed:', error)
throw error
}
}- Keep README.md up to date
- Document new features in appropriate docs
- Add code comments for complex logic
- Update API documentation for API changes
When reporting issues, include:
- Clear description of the problem
- Steps to reproduce
- Expected behavior
- Actual behavior
- Screenshots if applicable
- Environment details (OS, browser, Node version)
- Check existing documentation first
- Search for similar issues
- Ask questions in GitHub Discussions
- Be patient and respectful
Contributors will be recognized in:
- README.md contributors section
- Release notes
- Project website (if applicable)
Thank you for contributing to AidLink!