Insurance Marketplace

MyPolis

An insurance marketplace where customers buy policies in one place and insurance companies join as listed partners. Delivered payment processing, point-of-sale systems, contract management, an admin panel, and business reporting.

Overview

Buying insurance in Uzbekistan meant visiting each company separately or relying on a broker. MyPolis changes that — it's an online marketplace where customers compare and buy OSAGO, KASKO, and Travel policies from multiple insurers in one place. I built the whole thing: storefront, backend integrations with three insurance APIs, and the admin panel that operations teams use daily.

What I built

  • Solo full-stack: designed and shipped the customer storefront, the Django REST backend, and a separate admin panel — all from scratch.

  • Wired three insurance providers (EuroAsia, Asia Insurance, O'zagrosug'urta) into a single purchase flow — each with its own API quirks, but the same smooth experience for the customer.

  • Built a Telegram Mini App dashboard for real-time revenue and policy monitoring — so the ops team can check numbers from anywhere.

  • Owned all data modelling — contracts, vehicles, drivers, commission rates, promo codes, and a custom user model ready for national ID and OneID SSO.

Architecture

Three applications talk to each other: a Next.js storefront serving customers in Uzbek and Russian, a Django REST backend that proxies calls to each insurer's own API, and a separate admin SPA for operations. Each insurance provider lives in its own module on the backend, so adding a new one doesn't touch existing ones.

Under the hood

  • Atomic policy purchase with automatic rollback: creating a contract wraps the local database write, the insurer API call, and the payment URL retrieval in a single transaction — so if the payment link fails after the insurer has already registered the policy, the system rolls back and fires a Telegram alert instead of silently losing the sale.

  • Commission and promo-code engine: broker percentages are stored per company and product type, and promo codes support both percentage and fixed-sum discounts scoped to specific insurers with date-range validity — all re-validated at purchase time so nothing slips through stale.

  • Telegram dashboard authentication using Telegram's own HMAC initData spec — the backend verifies the cryptographic signature and checks the timestamp freshness before issuing tokens, so the dashboard is only accessible to whitelisted admins.

What I learned

  • Integrating multiple third-party APIs taught me to expect inconsistency — each insurer had different error formats, timeouts, and edge cases that only appear under real load.

  • Keeping the provider integrations in separate modules from day one meant I could swap or update one without fear of breaking the others.

Built with

Frontend (Storefront + Admin)

  • Next.js 16
  • React 19
  • TypeScript 5
  • Tailwind CSS 4
  • shadcn/ui
  • TanStack Query v5
  • next-intl

Backend

  • Python 3.9
  • Django 4.2
  • Django REST Framework 3.14
  • djangorestframework-simplejwt
  • django-modeltranslation

Data

  • PostgreSQL
  • Django ORM
  • pandas
  • openpyxl

Infra & Tools

  • Docker
  • Nginx
  • Telegram Bot API
  • Gunicorn
  • Whitenoise