Independent Project 2024

AI-Powered CRM & Contact Intelligence Platform

A full-stack CRM prototype engineered with a FastAPI backend, React + TypeScript frontend, and multi-provider LLM integration for contact enrichment and interaction tracking.

  • Python (FastAPI)
  • React 18
  • TypeScript
  • Tailwind CSS
  • SQLAlchemy
  • SQLite
  • OpenAI / Gemini APIs
  • OpenRouter
  • openpyxl

Independent Engineering Prototype: This project is a functional, full-stack architectural exploration built by Mohammad Azharuddin to explore decoupled clean architecture and multi-provider LLM integrations. It is maintained as a technical portfolio project rather than a commercial production SaaS.


1. Overview

AI CRM is a modern, full-stack customer relationship management prototype engineered to explore clean architectural patterns, robust API design, and pragmatic AI integration.

The application pairs a high-performance Python FastAPI backend with a responsive React + TypeScript frontend, automating contact record ingestion, communication logging, and AI-driven contact summarization using modern Large Language Model (LLM) APIs.


2. Problem or Motivation

Traditional CRM systems often suffer from significant operational drawbacks for small teams:

  • Cumbersome Manual Logging: Sales and operations professionals spend disproportionate time summarizing meeting notes, email threads, and contact updates.
  • Provider Lock-In: Most AI-enabled tools lock users into a single model vendor (e.g., proprietary OpenAI endpoints), creating vulnerabilities to vendor pricing hikes, rate limits, or outages.
  • Brittle Data Import Pipelines: Ingesting messy CSV and Excel files frequently crashes application backends due to lack of schema validation.

3. Project Objectives

  • Design a decoupled, maintainable backend architecture adhering to Clean Architecture principles.
  • Implement a vendor-agnostic AI service layer supporting seamless runtime switching between Google Gemini, OpenAI, Groq, and OpenRouter.
  • Build a resilient bulk-import pipeline capable of sanitizing and validating Excel (.xlsx) and CSV files before database insertion.
  • Deliver an accessible, fast frontend UI featuring real-time client-side search, filtering, and modal editing.

4. My Role and Contribution

As Solo Full-Stack Engineer:

  • Architected the complete system end-to-end, defining data models, domain schemas, and REST endpoints.
  • Implemented the FastAPI backend, SQLAlchemy ORM persistence, and Pydantic validation schemas.
  • Developed the multi-provider LLM adapter engine with fallback handling.
  • Built the React 18, TypeScript, and Tailwind CSS single-page application.
  • Orchestrated the local developer environment with automated process supervisors.

5. Architecture

┌─────────────────────────────────────────────────────────────┐
│ Frontend UI (React 18 + TypeScript + Tailwind CSS + Vite)    │
│   ├── Contact Management Table & Live Filtering             │
│   ├── Interactive Modal Editors & Interaction Timelines      │
│   └── Bulk Spreadsheet Upload Dialog                        │
└──────────────────────────────┬──────────────────────────────┘
                               │ JSON REST / Multipart (HTTP)
                               ▼
┌─────────────────────────────────────────────────────────────┐
│ FastAPI Backend Service (Python 3)                          │
│                                                             │
│   ┌─────────────────────────────────────────────────────┐   │
│   │ Domain & Validation Schemas (Pydantic)              │   │
│   └──────────────────────────┬──────────────────────────┘   │
│                              ▼                              │
│   ┌─────────────────────────────────────────────────────┐   │
│   │ Use Case & Service Layer (ai_service.py)            │   │
│   └─────────────┬─────────────────────────┬─────────────┘   │
│                 │                         │                 │
│                 ▼                         ▼                 │
│   ┌──────────────────────────┐ ┌──────────────────────────┐ │
│   │ Persistence (SQLAlchemy) │ │ Multi-Provider LLM Engine│ │
│   │ SQLite Storage Engine    │ │ (Gemini, OpenAI, Groq)   │ │
│   └──────────────────────────┘ └──────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘

The system strictly decouples the HTTP transport layer from business logic and database persistence, ensuring that swapping database engines (e.g. SQLite to PostgreSQL) or AI providers does not impact core application rules.


6. Technical Implementation

A. Decoupled Clean Architecture Backend

  • Domain Layer: Pure data structures and validation schemas defined using Pydantic (ContactSchema, ContactCreate, InteractionCreate).
  • Infrastructure Layer: Database session management via SQLAlchemy ORM with automated table initialization on boot.
  • Use Cases Layer: Business logic encapsulated in dedicated services, isolating external third-party API clients from HTTP controllers.

B. Multi-Provider LLM Intelligence Engine

  • Unified client abstraction that standardizes model requests and response formats across Google Gemini, OpenAI, and OpenRouter.
  • Generates concise interaction summaries, extracts key relationship milestones, and suggests automated next-best actions from unstructured text notes.

C. Bulk Ingestion Pipeline

  • Engineered multipart upload endpoints supporting streaming CSV and native Excel (.xlsx) ingestion using openpyxl.
  • Implements strict field-level validation (sanitizing telephone numbers, normalizing email addresses, and stripping malicious script injections).

D. Single-Page Application Frontend

  • Built with React 18, Vite, TypeScript, and Tailwind CSS.
  • Features responsive data tables with zero-latency client-side filtering, debounced search, and inline modal state management.

7. Key Engineering Decisions

  • FastAPI over Django/Flask: Selected FastAPI for its native async support, automated OpenAPI (Swagger) documentation, and high-performance serialization via Pydantic.
  • SQLite for Prototype Persistence: Utilized SQLite via SQLAlchemy for zero-configuration, lightweight local deployment, designed with repository abstractions to allow seamless drop-in replacement with PostgreSQL.
  • Unified Local Orchestration: Created a single ./start.sh startup script managing concurrent backend (uvicorn) and frontend (vite) processes with proper Unix signal trap handlers.

8. Challenges and Solutions

ChallengeEngineering Solution
LLM Provider Rate Limits & VarianceImplemented a unified provider adapter that normalizes payload structures and allows switching model providers via configuration without modifying business logic.
Excel Format InconsistenciesImplemented openpyxl cell-type inspection to handle mixed numeric/text telephone numbers and date formatting anomalies gracefully.
Concurrent Process Lifecycle in DevWrote a robust Bash wrapper script with trap 'kill 0' SIGINT SIGTERM to cleanly terminate both Uvicorn and Vite servers on exit.

9. Results and Current Status

  • Development Status: Fully functional Working Engineering Prototype.
  • Outcomes: Successfully validates the decoupled architecture pattern and provides a working reference implementation for multi-provider AI integrations.
  • Codebase Health: Clean TypeScript compilation with strict type checking, comprehensive Pydantic data validation, and modular service separation.

10. Technology Stack

  • Backend: Python 3, FastAPI, Uvicorn, Pydantic
  • Persistence: SQLite, SQLAlchemy ORM
  • AI Integrations: Google Gemini API, OpenAI SDK, Groq, OpenRouter
  • Spreadsheet Processing: openpyxl, Python CSV engine
  • Frontend: React 18, TypeScript, Tailwind CSS, Vite
  • Developer Tooling: Bash automation (start.sh), Pytest