Development Guide
This guide will help you set up your development environment for contributing to the Quran Knowledge Graph project. Whether you’re interested in improving the core functionality, adding new features, or fixing bugs, this guide will get you started.Development Environment Setup
1. Fork and Clone the Repository
First, fork the repository on GitHub, then clone your fork:2. Set Up a Virtual Environment
It’s recommended to use a virtual environment for development:3. Install Development Dependencies
Install all dependencies, including development tools:4. Set Up Pre-commit Hooks
We use pre-commit hooks to ensure code quality:Project Structure
Understanding the project structure will help you navigate and contribute effectively:Development Workflow
1. Create a New Branch
Always create a new branch for your changes:2. Make Your Changes
Implement your changes, following these guidelines:- Follow the existing code style
- Write tests for new functionality
- Update documentation as needed
- Keep commits focused and atomic
3. Run Tests
Make sure all tests pass before submitting your changes:4. Submit a Pull Request
Once your changes are ready:- Push your branch to your fork
- Create a pull request from your fork to the main repository
- Describe your changes in detail
- Reference any related issues
Development Guidelines
Code Style
We follow PEP 8 for Python code style. Use tools likeblack and flake8 to ensure your code meets these standards:
Documentation
All new features should be documented:- Add docstrings to functions and classes
- Update the relevant documentation files in the
docs/directory - Include examples where appropriate
Testing
We use pytest for testing:- Write unit tests for new functionality
- Ensure all tests pass before submitting a pull request
- Aim for good test coverage
Working with the Database
Local Development Database
For development, you can create a smaller test database:Schema Changes
If you need to make changes to the database schema:- Update the schema definition in
quran_graph/db/schema.py - Create a migration script in
quran_graph/scripts/migrations/ - Test the migration thoroughly
- Document the changes
Documentation Development
We use Mintlify for our documentation. To preview documentation changes locally:-
Install the Mintlify CLI:
-
Run the documentation locally:
-
View the documentation at
http://localhost:3000
Getting Help
If you need help with development:- Check the existing documentation
- Look at the issue tracker for similar issues
- Join our community discussions
- Reach out to the maintainers