First off, thank you for considering contributing to Alpha One Labs! It's people like you that make Alpha One Labs such a great tool for education.
This document provides guidelines and steps for contributing. Following these guidelines helps communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to info@alphaonelabs.com.
Before you begin:
- Ensure you have a GitHub account
- Read our README.md for project setup instructions
- Familiarize yourself with our tech stack:
- Python 3.10+
- Django 4.x
- Tailwind CSS
- Alpine.js
- Fork the repository on GitHub
- Clone your fork locally:
git clone git@github.com:your-username/education-website.git cd education-website - Create a branch for your changes:
git checkout -b feature/your-feature-name
- Set up pre-commit hooks:
pip install pre-commit pre-commit install
We follow these coding standards:
-
Python Code:
-
JavaScript Code:
- Follow Airbnb JavaScript Style Guide
- Use ESLint for linting
-
HTML/Templates:
- Use semantic HTML5 elements
- Follow BEM methodology for CSS classes
- Maintain consistent indentation (2 spaces)
-
CSS/Tailwind:
- Follow Tailwind CSS best practices
- Use utility classes over custom CSS when possible
- Maintain a consistent color scheme using theme colors
- Add docstrings to all Python functions, classes, and modules
- Update README.md if adding new features or changing existing ones
- Include comments for complex logic
- Document all API endpoints using docstrings
- Write tests for new features:
python manage.py test - Ensure all existing tests pass
- Add integration tests for new features
- Include test cases for edge cases and error conditions
We follow the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or modifying testschore: Maintenance tasks
Example:
feat(auth): add social authentication support
Add Google and GitHub OAuth support for user authentication.
Includes:
- OAuth2 integration
- User profile sync
- Test coverage
Closes #123
-
Update Documentation:
- Add/update docstrings
- Update README.md if needed
- Add comments for complex logic
-
Run Tests:
python manage.py test pre-commit run --all-files -
Create Pull Request:
- Use a clear, descriptive title
- Reference any related issues
- Describe your changes in detail
- Include screenshots for UI changes
- List any dependencies added/removed
-
Code Review:
- Address reviewer comments
- Make requested changes
- Keep the PR focused and small
-
Merge Requirements:
- All tests must pass
- Code review approval required
- No merge conflicts
- Documentation updated
- Pre-commit hooks pass
By contributing, you agree that your contributions will be licensed under the AGPLv3 License.
- Create an issue for bugs or feature requests
- Join our Slack community for:
- Real-time discussions with other contributors
- Direct access to core team members
- Community support and collaboration
- Announcements and updates
- Quick questions and answers
- Email us at info@alphaonelabs.com
Thank you for contributing to Alpha One Labs! 🎉
We use pre-commit hooks to ensure code quality and consistency. Our pre-commit configuration includes:
-
Code Formatting:
black: Python code formatterisort: Python import sorterprettier: JavaScript/HTML/CSS formatter
-
Linting:
flake8: Python lintereslint: JavaScript linterpylint: Python static code analyzer
-
Security:
bandit: Python security linterdetect-secrets: Prevents committing secrets and credentials
To manually run all pre-commit hooks:
pre-commit run --all-filesTo update hooks to their latest versions:
pre-commit autoupdateWe use Tailwind CSS for styling our application. Follow these guidelines:
-
Class Organization:
- Group related utilities (e.g., all spacing utilities together)
- Order utilities consistently: layout → typography → visual styles → interactivity
<!-- Good --> <div class="flex items-center space-x-4 text-lg font-bold text-blue-600 hover:text-blue-800"> <!-- Bad --> <div class="text-blue-600 flex space-x-4 hover:text-blue-800 items-center text-lg font-bold">
-
Responsive Design:
- Use mobile-first approach
- Apply responsive prefixes consistently
<div class="w-full md:w-1/2 lg:w-1/3">
-
Dark Mode:
- Always include dark mode variants
- Use semantic color naming
<div class="bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100">
-
Custom Components:
- Use @apply for repeated utility patterns
- Create component classes in
tailwind.config.jsfor common patterns
@layer components { .btn-primary { @apply bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg; } }
-
Theme Configuration:
- Use theme colors defined in
tailwind.config.js - Extend theme using semantic naming
// tailwind.config.js module.exports = { theme: { extend: { colors: { primary: colors.blue, secondary: colors.gray, accent: colors.teal, } } } }
- Use theme colors defined in
-
Performance:
- Use JIT (Just-In-Time) mode
- Purge unused styles in production
- Keep utility combinations reasonable
-
Accessibility:
- Include proper focus states
- Use sufficient color contrast
- Add hover/focus states for interactive elements
<button class="focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 focus:outline-none">