VAULT/
├── core/ # Project configuration (formerly mad_site/)
│ ├── settings.py # Django settings
│ ├── urls.py # Root URL configuration
│ ├── middleware.py # Security layers
│ ├── wsgi.py
│ └── asgi.py
│
├── apps/ # Modular business logic
│ └── detector/ # Main detection app (formerly vault/)
│ ├── views.py # API endpoints
│ ├── urls.py
│ ├── models.py
│ ├── services/ # Business logic layer
│ ├── tests/ # Unit tests
│ └── migrations/
│
├── ml/ # Machine Learning core
│ ├── ensemble.py # Soft-voting ML pipeline
│ ├── processors/ # Image preprocessing
│ │ └── vision_utils.py
│ ├── weights/ # Model checkpoints
│ └── tests.py
│
├── df/ # Digital Forensics engine
│ ├── metadata.py # EXIF/metadata extraction
│ ├── ela_scanner.py # Error Level Analysis
│ ├── noise_analysis.py # Pixel consistency checks
│ └── utils/ # File signature validation
│
├── media/ # Uploaded files (git-ignored)
│ ├── temp/ # Temporary analysis files
│ └── reports/ # Generated PDF reports
│
├── logs/ # Application logs
│ └── scans.log
│
├── static/ # Frontend assets
│ └── vault/
│ ├── css/
│ └── js/
│
├── templates/ # HTML templates
│ └── vault/
│ └── index.html
│
├── manage.py
├── requirements.txt
└── .gitignore
-
Activate virtual environment
python -m venv .venv .venv\Scripts\activate # Windows source .venv/bin/activate # Linux/Mac
-
Install dependencies
pip install -r requirements.txt
-
Run migrations
python manage.py migrate
-
Start development server
python manage.py runserver
-
Access the application
- Frontend: http://localhost:8000
- API Health: http://localhost:8000/api/health/
- API Analyze: http://localhost:8000/api/analyze/ (POST)
- Template: templates/vault/index.html
- Styles: static/vault/css/style.css
- Scripts: static/vault/js/app.js
GET /api/health/POST /api/analyze/
Content-Type: multipart/form-data
{
"image": <file>
}- ML Pipeline: ml/ensemble.py - Implement soft-voting model inference
- Forensics:
- df/metadata.py - EXIF extraction
- df/ela_scanner.py - Error Level Analysis
- df/noise_analysis.py - Pixel consistency
- Business Logic: apps/detector/services/
- API Integration: apps/detector/views.py
The restructuring maintains full compatibility:
- ✅ Templates still in
templates/vault/ - ✅ Static files still in
static/vault/ - ✅ All imports updated to new structure
- ✅ Django settings configured correctly
- ✅ Frontend code untouched
-
Set environment variables:
DJANGO_SECRET_KEY(generate secure key)DJANGO_DEBUG=0(disable debug in production)DJANGO_ALLOWED_HOSTS=yourdomain.com
-
Collect static files:
python manage.py collectstatic
-
Use production WSGI/ASGI server:
gunicorn core.wsgi:application # or uvicorn core.asgi:application
- ✅ Restructuring Complete - Professional Django architecture implemented
- 🔄 Implement ML model inference in
ml/ensemble.py - 🔄 Add EXIF extraction in
df/metadata.py - 🔄 Implement ELA scanner in
df/ela_scanner.py - 🔄 Add business logic in
apps/detector/services/ - 🔄 Write tests in
apps/detector/tests/andml/tests.py
MIT License