Loading...
Please wait a moment
Full-stack chatbot builder platform for Tuel University with multi-provider AI support (OpenAI, Gemini, OpenRouter), RAG implementation, and OAuth SSO.
Educational institutions face significant barriers in deploying custom AI assistants for their unique needs. Instructors lack engineering expertise to build chatbots, while commercial solutions are expensive, inflexible, and vendor-locked. Integrating document-specific knowledge (syllabi, research papers, handbooks) requires complex RAG (Retrieval Augmented Generation) implementation, which is beyond most institutions' technical capabilities.
Security and compliance requirements for educational data demand enterprise-grade authentication, workspace isolation, and audit logging. Cost transparency is critical for budget-constrained institutions. The challenge was to create a production-ready platform that democratizes AI chatbot creation while maintaining security, scalability, and cost efficiency through comprehensive Azure cloud architecture.
I developed Tuel AI Chatbot Builder, a full-stack platform enabling instructors to create custom AI assistants without coding. Built with FastAPI 0.115 + Next.js 15 in a monorepo architecture, the platform supports multi-provider AI (OpenAI, Google Gemini, OpenRouter) with Bring-Your-Own-Key (BYOK) encryption for vendor independence.
The platform implements RAG via Azure AI Search for vector storage, enabling semantic search across uploaded files (PDF, TXT, DOCX) and scraped URLs (via Firecrawl). Real-time streaming responses use Server-Sent Events (SSE), while OAuth authentication (NextAuth.js v5 + Azure AD) provides enterprise SSO compatibility. A comprehensive Azure PaaS architecture (851 lines of documentation, 282 lines of Bicep IaC) showcases production-grade planning with cost transparency ($222-497/month) and zero-server management approach.


