AI Chatbot · SaaS

School Chatbot Admin Dashboard —
Plug-and-Play AI Chatbot SaaS

A multi-tenant SaaS platform that lets any school or business deploy a fully functional AI chatbot — powered by their own website data — in minutes. One script tag. Zero technical knowledge required.

Project Type SaaS Platform
Role Full-Stack Developer
AI Model GPT-4o-mini
Deployment Render / Railway
School Chatbot Admin Dashboard

Problem Statement

Schools and small businesses worldwide handle hundreds of repetitive inquiries every day — fee structures, admission dates, timings, faculty details. Hiring dedicated staff for this is expensive, and off-the-shelf chatbot solutions are either too generic, too costly, or require extensive manual setup.

Repetitive Inquiries Overload

School admins and receptionists answer the same 20–30 questions every day — fee structure, admission deadlines, timings — consuming hours of productive time.

Expensive Generic Solutions

Enterprise chatbot platforms charge thousands of dollars per month and require weeks of manual content setup — completely out of reach for schools and SMBs.

Technical Barrier to Entry

Existing tools require technical knowledge to train chatbots on custom data. School admins have no time or expertise for this.

Outdated Information Risk

Static chatbots go stale. When a school updates its fees or admission dates on its website, the chatbot still gives old answers — damaging trust.

The core question was: Can we build an AI chatbot that reads a school's own website automatically and stays updated — with zero effort from the client?

Solution

A multi-tenant SaaS platform where each client is fully onboarded in under 10 minutes. The platform auto-scrapes their website, builds a GPT context, and delivers an embeddable chatbot widget — no manual data entry, no technical knowledge required.

For Admin (Client)

  • Register and log in to the admin dashboard
  • Paste the school/business website URL
  • Platform auto-scrapes up to 50 pages
  • Copy one <script> tag and paste into website
  • Chatbot is live — no further action needed

For Website Visitor

  • Chat widget appears on the school's website
  • Ask any question in English, Roman Urdu, or Urdu
  • AI answers from the school's own website data
  • Relevant page links shown as quick buttons
  • Conversation memory across the session

Admin Dashboard — Live Preview

The admin dashboard where each school registers, pastes their URL, and gets their chatbot script in under 10 minutes.

Technical Architecture

The platform is built on Flask with a clean multi-tenant architecture — each school's data is completely isolated. The system combines intelligent scraping, GPT-4o-mini, response caching, and a dynamically served embeddable widget.

┌──────────────────────────────────────────────────────────────┐
│                  ADMIN DASHBOARD  (Flask + Jinja2)            │
│   Register / Login → Add School URL → View Chatbot Script    │
└───────────────────────────┬──────────────────────────────────┘
                            │
┌───────────────────────────▼──────────────────────────────────┐
│                  INTELLIGENT SCRAPER                          │
│   BeautifulSoup (static sites) + Playwright (JS/React sites) │
│   MD5 hash → skip scrape if site unchanged                   │
│   Auto-detect: fees, admission, contact pages                │
│   50-page limit with priority ordering                       │
└───────────────────────────┬──────────────────────────────────┘
                            │  scraped data → per-school folder
┌───────────────────────────▼──────────────────────────────────┐
│                  SMART CONTEXT BUILDER                        │
│   Priority pages (about/fees/admission) → 4000 chars each    │
│   Standard pages → 1000 chars each                          │
│   Feeds ranked context to GPT-4o-mini                        │
└────────────┬────────────────────────────────┬────────────────┘
             │                                │
┌────────────▼────────────┐   ┌──────────────▼──────────────┐
│  GPT-4o-mini (OpenAI)   │   │  Response Cache              │
│  System prompt per      │   │  500 Q&A pairs per school    │
│  school with context    │   │  40–60% API cost reduction   │
└────────────┬────────────┘   └─────────────────────────────┘
             │
┌────────────▼────────────────────────────────────────────────┐
│                EMBEDDABLE WIDGET  (Vanilla JS)               │
│   Served at /widget.js?school_id=xxx                         │
│   SVG avatar + tooltip + conversation memory (10 turns)      │
│   Page link buttons + multilingual (EN / Roman Urdu / Urdu)  │
│   Zero dependency — works on any website / framework         │
└─────────────────────────────────────────────────────────────┘
             │  APScheduler
┌────────────▼────────────────────────────────────────────────┐
│                AUTO-SYNC  (Daily at 6 AM)                    │
│   Hash check → scrape only if website changed               │
│   Cache clears on update                                     │
└─────────────────────────────────────────────────────────────┘

Key Features Built

Dual-Mode Intelligent Scraper

Automatically detects whether a website is static or JavaScript-rendered and switches scraping strategy accordingly:

  • BeautifulSoup for standard HTML sites
  • Playwright/Chromium headless browser for React, Angular, Next.js sites
  • MD5 hash of homepage — skips unchanged sites entirely
  • Auto-identifies fee, admission, contact pages by URL keywords

Priority-Based Context Building

