Technical Architecture & Project Plan
Client: Taleb Alashkar | End Client: Law Firm (5-20 Staff)
Prepared by: Faizan Ali | June 6, 2026
A production-grade automated system that replaces RingCentral's generic call summaries with structured, AI-generated summaries tailored for a law firm. The system detects call completion, fetches the transcript from RingCentral, classifies the call type using AI, generates a structured summary, and delivers it via email and Microsoft Teams within 10-15 minutes.
The system consists of five layers:
| Layer | Function | Description |
|---|---|---|
| 1. Event Detection | Call trigger | RingCentral webhook notifies Django when a call ends |
| 2. Ingestion & Processing | Async pipeline | Fetches transcript from RingCentral, classifies via AI, generates structured summary |
| 3. Storage | Persist data | PostgreSQL for summaries/templates/audit. Blob Storage for audio (30-day retention). |
| 4. Delivery | Notify staff | Email (Azure Communication Services) + Teams (Incoming Webhook) in parallel |
| 5. User Interface | Staff + Admin | Staff portal: view/search/correct summaries. Admin panel: manage templates. |
Call Ends → Webhook → Async Task → Fetch Transcript (RingCentral API) → Classify (AI) → Summarize (AI) → Render Template → Save → Deliver (Email + Teams)
| Component | Technology | Purpose |
|---|---|---|
| Language | Python 3.12+ | Primary backend |
| Web Framework | Django 6+ | Application framework |
| REST API | Django REST Framework | API for frontend |
| Task Queue | Django-Q2 | Async tasks (PostgreSQL broker — no Redis) |
| Validation | Pydantic 2.x | AI output validation |
| Auth | django-allauth | Entra ID SSO |
| Audit | django-auditlog | Automatic audit trails |
The system supports multiple AI providers and can swap with minimal code changes:
| Option | Provider | Model | Best For |
|---|---|---|---|
| A (Recommended) | OpenAI Direct | GPT-5.4 | Best balance of cost, performance, and simplicity. Fast API, mature tooling. |
| B | Azure OpenAI | GPT-5.4 | Strongest compliance. Data in firm's tenant. Zero Data Retention available. |
| C | Google Gemini | Gemini 2.5 Pro | Competitive pricing. Requires Google DPA review. |
| D | Anthropic Claude | Opus / Sonnet | Strong reasoning. AWS Bedrock for enterprise controls. |
Recommendation: OpenAI Direct (Option A) for the best balance of cost and performance. Can upgrade to Azure OpenAI later if stricter compliance is needed.
| Component | Technology | Purpose |
|---|---|---|
| Framework | Next.js 16 | Staff web portal |
| UI | shadcn/ui + Tailwind CSS | Modern, accessible components |
| Auth | Auth.js + Entra ID | Staff SSO |
| Component | Technology | Purpose |
|---|---|---|
| Cloud | Microsoft Azure | Firm's own tenant |
| CI/CD | GitHub Actions | Automated deployments |
| Monitoring | Application Insights | Performance + alerting |
| Service | Tier | Purpose | Cost/mo |
|---|---|---|---|
| Production VM | B2ms (2 vCPU, 8 GB RAM) | Django + async worker | $60.74 |
| Staging VM | B2s (2 vCPU, 4 GB RAM) | Testing + QA environment | $30.37 |
| PostgreSQL Flexible | Burstable B1ms | Database + task broker | $16.09 |
| OpenAI API | Pay-as-you-go | Classification + summarization | $8-25 |
| Blob Storage | Standard LRS Hot | Audio (30-day) | $0.50 |
| Static Web Apps | Free | Next.js frontend | $0.00 |
| Communication Services | Pay-as-you-go | Email delivery | $0.38 |
| Key Vault | Standard | Secrets | $0.03 |
| Application Insights | Free | Monitoring | $0.00 |
| TOTAL | $116-133 |
| Service | Tier | Purpose | Cost/mo |
|---|---|---|---|
| Production VM | B4ms (4 vCPU, 16 GB RAM) | Django + async worker | $121.47 |
| Staging VM | B2ms (2 vCPU, 8 GB RAM) | Testing + QA environment | $60.74 |
| PostgreSQL Flexible | Burstable B2s | Database + task broker | $32.18 |
| OpenAI API | Pay-as-you-go | Classification + summarization | $8-25 |
| Blob Storage | Standard LRS Hot | Audio (30-day) | $0.50 |
| Static Web Apps | Free | Next.js frontend | $0.00 |
| Communication Services | Pay-as-you-go | Email delivery | $0.38 |
| Key Vault | Standard | Secrets | $0.03 |
| Application Insights | Free | Monitoring | $0.00 |
| TOTAL | $223-241 |
| # | Feature | Hours | Key Details |
|---|---|---|---|
| 1 | Transcript Ingestion | 16-22 | Webhook + fetch transcript via RC API + fallback to audio transcription |
| 2 | Secure Storage | 6-9 | Django models + PostgreSQL + Blob + encryption |
| 3 | Template Engine | 12-16 | 5 templates: Intake, Case Update, Counsel, Court, Internal |
| 4 | AI Summarization | 18-22 | Prompt engineering + classification + validation |
| 5 | Staff Web Interface | 14-19 | Summary list/detail/edit, search, SSO |
| 6 | Email Delivery | 8-12 | Azure Comm Services + HTML templates + tracking |
| 7 | Teams Delivery | 10-14 | Incoming Webhooks + Adaptive Cards |
| 8 | Admin Template Editor | 14-20 | Custom Next.js admin panel + rich text editor + template CRUD + live preview |
| 9 | Audit Logging | 4-7 | django-auditlog + pipeline logging |
| 10 | Security Hardening | 7-11 | Entra ID + RBAC + Key Vault + validation |
| 11 | Deployment & Config | 12-16 | CI/CD + monitoring + environment setup |
| Subtotal | 121-168 | ||
| Integration Testing | 10-14 | ||
| UAT + Bug Fixes | 10-16 | ||
| Project Management | 12-16 | ||
| GRAND TOTAL | 153-214 |
* Hours estimated with AI-assisted development.
| Scenario | Duration |
|---|---|
| 1 developer | 4-5 weeks |
Google requires apps that access user data to pass a CASA (Cloud Application Security Assessment) — a third-party security audit that can take weeks to months and cost $4,500-$75,000+. This applies to any app using Google OAuth with sensitive or restricted scopes.
Microsoft has no equivalent gate. Since this system is deployed as a single-tenant app within the law firm's own Azure tenant, the firm's IT admin simply grants consent directly. No external verification, no security assessment, no audit, no yearly revalidation.
| Factor | Google (CASA) | Microsoft (Our Path) |
|---|---|---|
| OAuth Verification | Required | NOT required (single-tenant) |
| Security Assessment | CASA audit (weeks/months, $4,500+) | None |
| External Audit | Required | NOT required |
| Approval Timeline | Weeks to months | Instant (admin consent) |
| Yearly Revalidation | Annual re-assessment | None |
As of June 2026, Microsoft has no equivalent security assessment requirement for single-tenant applications.
References:
Google CASA requirement: appdefensealliance.dev/casa
Microsoft single-tenant consent: learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent
| Metric | Value |
|---|---|
| Total Hours | 153 - 214 hours |
| Hourly Rate | $38/hour |
| Total Project Cost | $5,814 - $8,132 |
| Timeline | 4 - 5 weeks |
| Monthly Azure Cost (Standard) | $116 - $133 |
| Monthly Azure Cost (Performance) | $223 - $241 |
| Cost per Call (AI) | ~$0.015 * |
* Each call requires two OpenAI API calls (classification + summarization). A typical 10-30 min call produces ~1,500-4,000 tokens of transcript. At GPT-5.4 pricing (~$2.50/1M input, ~$10/1M output), the average AI cost per call is ~$0.015. At 20 calls/day this is ~$9/mo, at 50 calls/day ~$22/mo.
Prepared by Faizan Ali