Thank you for your interest in contributing to Sport Scribe! This document provides guidelines and information for contributors.
Before contributing, ensure you have:
- Node.js 18+ and npm
- Python 3.11+ and pip
- Git
- A Supabase account
- An OpenAI API key
CRITICAL: Python Virtual Environment Setup
cd ai-backend
python3.11 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -r requirements-dev.txtVerify Setup:
# Test Python environment
python --version # Should show 3.11+
ruff check . # Should run without errors
ruff format . # Should format code
# Test Node environment
cd ../web
node --version # Should show 18+
npm install # Install dependencies
npm run build # Should build successfully-
Fork and clone the repository
git clone https://github.com/your-username/sport-scribe.git cd sport-scribe -
Set up the development environment
./scripts/setup-dev.sh
-
Configure environment variables
cp env.example .env cp web/env.local.example web/.env.local cp ai-backend/env.example ai-backend/.env # Edit the files with your actual API keys -
Install dependencies and start development servers
# Install dependencies cd web && npm install && cd .. cd ai-backend && pip install -r requirements.txt && cd .. # Start development servers docker-compose -f docker-compose.dev.yml up
Before creating an issue, please:
- Search existing issues to avoid duplicates
- Use the issue templates provided
- Provide detailed information including:
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Node.js version, etc.)
- Screenshots or logs if applicable
For feature requests:
- Check the roadmap in the README
- Open a discussion first for major features
- Use the feature request template
- Explain the use case and expected benefit
- Look for issues labeled
good first issuefor beginners - Check issues labeled
help wantedfor areas needing attention - Comment on the issue to indicate you're working on it
git checkout -b feature/issue-number-short-description
# or
git checkout -b fix/issue-number-short-description- Follow the coding standards
- Write tests for new functionality
- Update documentation as needed
- Keep commits focused and atomic
# Testing framework currently in development
# For now, run linting and type checking:
npm run lint # Frontend linting
cd ai-backend && source venv/bin/activate && ruff check . # Backend lintingUse conventional commit messages:
git commit -m "feat: add game recap generation"
git commit -m "fix: resolve database connection timeout"
git commit -m "docs: update API documentation"
git commit -m "test: add unit tests for writer agent"Commit types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
git push origin your-branch-nameThen create a pull request using the provided template.
Understanding the codebase structure will help you contribute effectively:
sport-scribe/
├── ai-backend/ # Python AI system
│ ├── agents/ # AI agent implementations
│ ├── tools/ # Sports APIs and utilities
│ ├── config/ # Configuration files
│ └── tests/ # Backend tests
├── web/ # Next.js frontend
│ ├── app/ # App router pages
│ ├── components/ # React components
│ ├── lib/ # Utilities and integrations
│ └── hooks/ # Custom React hooks
├── shared/ # Shared types and schemas
│ ├── types/ # TypeScript interfaces
│ ├── schemas/ # Database and API schemas
│ └── constants/ # Shared constants
└── docs/ # Documentation
- Write clean, readable code with meaningful names
- Follow DRY principles (Don't Repeat Yourself)
- Add comments for complex logic
- Write tests for new functionality
- Update documentation when needed
Formatter: Ruff Linter: Ruff
We use Ruff for both linting and formatting with these settings:
- Line length: 100 characters (configured in ruff.toml)
- Import sorting included
- Fast performance with same rules as Black + flake8
Running Tools:
ruff format . # Format code
ruff check . # Lint code
ruff check --fix . # Fix auto-fixable issues// Use TypeScript interfaces
interface ArticleProps {
article: Article;
onEdit: (id: string) => void;
}
// Use functional components with hooks
export function ArticleCard({ article, onEdit }: ArticleProps) {
const [isLoading, setIsLoading] = useState(false);
return (
<div className="article-card">
{/* Component content */}
</div>
);
}Frontend Guidelines:
- Use TypeScript for all new code
- Follow React hooks patterns
- Use HeroUI components when possible
- Follow Tailwind CSS utility-first approach
- Use meaningful component and variable names
TypeScript Tools:
Formatter: ESLint (with formatting rules) Linter: ESLint
We use ESLint for both linting and formatting (Prettier not separately configured)
Running Tools:
npm run lint # Lint and format
npm run lint:fix # Fix auto-fixable issues- Use descriptive table and column names
- Add proper indexes for performance
- Include comments for complex queries
- Use migrations for schema changes
-
Python Backend Setup:
cd ai-backend python3.11 -m venv venv source venv/bin/activate pip install -r requirements.txt pip install -r requirements-dev.txt
-
Frontend Setup:
cd web npm install npm run dev -
Database Setup:
# Requires Supabase CLI supabase start supabase db reset
We use Ruff for Python code formatting and linting:
# Python (AI Backend)
cd ai-backend
ruff format . # Code formatting
ruff check . # LintingSet up pre-commit hooks to automatically run quality checks:
pre-commit installTesting framework currently in development. For now, focus on:
- Code quality through linting
- Type checking with TypeScript/mypy
- Manual testing of features
- Integration testing with actual API calls
When contributing, please:
- Update relevant documentation
- Add docstrings to new functions
- Update API documentation for new endpoints
- Include examples in code comments
-
Pull Request Requirements:
- Clear description of changes
- Link to related issues
- Tests passing (when available)
- Code review approval
-
Review Criteria:
- Code quality and standards
- Documentation completeness
- Performance impact
- Security considerations
- Check existing documentation
- Look at similar implementations
- Ask questions in issues or discussions
- Reach out to maintainers
Contributors will be recognized in:
- README acknowledgments
- Release notes
- Hall of fame (coming soon)
Thank you for contributing to Sport Scribe! 🏆