A comprehensive mobile and web-based crime reporting system designed to combat drug trafficking through community engagement. The platform enables citizens to anonymously report suspicious activities while providing law enforcement administrators with tools to track, analyze, and respond to incidents.
- Overview
- Features
- Architecture
- Technology Stack
- Project Structure
- Prerequisites
- Installation
- Configuration
- Running the Application
- API Documentation
- Contributing
- License
DrugEx 2.0 is a three-tier application consisting of:
- Mobile Client App - React Native application for citizens to report drug-related incidents
- Admin Dashboard - React Native application for law enforcement to view and manage reports
- Backend API - FastAPI server with MongoDB database, featuring AI-powered face recognition and GPS extraction
The system uses advanced computer vision to identify recurring suspects across multiple reports and automatically extracts location data from uploaded images.
- 📱 Anonymous Crime Reporting - Submit detailed incident reports without revealing identity
- 📸 Photo Upload - Capture or upload images as evidence
- 📍 Location Tracking - Automatic GPS tagging of incidents
- 💬 Community Chat - Engage with support services and community members
- 📅 Incident Timeline - Record date and time of incidents
- 🔍 Detailed Incident Forms - Comprehensive fields for trafficking type, transport method, suspect description
- ℹ️ Information Pages - About us and appreciation screens
- 📊 Report Management - View all submitted reports in a centralized dashboard
- 🔗 Related Reports - AI-powered linking of reports based on face recognition
- 🗺️ Geographic Visualization - Map view of incident locations
- 🔄 Real-time Updates - Pull-to-refresh functionality
- 📈 Report Statistics - Track total number of reports
- 🤖 Face Recognition - Automatic face detection and matching using dlib
- 🌍 GPS Extraction - Extract location metadata from uploaded images
- 💾 MongoDB Integration - Robust NoSQL database for storing reports
- 🔐 CORS Support - Cross-origin resource sharing enabled
- 📡 RESTful API - Well-structured endpoints for all operations
- 🐳 Docker Support - Containerized deployment ready
┌─────────────────┐ ┌─────────────────┐
│ Client App │ │ Admin App │
│ (React Native) │ │ (React Native) │
└────────┬────────┘ └────────┬────────┘
│ │
│ HTTP/REST │
└───────────┬───────────────┘
│
┌──────▼──────┐
│ FastAPI │
│ Backend │
└──────┬──────┘
│
┌───────────┼───────────┐
│ │ │
┌────▼───┐ ┌───▼────┐ ┌──▼──────┐
│MongoDB │ │ dlib │ │Firebase │
│ DB │ │Face Rec│ │ Storage │
└────────┘ └────────┘ └─────────┘
- Framework: React Native 0.71.8
- Navigation: React Navigation 6.x (Drawer & Stack navigators)
- State Management: React Hooks (useState, useEffect)
- UI Components: Expo SDK 48
- Maps: React Native Maps
- Chat: React Native Gifted Chat
- Storage: AsyncStorage
- Image Handling: Expo Image Picker, Expo Location
- Framework: FastAPI 0.94.0
- Language: Python 3.9
- Server: Uvicorn 0.21.0
- Database: MongoDB (Motor async driver)
- Computer Vision:
- dlib 19.24.1
- face-recognition 1.3.0
- Pillow 9.4.0
- NLP: Gensim 4.3.1
- Scientific Computing: NumPy 1.24.2, SciPy 1.11.1
- Containerization: Docker & Docker Compose
- Database Management: Mongo Express
- Cloud Storage: Firebase Storage
- Version Control: Git
DrugEx2.0/
├── client/ # React Native Client App
│ └── DrugExClient/
│ ├── App.js # Main app entry with navigation
│ ├── config.js # Firebase configuration
│ ├── screens/ # App screens
│ │ ├── HomeScreen.js
│ │ ├── ReportScreen.js
│ │ ├── ChatScreen.js
│ │ ├── AboutUsScreen.js
│ │ └── AppreciationScreen.js
│ ├── components/ # Reusable components
│ │ ├── CustomButton.js
│ │ ├── Modal.js
│ │ └── ProgressDialog.js
│ └── assets/
│ └── color.js # Color theme
│
├── admin/ # React Native Admin App
│ └── DrugExAdmin/
│ ├── App.js # Admin app entry
│ ├── screens/
│ │ ├── ListScreen.js # View all reports
│ │ └── DetailsScreen.js # Report details
│ └── components/
│ ├── ReportCard.js
│ ├── RelatedReports.js
│ ├── Field.js
│ └── ShortField.js
│
└── backend/ # FastAPI Backend
├── main.py # Application entry point
├── app.py # FastAPI app configuration
├── requirements.txt # Python dependencies
├── Dockerfile # Docker image config
├── docker-compose.yaml # Multi-container setup
├── database/
│ └── db.py # MongoDB operations
├── models/
│ ├── report.py # Report data model
│ ├── chat.py # Chat message model
│ └── user.py # User model
├── routes/
│ ├── report.py # Report endpoints
│ ├── chat.py # Chat endpoints
│ ├── face.py # Face recognition endpoints
│ └── location.py # GPS extraction endpoints
└── keys/
└── keys.py # API keys & secrets
- Python 3.9+
- Docker & Docker Compose (optional but recommended)
- MongoDB 4.4+ (or use Docker Compose)
- CMake (for dlib installation)
- Node.js 14+
- npm or yarn
- Expo CLI
- iOS Simulator (Mac) or Android Emulator
- Physical device for testing (recommended)
git clone https://github.com/yourusername/DrugEx2.0.git
cd DrugEx2.0cd backend
# Start MongoDB and Mongo Express
docker-compose up -d
# Build and run the backend
docker build -t drugex-backend .
docker run -p 8000:8000 drugex-backendcd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the server
python main.pyThe backend will be available at http://localhost:8000
cd client/DrugExClient
# Install dependencies
npm install
# Start the development server
npm start
# Run on specific platform
npm run ios # iOS
npm run android # Android
npm run web # Webcd admin/DrugExAdmin
# Install dependencies
npm install
# Start the development server
npm start
# Run on specific platform
npm run ios # iOS
npm run android # Android-
Database Connection (
backend/database/db.py):# Update MongoDB connection string MONGODB_URL = "mongodb://rootuser:rootpass@localhost:27017"
-
API Keys (
backend/keys/keys.py):# Add your API keys FIREBASE_API_KEY = "your-firebase-api-key"
-
Firebase Setup (
client/DrugExClient/config.js):const firebaseConfig = { apiKey: "your-api-key", authDomain: "your-auth-domain", projectId: "your-project-id", storageBucket: "your-storage-bucket", messagingSenderId: "your-sender-id", appId: "your-app-id", };
-
Backend URL (
client/DrugExClient/screens/ReportScreen.js):// Update the backend URL const BACKEND_URL = "http://your-backend-url:8000";
- Backend URL (
admin/DrugExAdmin/screens/ListScreen.js):const domain = "http://your-backend-url:8000/";
-
Start MongoDB (if using Docker):
cd backend docker-compose up -d -
Start Backend:
cd backend python main.pyBackend runs on
http://localhost:8000 -
Start Client App:
cd client/DrugExClient npm start -
Start Admin App:
cd admin/DrugExAdmin npm start
cd backend
docker-compose up -d
docker build -t drugex-backend .
docker run -d -p 8000:8000 --name drugex-api drugex-backend# Build for production
cd client/DrugExClient
expo build:android # or expo build:ios
cd admin/DrugExAdmin
expo build:android # or expo build:iosOnce the backend is running, visit:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
POST /reports/report-crime- Submit a new crime reportGET /reports/get-all-reports- Fetch all reportsGET /reports/get-report?reportId={id}- Get specific reportGET /reports/get-related-reports?reportId={id}- Get related reports (face-matched)
POST /add-chat- Send a chat messageGET /get-messages?userId={id}- Get user's chat messages
GET /faces/get-all-faces- Get all stored face encodings
GET /location/get-location?url={imageUrl}- Extract GPS from image EXIF data
Submit Crime Report:
POST /reports/report-crime
{
"report_id": "abc123",
"incident_description": "Suspicious activity observed",
"incident_date": "2026-02-20",
"city": "New York",
"address": "123 Main St",
"gender": "Male",
"appearance": "Tall, dark clothing",
"trafficking_type": "Street dealing",
"transport_method": "Motorcycle",
"approx_age": "25-30",
"other_info": "Additional details",
"images": ["https://firebase.url/image.jpg"],
"location": [40.7128, -74.0060]
}cd backend
pytest tests/- Use Expo Go app for quick testing
- Test on physical devices for location and camera features
- Use iOS Simulator/Android Emulator for UI testing
We welcome contributions to DrugEx 2.0! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Python: Follow PEP 8 guidelines
- JavaScript: Use ESLint with Airbnb style guide
- Commits: Use conventional commits format
This project is licensed under the MIT License - see the LICENSE file for details.
- Mohammad Inamul Hassan M - Initial work
- Face recognition powered by dlib
- Mobile framework by Expo
- Backend framework by FastAPI
- Database by MongoDB
- User authentication and authorization
- Email notifications for admins
- Advanced analytics dashboard
- Multi-language support
- Encryption for sensitive data
- Report verification system
- Machine learning for pattern detection
- Integration with law enforcement databases
- iOS & Android app store deployment
Note: This application is designed to support law enforcement and community safety. All reports should be handled with appropriate confidentiality and in accordance with local laws and regulations.