Thank you for your interest in contributing to the Stellar Analytics Dashboard! This document provides guidelines and information for contributors.
- Node.js 18+
- Docker & Docker Compose
- pnpm (recommended) or npm
- Git
-
Fork and clone the repository
git clone https://github.com/your-username/stellar-analytics-dashboard.git cd stellar-analytics-dashboard -
Install dependencies
npm install -g pnpm pnpm install
-
Set up development environment
# Start databases docker-compose -f docker-compose.dev.yml up -d # Start development servers pnpm dev
stellar-analytics-dashboard/
βββ packages/
β βββ shared/ # Shared types and utilities
β β βββ src/
β β β βββ types/ # TypeScript type definitions
β β β βββ utils/ # Utility functions
β β β βββ constants/ # Application constants
β β βββ package.json
β βββ indexer/ # Data ingestion service
β β βββ src/
β β β βββ database/ # Database connection and migrations
β β β βββ services/ # Stellar API integration
β β β βββ utils/ # Helper functions
β β βββ package.json
β βββ api/ # GraphQL API server
β β βββ src/
β β β βββ schema/ # GraphQL schema definitions
β β β βββ resolvers/ # GraphQL resolvers
β β β βββ loaders/ # DataLoader implementations
β β β βββ database/ # Database connection
β β βββ package.json
β βββ frontend/ # React dashboard
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks
β β βββ graphql/ # GraphQL queries and client
β β βββ utils/ # Utility functions
β β βββ types/ # TypeScript types
β βββ package.json
βββ docker-compose.yml
βββ docker-compose.dev.yml
βββ README.md
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
# Run all tests
pnpm test
# Run tests for specific package
pnpm --filter @stellar-analytics/api test
# Run with coverage
pnpm test --coverage# Lint all packages
pnpm lint
# Fix linting issues
pnpm lint:fix
# Format code
pnpm formatUse conventional commit messages:
feat: add new feature
fix: resolve bug in transaction processing
docs: update API documentation
style: format code with prettier
refactor: improve database query performance
test: add unit tests for account service
chore: update dependencies
git push origin feature/your-feature-nameOpen a Pull Request with a clear description of your changes.
- Use strict TypeScript configuration
- Provide explicit types for all functions
- Prefer interfaces over types for object shapes
- Use proper generic types
- Follow ESLint configuration
- Use Prettier for formatting
- Keep functions small and focused
- Use descriptive variable and function names
- Write unit tests for all new functions
- Test edge cases and error conditions
- Use meaningful test descriptions
- Mock external dependencies
- Update README for user-facing changes
- Add JSDoc comments for complex functions
- Document GraphQL schema changes
- Include examples in API documentation
// Example test
import { describe, it, expect } from '@jest/globals'
import { formatAsset } from '../utils/stellar'
describe('formatAsset', () => {
it('should format native asset correctly', () => {
const asset = { asset_type: 'native' }
expect(formatAsset(asset)).toBe('XLM')
})
it('should format credit asset correctly', () => {
const asset = {
asset_type: 'credit_alphanum4',
asset_code: 'USD',
asset_issuer: 'GB...'
}
expect(formatAsset(asset)).toBe('USD:GB...')
})
})- Test database interactions
- Test API endpoints
- Test real-time subscriptions
- Use test database fixtures
- Test user workflows
- Test real-time updates
- Use Playwright or Cypress
# Add to specific package
pnpm --filter @stellar-analytics/api add graphql
# Add to all packages
pnpm add -w typescript
# Add dev dependency
pnpm --filter @stellar-analytics/frontend add -D @types/react# Build all packages
pnpm build
# Build specific package
pnpm --filter @stellar-analytics/shared build- Create a new migration:
pnpm db:migrate:create describe_your_change
- Implement
exports.upandexports.downinpackages/indexer/migrations/ - Update
packages/indexer/src/database/schema.sqlas a reference snapshot (optional) - Update TypeScript types in shared package when needed
- Test migrate up/down locally before opening a PR
See docs/database-migrations.md for rollback, CI, and production guidance.
# Reset database
docker-compose -f docker-compose.dev.yml down -v
docker-compose -f docker-compose.dev.yml up -d
# Run migrations
pnpm db:migrate
pnpm db:migrate:down
pnpm db:migrate- Deploy to staging environment for testing
- Run integration tests against staging
- Verify performance and functionality
- Create release branch
- Update version numbers
- Deploy with Docker Compose
- Monitor for issues
- Update GraphQL schema documentation
- Add examples for new queries
- Document new resolvers
- Update README for new features
- Add troubleshooting guides
- Update configuration examples
- Be respectful and inclusive
- Provide constructive feedback
- Help others learn and grow
- Ask questions in GitHub Discussions
- Join our Discord community
- Check existing issues before creating new ones
Contributors will be recognized in:
- README contributors section
- Release notes
- Community highlights
Before submitting a PR, ensure:
- Code follows project style guidelines
- All tests pass
- New functionality is tested
- Documentation is updated
- Commit messages are conventional
- No sensitive data is committed
- PR description is clear and detailed
When reporting bugs, include:
- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment details
- Error messages and logs
When requesting features:
- Describe the use case
- Explain why it's valuable
- Consider implementation complexity
- Provide examples if possible
Thank you for contributing to Stellar Analytics Dashboard! π