Thanks for your interest in contributing to AiFw! This guide covers how to get started.
- Rust (latest stable via rustup)
- Node.js 24+ and npm (for the web UI)
- FreeBSD 15 (for production testing) or Linux/WSL (for development with mock pf backend)
# Rust crates (all 12)
cargo build
cargo check # quick type check
cargo test # run test suite
# Web UI
cd aifw-ui
npm ci
npm run buildAiFw uses a mock pf backend on Linux/WSL so you can develop without FreeBSD:
cargo check # type-checks all crates
cargo test # runs all 273+ testsThe API server can be started locally for UI development:
cargo run --bin aifw-api -- --no-tls --db /tmp/aifw-dev.dbOpen an issue using the bug report template. Include:
- AiFw version
- FreeBSD version
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs
Open an issue using the feature request template.
- Fork the repository
- Create a feature branch from
main - Make your changes
- Run
cargo check(zero warnings required) - Run
cargo test - If you changed the UI:
cd aifw-ui && npm run build - Submit a pull request
- Keep PRs focused on a single change
- Include a clear description of what and why
- Update the README if your change affects user-facing behavior
- All CI checks must pass
- Rust:
cargo checkmust pass with zero warnings. No#[allow]to suppress real issues. Remove unused code rather than commenting it out. - UI: ESLint must pass. No
eslint-disableto hide real issues. - No paid crates: All dependencies must be free/open-source.
- Tests: Add tests for new functionality. Don't break existing tests.
aifw-common/ Shared types (rules, NAT, VPN, geo-IP, HA)
aifw-pf/ pf backend (FreeBSD ioctl + Linux mock)
aifw-core/ Engines: rules, NAT, VPN, TLS, geo-IP, audit, DB
aifw-conntrack/ Connection tracking
aifw-plugins/ Plugin framework
aifw-ai/ ML threat detection
aifw-metrics/ RRD ring buffer metrics
aifw-api/ Axum REST API (JWT auth, serves static UI)
aifw-tui/ Terminal UI
aifw-daemon/ Main firewall daemon
aifw-cli/ CLI tool
aifw-setup/ Interactive setup wizard
aifw-ui/ Next.js web UI (static export)
freebsd/ ISO/IMG build scripts and overlay files
By contributing, you agree that your contributions will be licensed under the MIT License.