Skip to content

Latest commit

ย 

History

102 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– AI Kids Academy

Next.js React TypeScript Tailwind CSS Drizzle ORM PostgreSQL Auth.js Claude

Where kids ages 4โ€“16 don't just use AI โ€” they make with it. ๐ŸŽจ๐Ÿ’ป๐ŸŽฎ

AI storytelling ยท coding ยท game design ยท phonics ยท escape rooms โ€” a gamified learning playground plus live class booking for parents.

๐Ÿš€ Live Site ยท Report Bug ยท Request Feature

Screenshots

Homepage Kids' Dashboard Kid Login
Story Builder Talking Buddy AI Art Studio
AI Phonics AI Escape Rooms Brain Arcade

About

AI Kids Academy is a kids' AI education portal that combines a gamified learning playground with a class-booking platform for parents. Children log in to their own colourful dashboard to play AI-powered activities and earn points and badges; parents browse programs, book classes online, and track their kids' progress; admins manage the whole catalogue from a back-office.

Key Features

Area What it does
๐ŸŽญ Three roles Learners (kids) log in with a username + password; Parents & Admins sign in with Google (or credentials). Each role lands on its own dashboard.
๐Ÿงฉ AI activities Seven play-at-home games in the kid playground: Story Builder (branching, AI-illustrated tales + "write your own"), AI Phonics (listen-and-match), Talking Buddy (voice/text AI chat), AI Art Studio (paint an idea, then jigsaw it), Code Puzzles, AI Escape Rooms and Brain Arcade card games โ€” each awarding points and badges.
๐Ÿ† Gamification Every activity awards a score; kids collect badges and climb an opt-in leaderboard.
๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง Parent dashboard Link multiple kids, see activities completed, total scores, badges, and recent activity per child.
๐Ÿ“… Online booking Parents book a class seat for a child in seconds.
๐Ÿ’ณ PayNow payments On confirmation, the system generates a dynamic Singapore PayNow QR (EMVCo SGQR) and emails it to the parent.
๐Ÿค– Agentic auto-close When a class hits its max students it auto-closes and an AI routine drafts the "class full" notifications for parents + admin.
๐Ÿ› ๏ธ Admin back-office Manage programs, classes (open/close/edit/delete), bookings (confirm / mark-paid / cancel), and kidโ†”parent links.
๐Ÿ’ฌ WhatsApp Floating click-to-chat button for instant parent enquiries.

Tech Stack

Category Technologies
Framework Next.js 16 (App Router, Server Actions), React 19
Language TypeScript 5
Styling Tailwind CSS 4 (bright kids theme + dark admin theme), Framer Motion, Fredoka / Nunito fonts
Database PostgreSQL 16 + Drizzle ORM
Auth Auth.js v5 (Credentials + Google OAuth), JWT sessions, role-based access
AI/LLM Claude Agent SDK (CMS chatbot, admin AI Assist, agentic class-close) ยท Google Gemini for the kids-games text & chat ยท NVIDIA FLUX + Cloudflare Flux for kid-safe image generation
Payments PayNow QR generation (EMVCo SGQR via qrcode)
Email Gmail OAuth (transactional booking emails)
Security bcrypt password hashing, AES-256-GCM encrypted credential store

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         Browser (clients)                        โ”‚
โ”‚   Public site  ยท  Kid playground  ยท  Parent dash  ยท  Admin CMS   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚  Next.js App Router (RSC + Server Actions)         
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Auth.js v5 (role guard: learner / parent / admin)                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  Booking +   โ”‚  AI activities โ”‚  Gamification โ”‚  Admin CRUD   โ”‚ โ”‚
โ”‚  โ”‚  PayNow QR   โ”‚  (Claude SDK)  โ”‚  scores/badge โ”‚  programs/... โ”‚ โ”‚
โ”‚  โ”‚  + agentic   โ”‚                โ”‚  leaderboard  โ”‚               โ”‚ โ”‚
โ”‚  โ”‚  auto-close  โ”‚                โ”‚               โ”‚               โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚               โ”‚               โ”‚              โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ PostgreSQL  โ”‚  โ”‚ Claude     โ”‚  โ”‚  Gmail     โ”‚ โ”‚  PayNow QR  โ”‚
   โ”‚ (Drizzle)   โ”‚  โ”‚ Agent SDK  โ”‚  โ”‚  OAuth     โ”‚ โ”‚  (SGQR)     โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Project Structure

