AI-powered Debt Collection Agency management platform with intelligent case assignment, compliance monitoring, and real-time analytics.
- Python 3.10+
- Node.js 18+
- npm or yarn
cd backend
# Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/Mac
# Install dependencies
pip install -r requirements.txt
# Seed the database with sample data
python seed_data.py
# Start the backend server
uvicorn main:app --reload --port 8000cd frontend
# Install dependencies
npm install
# Start the development server
npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
The app uses SQLite - a simple file-based database (no setup required!).
backend/
├── dca_management.db ← Created automatically by seed_data.py
└── seed_data.py ← Run this to create DB + sample data
- 100 sample cases with realistic P2P scores
- 5 agencies (RecoverMax, Commercial Collections, etc.)
- Demo users (admin, viewer, agency agents)
- 10 sample violations
del backend\dca_management.db # Windows
# rm backend/dca_management.db # Linux/Mac
python seed_data.pyNote: The database file is created when you first run
seed_data.py. It doesn't exist until then!
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ INGEST │────▶│ P2P SCORE │────▶│ ASSIGN │────▶│ COLLECT │
│ Case │ │ ML Model │ │ AI Routing │ │ Agency │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Rule-based │ │ Round-Robin │ │ Compliance │
│ Fallback │ │ Fallback │ │ Monitor │
└──────────────┘ └──────────────┘ └──────────────┘
| Stage | Component | Location |
|---|---|---|
| P2P Scoring | PyTorch Neural Network | app/ml/models.py |
| Case Assignment | Fit Score Algorithm | app/services/case_router.py |
| Compliance | Keyword/Regex Detection | app/services/compliance_checker.py |
| Fallback | Rule-based logic | Built into each service |
SPMLHackathon/
├── backend/
│ ├── app/
│ │ ├── ml/ # ML model definitions
│ │ ├── routers/ # API endpoints
│ │ ├── services/ # AI logic (P2P, router, compliance)
│ │ └── models.py # Database models
│ ├── models/ # Trained .pth models
│ ├── main.py
│ └── seed_data.py
│
└── frontend/
├── src/
│ ├── components/
│ ├── pages/
│ └── services/
└── package.json
- AI-powered routing using Fit Score algorithm
- PyTorch model support for custom ML
- Rule-based fallback when models unavailable
- 8-feature neural network (or rule-based fallback)
- Real-time scoring on case ingestion
- Train on Kaggle with your own data
- Aggressive language detection
- Disclosure verification (FDCPA)
- Contact time validation
- Real-time KPIs
- Agency leaderboard
- Recovery trends
| Role | Password | |
|---|---|---|
| Admin | admin@fedex.com | admin123 |
| Viewer | viewer@fedex.com | viewer123 |
| Agency | agent1@recovermaxsolutions.com | agent123 |
Every AI component has a rule-based fallback:
| Component | Primary | Fallback |
|---|---|---|
| P2P Scoring | PyTorch P2PNet | Rule-based scorer |
| Case Assignment | Fit Score AI | Smart Round-Robin |
| Compliance | LSTM Model | Keyword Blocklist |
| Endpoint | Description |
|---|---|
POST /api/v1/cases |
Create new case |
POST /api/v1/cases/assign |
Trigger auto-assignment |
GET /api/v1/analytics/dashboard |
Dashboard stats |
POST /api/v1/compliance/check-transcript |
Check for violations |
GET /api/v1/agencies |
List agencies with stats |
- Start both servers (backend: 8000, frontend: 3000)
- Dashboard - View KPIs and agency performance
- Cases → Click "Auto-Assign Cases"
- Compliance → Paste
"I will sue you"to see detection - Agency Portal - View and resolve cases
MIT License - Built for SPML Hackathon