Back to Projects
SmartHub Academy
AI/ML

SmartHub Academy

Founder & AI/Platform Engineer

FastAPIPythonOpenAIClaudeRAGNext.jsExpressMongoDB

About the Project

SmartHub Academy is a learning platform I built from scratch and continue to operate, serving 500+ graduates. It runs as five deployables rather than one app: a TypeScript/Express API on MongoDB, three Next.js surfaces (public site and student portal, the student LMS, and the operations admin), and a separate Python FastAPI service that owns every AI and automation task that must run outside the request cycle. The centrepiece is Oreo — an agentic assistant that answers questions for admins, instructors, students and anonymous visitors, each from a different tool catalogue, and reaches people through the website widget, the LMS, Slack, Telegram, Messenger and Instagram.

What It's Made Of

Public site & student portal

Next.js · MUI · shadcn/ui

The front door: course catalogue, schedules and pricing, enrollment and payment flows, webinar listings with reservations, the blog, FAQs and testimonials, and a campus ambassador programme. It also carries the public Oreo widget, which answers prospective students from the public tool catalogue and the RAG site index rather than from anything authenticated.

Student LMS

Next.js · React Query · Zustand

Where enrolled students actually work: their cohorts and modules, assignments with late-submission rules, submissions with version history and rubric-scored feedback, class recordings and downloadable materials, attendance and progress, instalment balances, and threaded messaging with instructors. Oreo runs here too, scoped so a student can only ever see their own data.

Operations admin

Next.js · MUI · Recharts · TanStack Query

The console the academy is run from: courses, modules and schedule instances; registrations, enrolments, payments and instalment tracking; assignment authoring, scheduling and grading; recordings and materials; webinars; email campaigns against stored templates; the job feed; and full RBAC administration over roles, permissions and per-user grants. Every destructive action routes through a confirmation dialog that names the row being removed — a convention enforced across the codebase rather than left to each author.

Core API

TypeScript · Express 4 · MongoDB · Cloudinary

Around 44 Mongoose models with soft deletes, slug generation and junction tables for the many-to-many relations between courses, modules, materials, recordings and schedules. RBAC is roles-to-permissions resolved per request. Email ships behind a pluggable provider interface (ZeptoMail, SendGrid or Nodemailer) so the transport can change without touching callers. It also exposes the internal, service-key-gated endpoint that serves Oreo's tool catalogue and executes its tool calls, which is what keeps query logic in one place instead of being reimplemented in Python.

Automation service

Python 3.12 · FastAPI · MongoDB · Claude

Everything that must happen outside a request. The recording pipeline watches Google Drive for new class recordings, matches each file to a class by folder and to a session by calendar proximity, exports the transcript, labels the topic with a cheap model, renames and moves the file, then notifies the cohort over Slack and WhatsApp. Alongside it: transcription, meeting-minutes and attendance extraction, video compression with its own queue and sweep, payment-amount extraction, a stray-file detector, the weekly digest, job classification for the daily job feed, and the crawl-embed-index-search pipeline behind RAG site search.

Oreo — the agentic assistant

Tool-calling agent · 4 audience catalogues · LLM judge

A bounded pick-and-execute loop that returns an answer, the supporting data, and an audit trail of which tools ran, logged per question with the asker, the tools used and the timing. Four audiences get four catalogues — 25 admin tools plus separate instructor, student and public sets — and the public persona switches voice between a general visitor and someone being advised on a course. A separate judge model then checks the answer against the tool results before it ships, because the agent that wrote an answer is the wrong judge of its own work.

Key Highlights

  • Built Oreo as a tool-calling agent with four audience-scoped catalogues, running a bounded pick-and-execute loop that returns an answer, its supporting data, and an audit trail of which tools ran
  • Made the security boundary structural: the caller's identity comes from a signed subject token minted and verified by the Node API and injected server-side, so the model supplies arguments but can never supply an identity — a student physically cannot reach another student's records
  • Kept the tool catalogue in the API rather than the Python service, so the agent's choices execute against the same query services the rest of the platform uses and no query logic is duplicated
  • Added a post-generation judge: a separate fast model checks the answer against the tool results and rewrites it if it is not grounded, deliberately a fresh context rather than self-critique by the model that just produced it
  • Built RAG site search as a crawl → embed → index → retrieve pipeline, with batched embeddings to keep round-trips down during a full re-crawl
  • Shipped the automated recording pipeline end to end: watch Google Drive, match a recording to its class and session, transcribe it, label the topic with an LLM, then rename, move, and notify — plus meeting-minutes and attendance extraction
  • Added token-level cost governance — per-admin monthly caps with usage visibility, and a separate global daily ceiling on the unauthenticated public widget
  • Extended Oreo to Slack, Telegram, Messenger and Instagram, logging the source channel separately from the audience because a Telegram turn and a widget turn are the same persona but different budgets

Technical Challenges

The decision I think about most is where the two budget paths disagree. Authenticated usage fails open: a monitoring blip shouldn't lock an admin out of a tool they're paying for. The public widget fails closed, because there is no user to key a bucket on, nothing stops one script from looking like a thousand visitors, and the failure mode is an uncapped LLM endpoint exposed to the internet. A budget we can't read is treated as a budget already spent. The second lesson was in error text: when the agent called a tool that hadn't shipped yet, a bare "unknown tool" made it apologise to the visitor, so the errors are now written to steer the model — they name what is available and tell it to call one of those instead. The third is that broadcast is not a feature you default on: the job digest posts to every cohort channel at once and there is no unsend, so it stays behind a flag and its endpoint dry-runs unless told otherwise.