ai-kids/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx                 # Bright public homepage
โ”‚   โ”‚   โ”œโ”€โ”€ login/                   # Kid + Parent/Admin login tabs
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/               # Role dispatcher
โ”‚   โ”‚   โ”œโ”€โ”€ programs/                # Catalog + program detail
โ”‚   โ”‚   โ”œโ”€โ”€ book/[classId]/          # Booking flow
โ”‚   โ”‚   โ”œโ”€โ”€ parent/                  # Parent dashboard (kids, bookings, add child)
โ”‚   โ”‚   โ”œโ”€โ”€ learn/                   # Kid playground (activities, leaderboard)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ storytelling/        #   Story Builder + write-your-own
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ phonics/             #   listen-and-match phonics games
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ buddy/               #   Talking Buddy (AI voice/text chat)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ art/                 #   AI Art Studio โ†’ jigsaw
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ code-puzzles/        #   robot path puzzles
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ escape-room/         #   top-down escape rooms
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ cards/               #   Brain Arcade card games
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ stories/  gallery/   #   saved storybooks + artwork
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ leaderboard/         #   opt-in scores
โ”‚   โ”‚   โ”œโ”€โ”€ admin/                   # Back-office (programs/classes/bookings/people)
โ”‚   โ”‚   โ””โ”€โ”€ api/learn/               # Activity APIs (storytelling, phonics, buddy, art, cards, story-image, score)
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ public/                  # SiteHeader, SiteFooter
โ”‚   โ”‚   โ”œโ”€โ”€ portal/                  # SignOutButton, shared portal UI
โ”‚   โ”‚   โ””โ”€โ”€ ui/                      # WhatsAppButton, ...
โ”‚   โ”œโ”€โ”€ db/schema.ts                 # Drizzle schema (programs, classes, bookings, โ€ฆ)
โ”‚   โ””โ”€โ”€ lib/
โ”‚       โ”œโ”€โ”€ auth.ts / portal-session.ts   # Auth + role guards
โ”‚       โ”œโ”€โ”€ paynow.ts                # EMVCo SGQR QR generator
โ”‚       โ”œโ”€โ”€ booking.ts               # Confirm โ†’ PayNow email โ†’ agentic auto-close
โ”‚       โ”œโ”€โ”€ ai.ts                    # Claude Agent SDK wrapper (with fallbacks)
โ”‚       โ”œโ”€โ”€ activities.ts            # Completions + badge awards
โ”‚       โ””โ”€โ”€ portal-queries.ts        # Dashboard + leaderboard queries
โ”œโ”€โ”€ scripts/seed-portal.ts           # Seeds admin, demo parent + kids, programsโ€ฆ
โ”œโ”€โ”€ drizzle/                         # SQL migrations
โ””โ”€โ”€ .env.example

Getting Started

Prerequisites

  • Node.js 22+
  • PostgreSQL 16 (local or hosted, e.g. Neon/Supabase)

Installation

# 1. Clone
git clone https://github.com/alfredang/ai4kids.git
cd ai4kids

# 2. Install (claude-agent-sdk needs legacy peer resolution)
npm install --legacy-peer-deps

# 3. Configure environment
cp .env.example .env
#   set DATABASE_URL, AUTH_SECRET (openssl rand -base64 32),
#   GOOGLE_CLIENT_ID/SECRET, ADMIN_EMAIL/PASSWORD, PAYNOW_UEN, WHATSAPP_NUMBER

# 4. Create the schema  (db:push is broken on local PG 18 โ€” generate + migrate instead)
createdb ai_kids
npm run db:generate       # generate a migration from src/db/schema.ts
npm run db:migrate        # apply it

# 5. Seed demo data (admin, parent, kids, programs, classes, activities)
npm run seed:portal

# 6. Run
npm run dev               # http://localhost:3080

Demo logins (from the seed)

Role Login
Admin admin@โ€ฆ / your ADMIN_PASSWORD โ€” at /admin/login
Parent parent.demo@aikids.local / parent123
Kids maya-star / play123 ยท ethan-rocket / play123

Enabling the AI + email integrations

The app works fully offline with graceful fallbacks. To go live, add credentials in Admin โ†’ Settings โ†’ Credentials (encrypted store):

  • anthropic_auth_token (an sk-ant-oat-โ€ฆ subscription token) โ€” powers AI stories, phonics word-sets and the agentic class-close. Without it, deterministic fallback content is used.
  • Gmail OAuth (gmail_user, gmail_client_id, gmail_client_secret, gmail_refresh_token) โ€” sends the PayNow booking emails. Without it, the QR still renders in the parent dashboard.

Deployment

Built output: "standalone" โ€” deploy as a Docker container (Coolify / Railway / Fly.io) or to Vercel + Neon/Supabase Postgres.

docker build -t ai-kids .
docker run -p 3080:3080 --env-file .env ai-kids

Set DATABASE_URL, AUTH_SECRET, AUTH_URL, NEXT_PUBLIC_SITE_URL, and Google OAuth env vars in your hosting platform.

Contributing

  1. Fork the repo
  2. Create a feature branch: git checkout -b feature/amazing
  3. Commit your changes: git commit -m "feat: add amazing"
  4. Push and open a Pull Request

Developed By

Tertiary Infotech Academy Pte. Ltd.

Acknowledgements


โญ If this project sparked some curiosity, give it a star!

About

๐Ÿค– AI Kids Academy โ€” a kids' AI learning portal (ages 4โ€“16): gamified AI storytelling, coding, game-dev, phonics & escape rooms, plus parent class booking with PayNow. Next.js 16 + Drizzle + Postgres + Auth.js + Claude.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages