Skip to content

About

An intelligent, interactive, and personalized educational study platform built using Next.js 16 (App Router), TypeScript, and Tailwind CSS. The client provides users with interactive study plans, detailed progress tracking analytics, structured roadmap exploration, and a custom real-time AI Study Mentor chatbot.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

35 Commits

Folders and files

Repository files navigation

๐ŸŽ“ AI Study Mentor โ€” Client Frontend

Next.js TypeScript React Tailwind CSS TanStack Query Better-Auth License

An intelligent, interactive, and personalized educational study platform built using Next.js 16 (App Router), TypeScript, and Tailwind CSS. The client provides users with interactive study plans, detailed progress tracking analytics, structured roadmap exploration, and a custom real-time AI Study Mentor chatbot.


๐Ÿ”— Live Demo

๐Ÿš€ Explore the live version here: AI Study Mentor Deployment *


๐Ÿ“‹ Project Overview

AI Study Mentor is a full-stack platform designed to revolutionize the way students and professionals learn. Self-studying is often overwhelming due to a lack of structure and immediate guidance. This frontend client addresses these problems by providing:

  1. Interactive AI Roadmaps: Customized paths for multiple skill levels and subjects.
  2. Context-Aware AI Mentor: A dedicated chatbot powered by advanced LLMs that is aware of your study goals and assists you in real-time.
  3. Goal & Milestone Tracking: Break down complex topics into atomic, trackable milestones.
  4. Visual Analytics: Interactive dashboards showing progress over time using data visualization.

