AI STUDY BUDDY CHATBOT - DIRECTORY STRUCTURE GUIDE
==================================================

This document explains the directory structure and purpose of each component in the AI Study Buddy Chatbot application.

ROOT DIRECTORY
==============
AI-Study-Buddy-Chatbot/
├── Backend/                    # Node.js/Express backend server
├── public/                     # Static assets for React app
├── src/                        # React frontend source code
├── package.json                # Frontend dependencies and scripts
├── package-lock.json           # Frontend dependency lock file
├── tsconfig.json              # TypeScript configuration
├── README.md                  # Main project documentation
└── SETUP_GUIDE.md            # Setup instructions

Backend DIRECTORY (/Backend)
============================
Backend/
├── config/
│   └── firebase.js           # Firebase configuration and initialization
├── middleware/
│   └── auth.js               # JWT authentication middleware
├── models/                    # Database models (MongoDB/Mongoose)
│   ├── Goal.js               # Study goal data model
│   ├── Quiz.js               # Quiz data model
│   ├── QuizAttempt.js        # Quiz attempt tracking model
│   ├── Reminder.js           # Reminder data model
│   ├── Session.js            # Study session data model
│   ├── Streak.js             # Streak tracking model
│   └── User.js               # User data model
├── routes/                    # API route handlers
│   ├── auth.js               # Authentication routes (login, register, etc.)
│   ├── goals.js              # Goal management routes
│   ├── quizzes.js            # Quiz-related routes
│   ├── reminders.js          # Reminder management routes
│   ├── sessions.js           # Study session routes
│   └── streaks.js            # Streak tracking routes
├── utils/                     # Utility functions
│   ├── jwt.js                # JWT token utilities
│   └── pdfGenerator.js       # PDF generation utilities
├── server.js                  # Main Express server file
├── updateSessionSubjects.js   # Session subject update utility
├── package.json              # Backend dependencies
└── package-lock.json         # Backend dependency lock file

FRONTEND DIRECTORY (/src)
=========================
src/
├── components/                # React components
│   ├── Auth.css              # Authentication component styles
│   ├── Chat.css              # Chat interface styles
│   ├── Chat.tsx              # Main chat component with AI
│   ├── Dashboard.css          # Dashboard component styles
│   ├── Dashboard.tsx          # Main dashboard component
│   ├── FlashcardGenerator.css # Flashcard generator styles
│   ├── FlashcardGenerator.tsx # Flashcard creation component
│   ├── GoalOverlay.css       # Goal overlay modal styles
│   ├── GoalOverlay.tsx       # Goal overlay component
│   ├── GoalSetting.css       # Goal setting component styles
│   ├── GoalSetting.tsx       # Goal management component
│   ├── Login.tsx             # Login form component
│   ├── PasswordReset.tsx     # Password reset component
│   ├── Profile.css           # Profile component styles
│   ├── Profile.tsx           # User profile component
│   ├── ProtectedRoute.tsx    # Route protection component
│   ├── Register.tsx          # Registration form component
│   ├── ReminderSettings.css  # Reminder settings styles
│   ├── ReminderSettings.tsx  # Reminder configuration component
│   ├── SessionAnalytics.css  # Session analytics styles
│   ├── SessionAnalytics.tsx  # Study session analytics
│   ├── SessionHistory.css    # Session history styles
│   ├── SessionHistory.tsx    # Study session history
│   ├── SessionSidebar.css    # Session sidebar styles
│   ├── SessionSidebar.tsx    # Session navigation sidebar
│   ├── StreakTracker.css     # Streak tracker styles
│   ├── StreakTracker.tsx     # Streak tracking component
│   └── testlogin.jsx         # Test login component
├── contexts/                  # React context providers
│   └── AuthContext.tsx       # Authentication context
├── hooks/                     # Custom React hooks
│   └── usePageTitle.ts       # Page title management hook
├── lib/                       # Library configurations
│   └── firebase.js           # Frontend Firebase configuration
├── services/                  # API service functions
│   ├── apiService.ts         # General API service functions
│   ├── authService.ts        # Authentication service
│   ├── chatbotService.ts     # AI chatbot service
│   ├── reminderService.ts    # Reminder management service
│   ├── streakService.ts      # Streak tracking service
│   ├── taggingService.ts     # Content tagging service
│   └── timeTrackingService.ts # Time tracking service
├── App.css                    # Main app styles
├── App.test.tsx              # App component tests
├── App.tsx                    # Main React app component
├── index.css                  # Global styles
├── index.tsx                  # React app entry point
├── logo.svg                   # App logo
├── react-app-env.d.ts        # React app type definitions
├── reportWebVitals.ts        # Performance monitoring
└── setupTests.ts             # Test setup configuration

PUBLIC DIRECTORY (/public)
==========================
public/
├── favicon.ico               # Browser favicon
├── index.html                # Main HTML template
├── logo192.png              # App logo (192px)
├── logo512.png              # App logo (512px)
├── manifest.json             # PWA manifest file
└── robots.txt               # Search engine robots file

KEY FEATURES BY COMPONENT
=========================

AUTHENTICATION & USER MANAGEMENT
- Login.tsx, Register.tsx, PasswordReset.tsx: User authentication
- AuthContext.tsx: Global authentication state management
- Profile.tsx: User profile management

GOAL MANAGEMENT
- GoalSetting.tsx: Create, edit, delete, and track study goals
- GoalOverlay.tsx: Modal for goal creation/editing
- Features: Goal progress tracking, reset functionality, priority levels

STUDY SESSIONS
- Dashboard.tsx: Main study interface
- SessionSidebar.tsx: Navigation between study sessions
- SessionHistory.tsx: View past study sessions
- SessionAnalytics.tsx: Analyze study patterns and progress

AI CHATBOT
- Chat.tsx: AI-powered study assistant
- chatbotService.ts: Handles AI interactions and responses

FLASHCARDS
- FlashcardGenerator.tsx: Create and manage study flashcards

PROGRESS TRACKING
- StreakTracker.tsx: Track study streaks and consistency
- ReminderSettings.tsx: Configure study reminders

TECHNOLOGY STACK
================
Frontend:
- React 18 with TypeScript
- CSS for styling
- Firebase for authentication
- Custom hooks and context for state management

Backend:
- Node.js with Express
- MongoDB with Mongoose
- JWT for authentication
- Firebase integration

Development:
- TypeScript for type safety
- ESLint for code quality
- React testing utilities

This structure follows a modular architecture with clear separation of concerns between frontend and backend, making the codebase maintainable and scalable. 