This is a web application used in disaster response for tracking people, resources, and needs. It is designed to run completely disconnected from the internet on a laptop or a device like a Raspberry Pi.
Basic public pages are managed by Wagtail, a Django-based CMS. The system supports multi-organization incident management with role-based access control and inter-organization support request workflows.
- Multi-Organization Support: Users can be members of multiple organizations and switch contexts
- Incident Management: Create, manage, and track disaster incidents with status tracking
- Support Request Workflow: Organizations can request support from other organizations
- Check-in/Check-out System: Track personnel for insurance and safety purposes
- Geographic Support: Built-in geographic data handling with GeoDjango
- Offline Capability: Designed to work without internet connectivity
- Database: PostgreSQL with PostGIS extension
- Backend: Python with Django framework
- Geographic Features: GeoDjango
- Package Management: uv
- Frontend: Bootstrap 5 with Bootstrap Icons
- CMS: Wagtail for public pages
- Python 3.12+
- PostgreSQL with PostGIS extension
- uv package manager
-
Clone the repository:
git clone <repository-url> cd neteoc-py
-
Install dependencies:
uv sync
-
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Run database migrations:
uv run python manage.py migrate
-
Create a superuser:
uv run python manage.py createsuperuser
-
Start the development server:
uv run python manage.py runserver 127.0.0.1:8000
This project includes a justfile for task automation:
# View available commands
just
# Run the development server
just run
# Run tests
just test
# Lint and format code
just lintThe project includes comprehensive unit tests for all core functionality:
# Run all tests
uv run python manage.py test
# Run tests with verbose output
uv run python manage.py test --verbosity=2
# Run only operations app tests
uv run python manage.py test operations
# Run specific test class
uv run python manage.py test operations.test_models.AssetModelTest
# Run local test suite (includes linting, security scans)
./scripts/run-tests.shTests automatically run on every push and pull request via GitHub Actions:
- Unit Tests: Run on Python 3.11 and 3.12 with SQLite and PostgreSQL
- Code Quality: Linting with ruff, format checking
- Security Scans: Bandit for security vulnerabilities, Safety for dependency checks
- Coverage Reports: Automatically generated and uploaded to Codecov
Tests are organized in the operations/ app:
operations/test_models.py- Model functionality tests (376 lines)operations/test_forms_views.py- Form validation and view tests (140 lines)operations/tests.py- Test discovery module (39 lines)
The project follows Django coding standards and uses Ruff for linting and formatting:
# Check code style
uv run ruff check
# Format code
uv run ruff format
# Run pre-commit hooks
pre-commit run --all-filesComprehensive documentation is available in the docs directory:
- Documentation Index - Complete table of contents
- Django Organizations Cookbook - Multi-organization implementation guide
- Incident Creation System - Incident management documentation
- Organization Switching - Context switching functionality
- Support Request Workflow - Inter-organization support requests
The application is packaged as a Docker container and can be deployed on Kubernetes clusters.
For production deployments, use the production environment configuration:
-
Create production environment file:
cp .env.production .env.production.local # Edit .env.production.local with your actual production values -
Run deployment checks:
# Using the helper script (recommended) ./scripts/check-production-deploy.sh # Or manually with your production .env file cp .env.production.local .env uv run python manage.py check --deploy rm .env # Clean up
-
Important Security Notes:
- Never commit
.env.production.localor any file containing real secrets - The
.env.productionfile is a template - replace all placeholder values - Production environment files are automatically excluded from Git and Docker builds
- Never commit
See the deployment documentation for detailed instructions.
- Follow the coding standards outlined in the project guidelines
- Write tests for new functionality
- Update documentation as needed
- Ensure all pre-commit hooks pass
See LICENSE file for details.