┌──────────────────────────────────────────────────────────────────┐
│ INTERNET / USERS (tuel.ai) │
└────────────────────┬─────────────────────────────────────────────┘
│
┌────────────▼────────────┐
│ GoDaddy DNS Records │
│ CNAME: www → Static WA │
│ A: @ → Static WA │
└────────────┬────────────┘
│
┌────────────────────▼─────────────────────────────────────────────┐
│ FRONTEND TIER (Next.js 15 + React 19) │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Azure Static Web Apps (Standard) │ │
│ │ • Next.js App Router with SSR + SSG │ │
│ │ • Global CDN (Microsoft edge network) │ │
│ │ • Free SSL certificate (auto-renewal) │ │
│ │ • NextAuth.js v5 (Azure AD OAuth) │ │
│ │ • Real-time streaming UI (SSE) │ │
│ └──────────────────┬───────────────────────────────────────┘ │
└─────────────────────┼────────────────────────────────────────────┘
│ HTTPS API calls (/api/v1/*)
│
┌─────────────────────▼────────────────────────────────────────────┐
│ BACKEND TIER (FastAPI 0.115 + Python 3.11) │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Azure Container Apps (Consumption Plan) │ │
│ │ • Auto-scaling (0→10 replicas) │ │
│ │ • Custom domain: api.tuel.ai │ │
│ │ • Managed certificates (SSL) │ │
│ │ • Managed Identity for passwordless access │ │
│ │ • Health probes: /health │ │
│ │ • Secrets from Key Vault │ │
│ └──────────┬─────────────────────┬─────────────────────────┘ │
└─────────────┼─────────────────────┼──────────────────────────────┘
│ │
┌─────────▼──────────┐ ┌───────▼──────────┐
│ Azure Key Vault │ │ Container │
│ • SECRET_KEY │ │ Registry (ACR) │
│ • ENCRYPTION_KEY │ │ • Backend image │
│ • DB credentials │ │ • Auto-build │
│ • AI API keys │ └──────────────────┘
└────────┬───────────┘
│
┌────────────▼──────────────────────────────────────────────────────┐
│ DATA & AI TIER │
│ ┌──────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ PostgreSQL 15 │ │ Redis Cache │ │ Blob Storage │ │
│ │ Flexible Server │ │ (C0 tier) │ │ (Hot tier) │ │
│ │ • B1ms burstable │ │ • 250MB cache │ │ • User uploads │ │
│ │ • 20GB storage │ │ • Rate limiting │ │ • Chatbot files │ │
│ │ • SQLAlchemy ORM │ │ • Session mgmt │ │ • 10MB max │ │
│ │ • 8 migrations │ └─────────────────┘ └─────────────────┘ │
│ └──────────────────┘ │
│ │
│ ┌──────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Azure OpenAI │ │ Azure AI Search │ │ Application │ │
│ │ Service │ │ (Basic tier) │ │ Insights │ │
│ │ • GPT-4o │ │ • Vector store │ │ • OpenTelemetry │ │
│ │ • GPT-3.5-turbo │ │ • Semantic │ │ • 30-day logs │ │
│ │ • Embeddings │ │ search (RAG) │ │ • Distributed │ │
│ │ • text-ada-002 │ │ • 15GB storage │ │ tracing │ │
│ └──────────────────┘ └─────────────────┘ └─────────────────┘ │
└───────────────────────────────────────────────────────────────────┘
Alternative AI Providers
┌───────────────────────────────────────────────────────────────────┐
│ ┌──────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Google Gemini │ │ OpenRouter │ │ Firecrawl │ │
│ │ (via API) │ │ (BYOK) │ │ (URL scraping) │ │
│ └──────────────────┘ └─────────────────┘ └─────────────────┘ │
└───────────────────────────────────────────────────────────────────┘
Security & Compliance
┌───────────────────────────────────────────────────────────────────┐
│ • Managed Identities (Azure Entra ID) - Zero hardcoded secrets │
│ • BYOK Encryption (Fernet) - User API keys encrypted at rest │
│ • Workspace Isolation (owner_uid scoping) - Multi-tenant secure │
│ • Rate Limiting (Redis) - Prevent abuse (10MB uploads, API) │
│ • OAuth 2.0 (NextAuth.js v5 + Azure AD) - Enterprise SSO │
│ • Immutable Audit Logs - Compliance tracking (future) │
└───────────────────────────────────────────────────────────────────┘Data Flow: User authenticates via Azure AD → Frontend sends API requests → Container Apps backend validates via NextAuth → Applies workspace isolation → Queries PostgreSQL/Redis/AI Search → Streams response via SSE
Security: All secrets in Key Vault, managed identities eliminate hardcoded credentials, BYOK encryption for user API keys, workspace isolation prevents data leakage
Cost: $222-497/month (scales with usage), 100% PaaS services, zero server management, consumption-based pricing for Container Apps
Integrated with OpenAI (GPT-4o, GPT-3.5-turbo), Google Gemini, and OpenRouter for vendor independence. Dynamic provider switching based on cost, performance, and availability. BYOK (Bring-Your-Own-Key) encryption via Fernet protects user API keys stored in Azure Key Vault. Real-time streaming responses using Server-Sent Events (SSE).
File uploads (PDF, TXT, DOCX) with 10MB limit per file. URL scraping via Firecrawl integration for web content ingestion. Vector embeddings using text-embedding-ada-002 stored in Azure AI Search (Basic tier). Semantic search across documents for context-aware responses.
NextAuth.js v5 integration with Azure AD OAuth for enterprise SSO compatibility. Role-based access control (Admin/Instructor/Student). Session management with thread IDs for conversation persistence. Workspace isolation via owner_uid scoping ensures multi-tenant security.
Public chatbot access via unique share tokens. Analytics tracking for usage metrics and popular queries. Rate limiting per token prevents abuse. Customizable expiration for time-limited access. Ideal for course-specific assistants shared with students.
Server-Sent Events (SSE) for token-by-token response rendering. Progress indicators during AI generation. Conversation threading with thread IDs. Multi-turn dialogue support with context preservation. Responsive UI across mobile, tablet, and desktop.
Fernet encryption for user API keys stored at rest. Azure Key Vault integration for secrets management (SECRET_KEY, ENCRYPTION_KEY, database credentials). Managed identities eliminate hardcoded secrets. Immutable audit logging for compliance (planned feature).
FastAPI 0.115 with async/await patterns for high-performance API endpoints. SQLAlchemy ORM + Alembic migrations (8 major migrations tracking schema evolution). PostgreSQL 15 Flexible Server (production) / SQLite (local dev). Redis distributed cache (C0 tier, 250MB) for rate limiting and session management. OpenTelemetry instrumentation for Application Insights observability.
Next.js 15 App Router with React 19 Server Components for optimal performance. NextAuth.js v5 authentication with Azure AD OAuth integration. TypeScript with strict mode for type safety. Real-time streaming UI using Server-Sent Events (SSE). Responsive design system with mobile-first approach.
Container Apps with auto-scaling (0→10 replicas, consumption-based pricing). Static Web Apps (Standard tier) for Next.js with global CDN. PostgreSQL Flexible Server (B1ms burstable, 20GB storage). Redis Cache (C0 tier) for distributed caching. Azure AI Search (Basic tier, 15GB) for vector storage. Blob Storage (Hot tier) for file uploads. Key Vault for secrets management. Application Insights for monitoring and telemetry.
Managed identities (Azure Entra ID) for passwordless access to Azure resources. BYOK encryption (Fernet) for user API keys stored in database. Workspace isolation via owner_uid scoping prevents multi-tenant data leakage. Rate limiting (10MB uploads, request throttling via Redis). OAuth 2.0 authentication with Azure AD for enterprise SSO. CORS configuration restricts cross-origin access.
Cost-transparent architecture with 100% Azure PaaS services. No server management, auto-scaling, and consumption-based pricing. Estimated monthly cost: $222-497 (scales with usage).
| Service | Tier | Purpose | Monthly Cost |
|---|---|---|---|
| Static Web Apps | Standard | Next.js hosting + CDN | $9 |
| Container Apps | Consumption | FastAPI auto-scale (0→10) | $50-150 |
| PostgreSQL Flexible Server | B1ms | Primary database | $12-25 |
| Azure OpenAI Service | Pay-per-use | GPT-4o, embeddings | $50-200 |
| Azure AI Search | Basic | Vector store (RAG) | $75 |
| Redis Cache | C0 (250MB) | Rate limiting, sessions | $16 |
| Blob Storage | Hot | File uploads | $5-10 |
| Key Vault | Standard | Secrets management | $0.03 |
| Application Insights | Free tier | Telemetry, monitoring | $0-5 |
| Container Registry | Basic | Docker images | $5 |
| Total Estimated Monthly Cost: | $222-497 | ||
Infrastructure as Code: 851 lines of Azure architecture documentation + 282 lines of Bicep IaC with 9 modular deployments
Democratize AI chatbot creation for educational institutions through a secure, scalable, multi-provider platform that requires zero coding expertise while maintaining enterprise-grade quality.
Become the industry standard for educational AI assistants with comprehensive RAG, BYOK support, Azure-native architecture, and transparent cost modeling that scales from individual instructors to entire university systems.
The platform is feature-complete and infrastructure-deployed for staging environments. Comprehensive Azure architecture planning demonstrates production-grade expertise.
Professors upload syllabi and lecture notes. Students ask questions 24/7 with RAG-powered context-aware answers. Share tokens enable collaborative access for study groups.
Lab teams ingest research papers via file upload or URL scraping. Members query methodology and findings. Vector search provides semantic understanding across documents.
Admissions offices upload student handbooks and policy documents. Automated responses to common questions reduce staff workload. Analytics track popular topics for content improvement.
New student orientation materials ingested into chatbot. Campus policy Q&A available 24/7. Multi-provider AI ensures response quality and availability.
Library resources and catalogs ingested for semantic search. Citation assistance and research guidance automation. Reduce reference desk volume during peak periods.
Common technical issues database powers self-service troubleshooting. Reduce ticket volume through AI-powered first-line support. Share tokens for department-specific knowledge bases.
Lowers barriers for instructors to create custom AI assistants without engineering expertise. Multi-provider support ensures flexibility and vendor independence. RAG enables context-aware responses from course materials.
Managed identities eliminate hardcoded secrets. BYOK encryption protects user API keys. Workspace isolation ensures multi-tenant security. OAuth authentication with Azure AD integration provides enterprise SSO compatibility.
Comprehensive 851-line architecture document showcasing Azure PaaS mastery. Cost-transparent infrastructure ($222-497/month). 282 lines of Bicep IaC with 9 modular deployments. Production-ready security model with Key Vault and managed identities.
Modern Next.js 15 App Router with React 19 Server Components. FastAPI backend with async/await patterns. PostgreSQL with Alembic migrations. Real-time streaming with SSE. TypeScript strict mode across frontend.
Honest assessment: staging-ready MVP with 8-12 week production timeline. Detailed TODO.md tracking 31 issues (9 critical). Test coverage roadmap from 20% to 70% target. Demonstrates professional planning rigor and security awareness.