โœจ Key Features

  • ๐Ÿ” Secure Session Management: Email & Password signup/login alongside Google Social OAuth login powered by Better-Auth.
  • ๐ŸŽจ Monochrome Theme System: Fully integrated dark and light mode switching based on a premium monochrome color palette (#FEFEFE / #1B1B1B) with no color accents except real WhatsApp green for support.
  • ๐Ÿ’ฌ Real-time Support Chat: Integrated live chat assistance widget powered by Tawk.to (functional cookie consent guarded).
  • ๐ŸŒ Dual-Language translation: Fully customized language toggler powered by Google Website Translator with soft DOM patches for seamless React runtime compatibility.
  • โœ‰๏ธ Contact Form Mailer: Double-reply mailing notifications powered by Nodemailer (transmits visitor inquiry emails to admin and delivers confirmation templates to users).
  • ๐Ÿ“ฑ WhatsApp Quick Connect: Floating support contact integration with custom message payload templates.
  • ๐Ÿ› ๏ธ Next.js 16 Proxy Security: Protected route boundary patterns using the new Next.js 16 proxy.ts system to safeguard private user dashboards.
  • ๐Ÿ—บ๏ธ Roadmap Hub: Dynamic filters for finding roadmaps based on duration, category, difficulty, or search terms.
  • ๐Ÿ’ฌ Goal-Context Chat: Real-time chat with the AI Study Mentor where the AI understands the exact goal you are working on.
  • ๐Ÿ“Š Progress Analytics: Modern charts mapping completed goals, target hours, and milestone metrics.
  • ๐ŸŒ€ Micro-interactions: Rich animations and transition states using Framer Motion.
  • ๐Ÿ“‹ Robust Validation: Forms protected by React Hook Form combined with Zod schema validations.

๐Ÿ› ๏ธ Technologies Used


๐Ÿ—๏ธ Project Architecture (Frontend)

The frontend utilizes Next.js's modern App Router layout. It separates layouts to optimize performance and keep code dry:

  • Common Layout ((withCommonLayout)): Contains public routes like /about, /blog, /contact, and /explore-roadmaps, wrapping them with the global public Navigation Bar and Footer.
  • Dashboard Layout ((withDashboardLayout)): Houses protected endpoints (e.g. /dashboard, /dashboard/chat) wrapped in a sticky sidebar navigation context.
  • Auth Routes ((auth)): Provides dedicated pages for /login and /register.
  • Proxy Boundary (proxy.ts): Sits directly on the server boundary to parse incoming cookies and header states, filtering out requests to /dashboard/* when unauthenticated.
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Next.js Client                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ–ผ                           โ–ผ
   [Public/Common Routes]      [Protected Dashboard]
     - Home (/), About           - Analytics, Goals
     - Explore Roadmaps          - AI Mentor Chat
             โ”‚                           โ”‚
             โ”‚             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ”‚             โ–ผ                           โ–ผ
             โ”‚       (Proxy Pass)               (Proxy Redirect)
             โ”‚             โ”‚                           โ”‚
             โ–ผ             โ–ผ                           โ–ผ
     [Render Content]   [Render Dashboard]      [Redirect to Login]

๐Ÿ“‚ Folder Structure

Below is an overview of the key directories within client/src:

src/
โ”œโ”€โ”€ app/                        # Next.js App Router Page hierarchy
โ”‚   โ”œโ”€โ”€ (auth)/                 # Login, Registration layouts and pages
โ”‚   โ”œโ”€โ”€ (withCommonLayout)/     # Pages sharing Navbar & Footer (Public)
โ”‚   โ”‚   โ”œโ”€โ”€ explore-roadmaps/   # Roadmap listing page
โ”‚   โ”‚   โ””โ”€โ”€ page.tsx            # Main Landing page
โ”‚   โ”œโ”€โ”€ (withDashboardLayout)/  # Protected Pages (Dashboard, Settings, Analytics)
โ”‚   โ”‚   โ””โ”€โ”€ dashboard/          # Nested dashboard sub-pages
โ”‚   โ”‚       โ”œโ”€โ”€ chat/           # Goal-oriented AI Mentor chat screen
โ”‚   โ”‚       โ””โ”€โ”€ goals/          # User goals management
โ”‚   โ”œโ”€โ”€ api/                    # API Route Handlers (e.g. Auth catch-all)
โ”‚   โ”œโ”€โ”€ unauthorized/           # Forbidden redirect fallback page
โ”‚   โ”œโ”€โ”€ globals.css             # Tailwind v4 import & Custom tokens
โ”‚   โ””โ”€โ”€ layout.tsx              # Root HTML wrapper
โ”œโ”€โ”€ components/                 # Reusable React components
โ”‚   โ”œโ”€โ”€ dashboard/              # Specific components for study portal dashboard
โ”‚   โ”œโ”€โ”€ home/                   # Components specific to the public landing page
โ”‚   โ”œโ”€โ”€ shared/                 # Universal shared layouts (Cards, Skeletons)
โ”‚   โ””โ”€โ”€ ui/                     # Tiny building blocks (Buttons, Inputs, Modals)
โ”œโ”€โ”€ lib/                        # Core helpers, clients, and API configuration
โ”‚   โ”œโ”€โ”€ actions/                # Server Actions (auth, chat form submittals)
โ”‚   โ”œโ”€โ”€ api/                    # Client API calls targeting backend services
โ”‚   โ”œโ”€โ”€ core/                   # Server side auth token grabbers
โ”‚   โ”œโ”€โ”€ auth-client.ts          # Better-Auth browser client initialization
โ”‚   โ”œโ”€โ”€ auth.ts                 # Better-Auth server config & DB Adapter
โ”‚   โ””โ”€โ”€ constants.ts            # Configuration objects, dropdown categories
โ”œโ”€โ”€ proxy.ts                    # Next.js 16 Server-Side Proxy router

๐Ÿ“ฅ Installation

Follow these steps to run the frontend application locally:

  1. Clone the repository:

    git clone https://github.com/your-username/ai-study-mentor.git
    cd ai-study-mentor/client
  2. Install the dependencies:

    npm install
  3. Configure Environment Variables: Create a .env file in the root of the client directory:

    cp .env.example .env

    Fill in your MongoDB connection details, Better-Auth secrets, and Google credentials.

  4. Run the local development server:

    npm run dev
  5. Open the browser: Navigate to http://localhost:3000 to view the application.


๐Ÿ”’ Environment Variables (.env.example)

The frontend application requires the following environment variables to run correctly. Make sure to define these in your .env file:

# MongoDB connection string for database adapter (Better-Auth backend store)
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<dbname>

# Secret key for better-auth (generate a secure random string)
BETTER_AUTH_SECRET=your_better_auth_secret_here

# Base URL for the frontend application (for better-auth redirection)
BETTER_AUTH_URL=http://localhost:3000

# Base URL for the external backend API
NEXT_PUBLIC_BASE_URL=http://localhost:5000

# Google Social Auth Credentials
GOOGLE_CLIENT_ID=your_google_client_id_here
GOOGLE_CLIENT_SECRET=your_google_client_secret_here

โš™๏ธ Available Scripts

Inside package.json, the following scripts are defined:

  • npm run dev: Boots the development server with Next.js Turbopack.
  • npm run build: Bundles the client production-ready packages.
  • npm run start: Starts the Next.js application in production mode.
  • npm run lint: Performs lint analysis on your code via ESLint.

๐Ÿ”‘ Authentication Flow

The application's authentication architecture utilizes Better-Auth for secure session handling:

  1. Sign-up / Login: Users register or log in using email credentials (validated client-side via Zod).
  2. Social OAuth (Google): Direct social integration using Google authentication.
  3. Session Verification: A JWT-based cookie cache strategy is maintained securely inside user headers.
  4. Token Resolution: The backend extracts session tokens server-side using a utility called BetterAuthToken to retrieve details fast.

๐Ÿš Main Pages & Routes

Public Pages

  • src/app/(withCommonLayout)/page.tsx: Landing screen with features overview, student statistics, and testimonials.
  • src/app/(withCommonLayout)/explore-roadmaps/page.tsx: Catalog of standard learning roadmaps (e.g. Frontend, Backend, Machine Learning) with custom search and filtering.
  • src/app/unauthorized/page.tsx: Styled landing page explaining why access was blocked, with clear login redirection prompts.

Protected Portal

  • src/app/(withDashboardLayout)/dashboard/page.tsx: Main student portal dashboard presenting ongoing goals, completed tasks, and analytics.
  • src/app/(withDashboardLayout)/dashboard/chat/page.tsx: Conversation interface connecting to the AI Mentor chatbot contextually based on the user's active goal.
  • src/app/(withDashboardLayout)/dashboard/goals/page.tsx: Management page for setting up roadmap milestones, adding items, and updating status.

๐Ÿค– AI Features

  • Context-Aware Study Assistant: Unlike generic chatbots, the AI Mentor Chat targets a specific goal context. Prompt inputs automatically payload the active goal's details, making answers highly personalized.
  • Dynamic Typing Indicators: Provides immediate visual feedback when the AI is processing study requests.
  • Roadmap Integration: Generate, modify, and update custom milestones using intelligent LLM assistance on the backend.

๐Ÿ“ฑ Responsive Design

The entire application has been built from the ground up to support modern viewing devices:

  • Mobile First Navigation: Incorporates clean collapsible mobile drawer navigation on dashboards and responsive headers.
  • Fluid Layouts: Flexbox and CSS Grid adapt layouts from dynamic double columns (large viewports) to stacked viewports (tablets and smartphones).
  • Responsive Charts: The Recharts analytical components automatically auto-scale to their container boundaries.

โšก Performance Optimizations

  • Next.js Turbopack: Utilizes next-gen compilation assets for super fast Hot Module Replacement during development.
  • Framer Motion Optimization: Strict CSS transitions and layout transitions using framer-motion keep browser paint overhead minimal.
  • Debounced Exploration Search: Input fields for roadmaps filter via debounced inputs to reduce redundant API fetches.
  • Optimistic UI Updates: Messages in the AI Mentor Chat appear immediately on user submit before the server API response completes.

๐Ÿ›ก๏ธ Security Considerations

  • Secure Proxies: Protects administrative routes on the server network level using the new Next.js 16 proxy.ts convention, resolving access permissions BEFORE page generation.
  • Form Sanitization: Zod schemas validate forms on the front boundary to ensure no corrupted payloads reach database interfaces.
  • Secure Token Cache: Uses HTTPOnly cookie caching mechanism for active sessions.

๐Ÿ”ฎ Future Improvements

  • Custom AI Roadmap Generation: Let users query the AI to create unique milestones from scratch instead of choosing existing catalog roadmaps.
  • Gamified Streaks: Visual display of daily study accomplishments to encourage student habit building.
  • Collaborative Study Rooms: Real-time peer learning rooms using WebSockets.

๐Ÿ“ธ Screenshots

(Screenshots will be added upon deployment)

Public Home Landing AI Mentor Chat Student Analytics Dashboard
Landing Placeholder Chat Placeholder Analytics Placeholder

๐Ÿ‘ค Author

Your Name


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An intelligent, interactive, and personalized educational study platform built using Next.js 16 (App Router), TypeScript, and Tailwind CSS. The client provides users with interactive study plans, detailed progress tracking analytics, structured roadmap exploration, and a custom real-time AI Study Mentor chatbot.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages