Thank you for your interest in contributing to DataSpace Backend! We welcome contributions from the community and are pleased to have you join us.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check the existing issues to avoid duplicates. When you are creating a bug report, please include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed and what behavior you expected
- Include screenshots if applicable
- Include your environment details (OS, Python version, etc.)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful
- List some other applications where this enhancement exists, if applicable
- Fork the repository
- Create a feature branch from
main:git checkout -b feature/amazing-feature - Make your changes
- Add tests for your changes
- Ensure all tests pass:
python manage.py test - Run code quality checks:
black .,isort .,flake8 - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Python 3.8+
- PostgreSQL
- Redis
- Elasticsearch
- Keycloak server
-
Clone the repository:
git clone https://github.com/CivicDataLab/DataSpaceBackend.git cd DataSpaceBackend -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Run migrations:
python manage.py migrate python manage.py init_roles
-
Start the development server:
python manage.py runserver
# Run all tests
python manage.py test
# Run specific test file
python manage.py test tests.test_specific_module
# Run with coverage
coverage run --source='.' manage.py test
coverage reportWe use several tools to maintain code quality:
- Black: Code formatting
- isort: Import sorting
- flake8: Linting
- mypy: Type checking
Run these before committing:
black .
isort .
flake8
mypy .We use pre-commit hooks to ensure code quality. Install them:
pre-commit installapi/: Main API application with models, views, and GraphQL schemaauthorization/: Authentication and authorization componentsDataSpace/: Project settings and configurationsearch/: Search functionality and Elasticsearch integrationdocs/: Documentation filestests/: Test files
- GraphQL Playground:
/graphql/ - Swagger UI:
/swagger/ - ReDoc:
/redoc/
When making model changes:
- Create migrations:
python manage.py makemigrations - Apply migrations:
python manage.py migrate - Include migration files in your PR
If you discover a security vulnerability, please email tech@civicdatalab.in instead of opening a public issue.
Feel free to open an issue for questions or join our GitHub Discussions.
By contributing, you agree that your contributions will be licensed under the MIT License.