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.
๐ Explore the live version here: AI Study Mentor Deployment *
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:
- Interactive AI Roadmaps: Customized paths for multiple skill levels and subjects.
- Context-Aware AI Mentor: A dedicated chatbot powered by advanced LLMs that is aware of your study goals and assists you in real-time.
- Goal & Milestone Tracking: Break down complex topics into atomic, trackable milestones.
- Visual Analytics: Interactive dashboards showing progress over time using data visualization.
- ๐ 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.tssystem 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.
- Core Framework: Next.js 16 (App Router, Server Actions, Client Components)
- Programming Language: TypeScript
- UI & Styles: Tailwind CSS v4, next-themes (Theme Provider), Lucide React (Icons), React Icons
- Authentication: Better-Auth v1.6 (with MongoDB Client Adapter)
- Mailing Support: Nodemailer
- Live Widgets: Tawk.to Live Chat, Google Translate Widget
- Animations: Framer Motion v12
- Data Fetching & State: TanStack Query v5
- Forms & Validation: React Hook Form, Zod Schema Validation
- Charts & Visuals: Recharts
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/loginand/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]
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
Follow these steps to run the frontend application locally:
-
Clone the repository:
git clone https://github.com/your-username/ai-study-mentor.git cd ai-study-mentor/client -
Install the dependencies:
npm install
-
Configure Environment Variables: Create a
.envfile in the root of theclientdirectory:cp .env.example .env
Fill in your MongoDB connection details, Better-Auth secrets, and Google credentials.
-
Run the local development server:
npm run dev
-
Open the browser: Navigate to http://localhost:3000 to view the application.
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_hereInside 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.
The application's authentication architecture utilizes Better-Auth for secure session handling:
- Sign-up / Login: Users register or log in using email credentials (validated client-side via Zod).
- Social OAuth (Google): Direct social integration using Google authentication.
- Session Verification: A JWT-based cookie cache strategy is maintained securely inside user headers.
- Token Resolution: The backend extracts session tokens server-side using a utility called
BetterAuthTokento retrieve details fast.
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.
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.
- 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.
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.
- 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.
- Secure Proxies: Protects administrative routes on the server network level using the new Next.js 16
proxy.tsconvention, 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.
- 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 will be added upon deployment)
| Public Home Landing | AI Mentor Chat | Student Analytics Dashboard |
|---|---|---|
![]() |
![]() |
![]() |
Your Name
- GitHub: @your-username
- LinkedIn: Your Profile
This project is licensed under the MIT License - see the LICENSE file for details.
