GitHunt
AA

aakashsharma7/AI-Tutor

A powerful AI-powered educational tutoring system that helps students learn and understand various topics through interactive sessions.

๐Ÿš€ AI Tutor Application

A powerful AI-powered educational tutoring system that helps students learn and understand various topics through interactive sessions.

๐Ÿ“‹ Table of Contents

๐ŸŒŸ Overview

AI Tutor is an educational platform that leverages artificial intelligence to provide personalized tutoring experiences. The application consists of a modern frontend built with React and a robust backend powered by FastAPI.

โœจ Features

  • ๐Ÿ” Secure authentication with JWT and Google OAuth
  • ๐Ÿค– AI-powered tutoring sessions
  • ๐Ÿ“ Document analysis and assistance
  • ๐Ÿ’ฌ Interactive learning experience
  • ๐Ÿ“ฑ Responsive design for all devices
  • ๐Ÿ”„ Real-time updates and caching

๐Ÿ› ๏ธ Tech Stack

Frontend

  • โš›๏ธ React.js
  • ๐ŸŽจ Tailwind CSS
  • ๐Ÿ”„ Redux for state management
  • ๐Ÿ“ฑ Responsive design
  • ๐Ÿ”’ JWT authentication

Backend

  • ๐Ÿ Python
  • โšก FastAPI
  • ๐Ÿ—„๏ธ SQLAlchemy
  • ๐Ÿ” JWT & OAuth2
  • ๐Ÿค– Google Gemini AI
  • ๐Ÿ“ฆ PostgreSQL

๐Ÿ“ Project Structure

ai-tutor/
โ”œโ”€โ”€ frontend/                 # Frontend React application
โ”‚   โ”œโ”€โ”€ public/              # Static files
โ”‚   โ”œโ”€โ”€ src/                 # Source files
โ”‚   โ”‚   โ”œโ”€โ”€ components/      # React components
โ”‚   โ”‚   โ”œโ”€โ”€ pages/          # Page components
โ”‚   โ”‚   โ”œโ”€โ”€ services/       # API services
โ”‚   โ”‚   โ”œโ”€โ”€ store/          # Redux store
โ”‚   โ”‚   โ””โ”€โ”€ utils/          # Utility functions
โ”‚   โ””โ”€โ”€ package.json        # Frontend dependencies
โ”‚
โ””โ”€โ”€ backend/                 # Backend FastAPI application
    โ”œโ”€โ”€ alembic/            # Database migrations
    โ”œโ”€โ”€ migrations/         # Migration versions
    โ”œโ”€โ”€ app.py             # Main application file
    โ”œโ”€โ”€ models.py          # Database models
    โ”œโ”€โ”€ schemas.py         # Pydantic schemas
    โ”œโ”€โ”€ database.py        # Database configuration
    โ””โ”€โ”€ requirements.txt   # Backend dependencies

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • Python (v3.8 or higher)
  • PostgreSQL

Frontend Setup

cd frontend
npm install
npm start

Backend Setup

cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app:app --reload

๐Ÿ”‘ Environment Variables

Frontend (.env)

REACT_APP_API_URL=http://localhost:8000
REACT_APP_GOOGLE_CLIENT_ID=your_google_client_id

Backend (.env)

DATABASE_URL=postgresql://user:password@localhost:5432/ai_tutor
SECRET_KEY=your_secret_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GEMINI_API_KEY=your_gemini_api_key
FRONTEND_URL=http://localhost:3000

๐Ÿ“š API Documentation

The API documentation is available at /docs when running the backend server. Key endpoints include:

  • ๐Ÿ” /token - Authentication endpoint
  • ๐Ÿ‘ค /users/me - Get current user info
  • ๐ŸŽ“ /tutor - AI tutoring endpoint
  • ๐Ÿ“ค /upload - Document upload and analysis
  • ๐Ÿ” /health - Health check endpoint

๐Ÿš€ Deployment

Frontend Deployment (Vercel)

cd frontend
vercel

Backend Deployment

cd backend
# Configure your production environment variables
uvicorn app:app --host 0.0.0.0 --port 8000

๐Ÿ“ License

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

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.