Skip to content
<Rojit />
Claims: 1000+· 2025

Insurance Claim Platform

Multi-subsystem UK insurance platform with real-time AI-powered room analysis via Cohere Vision, Django Channels chat, Celery async pipelines, automated PDF report generation, and a React Native mobile app for field assessors.

Technical case study by Rojit Pokharel — Full-Stack Web Developer & System Architect, Kathmandu, Nepal

DjangoDRFDjango ChannelsCeleryReact NativePostgreSQLRedisCohere Vision

Stack diagram

Frontend
React Native
Application
DjangoDRFCeleryCohere Vision
Real-time
Django Channels
Data
PostgreSQLRedis
Client / Problem
$
  • Claims assessments relied on manual review of photos and notes, taking hours per claim and producing inconsistent reports.
  • Assessors, adjusters, and claimants communicated through email chains with no central record of a claim's lifecycle.
  • Report generation was manual, slow, and error-prone, with no automated audit trail.
  • Field assessors needed to capture photos and assessments on site, often in low-connectivity environments.

Client: UK-based insurance provider

My Role
$
  • Full-stack developer on a multi-subsystem insurance platform — Django REST API, Django Channels real-time chat, Celery async pipelines, AI analysis integration, and the React Native field app.
  • Designed the claim lifecycle data model and the async task architecture.
Architecture
$
  • Multi-subsystem platform covering the full claim lifecycle — initial assessment, AI room analysis, adjuster review, and final PDF report.
  • Django REST Framework API for the web and mobile clients, with Django Channels running on a separate ASGI worker for WebSockets.
  • Celery with Redis as the message broker handles long-running tasks: AI image analysis, PDF generation, and notifications.
  • PostgreSQL as the primary store, Redis for caching and the broker.
Database Design
$
  • Claim-centric schema: claims, assessments, rooms, damage analyses, adjuster notes, messages, and reports.
  • PostgreSQL foreign keys and constraints keep the claim lifecycle referentially intact.
  • Indexes on claim status and assessor for the operational queries the team runs daily.
API Architecture
$
  • DRF view sets with serializer-level validation for the claim, assessment, and message endpoints.
  • WebSocket consumers for real-time chat with message-history replay on connect.
  • Celery task chain: AI analysis completes → assessment saved → PDF report generation queued → user notified.
Code
Celery task for AI-powered room damage analysis
@shared_task(bind=True, max_retries=3)
def analyze_room_damage(self, assessment_id, image_paths):
    assessment = ClaimAssessment.objects.get(id=assessment_id)
    for image_path in image_paths:
        response = cohere_client.generate(
            model='command',
            prompt=f'Analyze this insurance claim room photo for damage...',
        )
    assessment.damage_analysis = results
    assessment.save()
    generate_claim_report.delay(assessment_id)
Authentication
$
  • SimpleJWT token authentication for the mobile and web clients.
  • Role-based permissions distinguishing assessors, adjusters, and claimants across API endpoints.
  • Channel-layer scope checks so WebSocket chat connects only to authorized claim rooms.
Real-time Systems
$
  • Django Channels WebSocket chat between assessors, adjusters, and claimants with persisted history.
  • Graceful reconnection handling and message history replay on reconnect.
  • ASGI worker separated from the HTTP layer so real-time traffic never blocks the API.
Deployment
$
  • ASGI (Daphne) for Channels alongside the WSGI Django app, behind Nginx with SSL.
  • Supervisor-managed Celery workers for the async task queue.
  • Redis as broker and cache, PostgreSQL with automated backups.
Performance Optimization
$
  • Async pipeline means the API stays responsive while PDFs and AI analysis run in the background.
  • Redis caching for frequently read claim metadata.
  • Batch-friendly serializers so mobile assessors can sync many assessments efficiently.
Problems Encountered
$
  • AI image analysis is slow and occasionally fails on ambiguous photos — a synchronous call would block the API.
  • Real-time chat must survive flaky mobile networks on site.
  • PDF reports must include AI results, adjuster notes, and cost breakdowns in one auditable document.
How I Solved Them
$
  • Moved analysis into a Celery task with retries and graceful degradation when the vision API is unavailable.
  • Channels consumers replay message history on reconnect so no communication is lost on patchy connections.
  • A deterministic report template renders every assessment field, AI output, and note into a versioned PDF.
Results
$
  • The platform handles 1000+ insurance claims with full audit trails.
  • AI-powered room analysis reduced average assessment time from hours to minutes.
  • Automated PDF generation eliminated manual report writing entirely.
  • Field assessors capture and sync assessments offline via the React Native app.
Lessons Learned
$
  • AI features must be async and fail-soft — never let a vision API outage block a claim.
  • Real-time chat needs offline resilience and history replay to be trusted by field staff.
  • An auditable document trail is non-negotiable in insurance.

Want a production system like this?

I build production web applications end-to-end. Let's discuss your project.

Get in Touch