Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jazbengu/ThreatDetect/llms.txt

Use this file to discover all available pages before exploring further.

ThreatDetect welcomes contributions that improve detection accuracy, extend the Streamlit interface, strengthen the test suite, or clarify documentation. Before you start, read through this page so your changes fit the existing code style and the review process goes smoothly. ThreatDetect is released under the Apache-2.0 license, so any code you contribute will be covered by the same terms.

Set up your environment

1

Fork and clone the repository

Fork ThreatDetect on GitHub, then clone your fork locally:
git clone https://github.com/<your-username>/ThreatDetect.git
cd ThreatDetect
2

Install dependencies

Install the runtime dependencies and the test tools in one go:
pip install -r requirements.txt
pip install pytest pytest-mock
3

Create a feature branch

Work on a dedicated branch rather than committing directly to main:
git checkout -b feature/your-feature-name
4

Make your changes

Edit the source files. Keep changes focused — one logical improvement per pull request makes review easier and keeps the git history readable.
5

Run the tests

Run the full test suite before pushing to make sure nothing is broken:
pytest "unit testing/"
All tests must pass. If you add a new feature, add corresponding tests in the unit testing/ directory.
6

Submit a pull request

Push your branch to your fork and open a pull request against the main branch of the upstream repository. Describe what changed and why in the PR description.
git push origin feature/your-feature-name

Guidelines

Follow these conventions to keep the codebase consistent:
  • Match the existing code style. ThreatDetect does not enforce a linter yet, so model your code on the patterns already in streamlit_app.py — clear variable names, inline comments for non-obvious logic, and pandas operations kept explicit rather than chained.
  • Add tests for new features. Every new function or behaviour should have at least one test in unit testing/. Use the shared fixtures from conftest.py (sample_raw_data, mock_model_package) wherever they apply so you avoid duplicating fixture code.
  • Keep changes focused. Avoid bundling unrelated refactors, formatting sweeps, or dependency upgrades into the same PR as a feature or bug fix.
  • Do not break the existing tests. If your change intentionally alters existing behaviour, update the affected tests and explain the reason in the PR description.

License

By contributing to ThreatDetect you agree that your contributions will be licensed under the Apache-2.0 license. The LICENSE file in the repository root covers all source files.
Use the Jupyter notebook included in the repository to experiment with model changes — try different XGBoost hyperparameters, engineer new ratio features, or evaluate alternative thresholds — before wiring anything into streamlit_app.py and the test suite.

Build docs developers (and LLMs) love