Not all pages are equal. The context builder ranks pages before sending them to GPT-4o-mini:

  • Priority pages (about, fees, admission, contact, founder) → 4,000 characters each
  • All other pages → 1,000 characters each
  • Critical information always appears first in the GPT context window

Response Caching Engine

Identical questions return cached answers instantly — no OpenAI API call needed. Cache holds up to 500 Q&A pairs per school, reducing API costs by an estimated 40–60% for high-traffic clients.

Zero-Dependency Embeddable Widget

A dynamically served JavaScript widget that works on any website regardless of framework:

  • Conversation memory (last 10 turns sent to GPT)
  • Page link buttons triggered by keyword detection
  • SVG AI avatar with tooltip
  • Multilingual: English, Roman Urdu, Urdu
  • One <script> tag deployment

Auto-Sync with Smart Skip

APScheduler runs a daily scrape at 6 AM. If the website's homepage MD5 hash matches the stored hash, scraping is skipped entirely. If changed, data updates automatically and the response cache clears — keeping chatbot answers always current.

Chatbot Widget — In Action

The embeddable widget live on a school's website — answering visitor questions in real time from the scraped website data.

Business Model

Designed as a commercially viable SaaS product targeting school admins, coaching centers, and small businesses with websites — across Pakistan, UAE, UK, US, and anywhere in the world.

PlanPriceFeatures
StarterRs. 2,000 / month1 chatbot, up to 20 pages scraped
GrowthRs. 5,000 / month3 chatbots, up to 50 pages, priority support
EnterpriseCustomUnlimited chatbots, custom branding, dedicated support

Client acquisition strategy: target school admins and business owners directly. Demo takes under 10 minutes — show them their own website's chatbot answering live questions.

Challenges & How They Were Solved

Challenge 1: JS-Rendered Websites Couldn't Be Scraped
Modern school websites built on React or Next.js return empty HTML to standard scrapers. Integrated Playwright headless browser with auto-detection — if BeautifulSoup returns minimal text, the scraper automatically falls back to Playwright/Chromium.
Challenge 2: GPT Missing Specific Facts in Large Datasets
When 50 pages are scraped, GPT often misses critical facts buried in lower-priority pages. Solved with priority-based context ordering — important pages (fees, admission, contact) appear first with 4× more characters than standard pages.
Challenge 3: Scraping Blocking the HTTP Request
Scraping 50 pages with Playwright can take 60–120 seconds — far exceeding browser and server request timeouts. Used background threading: the scrape runs in a separate thread, the API returns immediately, and the frontend polls every 3 seconds for status.
Challenge 4: Browser Caching Old Widget JavaScript
After updating widget features, client browsers served the cached old version. Fixed by setting Cache-Control: no-store headers on the /widget.js endpoint — forcing a fresh fetch every time.
Challenge 5: Sensitive Admin Data Leaking into Chat
Early versions accidentally included internal admin phone numbers in GPT context, causing the chatbot to expose them publicly. Fixed by explicitly removing admin contact data from the scraped context. System prompt instructs GPT to use only scraped website data.
Challenge 6: Daily Scraping Wasting Compute on Unchanged Sites
Running a full Playwright scrape daily for every school — even if nothing changed — was wasteful. Implemented MD5 hash comparison of the homepage. If the hash matches, the entire scraping pipeline is skipped, saving compute and API costs.

Multilingual Support & Smart Features

The widget supports English, Roman Urdu, and Urdu — with smart page link buttons that surface relevant pages based on the visitor's question.

Results & Demo Clients

3 Demo clients onboarded
33 Pages scraped — The City School
<10 min Full onboarding time
40–60% API cost reduction via cache
ClientPages ScrapedWhat It Answers
The City School33 pagesAdmission, fee structure, branch locations, timings
Yveloxy27 pagesFounder story, services, blog content, contact info
Young ScholarsFull siteTimings, faculty details, contact, school information

Deployment

LayerPlatformNotes
Backend + WidgetRender.com / Railway.appGunicorn (1 worker, 120s timeout) — free tier
Headless Browsernixpacks.toml on cloudChromium + Playwright configured for cloud environment
Process ManagerGunicornHandles concurrent requests; background scraping via Python threads
SchedulerAPScheduler (in-process)Daily auto-sync at 6 AM per tenant

What I Learned

1
Multi-Tenancy Architecture

Designing complete data isolation between tenants from day one — separate directories, separate caches, separate API keys — prevents cross-contamination bugs that are very hard to fix later.

2
Scraping at Scale

Real-world websites vary enormously. Building a dual-mode scraper (static + JS-rendered) with graceful fallback taught practical web crawling resilience far beyond tutorial examples.

3
Context Engineering

Feeding 50 pages of raw text to GPT produces poor results. Ranking, trimming, and prioritizing context is as important as the AI model itself for answer quality.

4
Async UX for Long Operations

Never block the user on a long-running task. Background threading + polling gave a smooth experience where the UI stayed responsive during 90-second scrapes.

Want a custom AI chatbot for your school or business?

We build plug-and-play AI chatbots that answer your customers' questions 24/7 — using your own website data, with zero manual setup. Serving clients in Pakistan, UAE, UK, US, and worldwide.