Skip to content

Tharsan2/codestorm_ai

Repository files navigation

AI Study Helper - Codestorm AI Competition

A comprehensive AI-powered study assistant that transforms handwritten notes, textbook pages, and diagrams into interactive learning materials. Built for the Codestorm AI Competition Final Round.

🚀 Features

Core Functionality

  • Image Upload & OCR: Upload photos of handwritten notes, textbook pages, or diagrams with automatic text extraction using Tesseract.js
  • AI Content Analysis: Generate summaries and explanations using OpenAI GPT-4o
  • Interactive Quiz Generation: Auto-generated MCQs, short answer questions, and flashcards
  • AI Chat Assistant: Contextual chat interface that references your uploaded study materials
  • User Authentication: Secure user accounts with email verification via Supabase

Innovative Features

  • Steganography Detection: Advanced image analysis to detect hidden data using LSB analysis, statistical analysis, and bit plane analysis
  • Real-time Processing: Live status updates during image processing and analysis
  • Responsive Design: Modern, clean interface optimized for students

🛠 Technology Stack

  • Frontend: Next.js 15, React, TypeScript, Tailwind CSS
  • Backend: Next.js API Routes, Supabase (PostgreSQL)
  • AI/ML: OpenAI GPT-4o, Tesseract.js OCR
  • Storage: Vercel Blob for image storage
  • Authentication: Supabase Auth with Row Level Security
  • Deployment: Vercel

📋 Prerequisites

  • Node.js 18+ and npm
  • Supabase account and project
  • OpenAI API key
  • Vercel account (for deployment)

🔧 Environment Variables

Create a .env.local file with the following variables:

```env

Supabase

NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key

OpenAI

OPENAI_API_KEY=your_openai_api_key

Vercel Blob

BLOB_READ_WRITE_TOKEN=your_blob_token

Development redirect URL (optional)

NEXT_PUBLIC_DEV_SUPABASE_REDIRECT_URL=http://localhost:3000/protected ```

🚀 Quick Start

  1. Clone and Install ```bash git clone cd ai-study-helper npm install ```

  2. Database Setup

    • Run the SQL scripts in the scripts/ folder in your Supabase SQL editor:
      • 001_create_database_schema.sql
      • 002_create_profile_trigger.sql
  3. Environment Configuration

    • Copy .env.example to .env.local
    • Fill in your API keys and database URLs
  4. Development ```bash npm run dev ``` Open http://localhost:3000

  5. Production Deployment

    • Deploy to Vercel with one click
    • Environment variables are automatically configured via integrations

📊 Database Schema

The application uses the following main tables:

  • profiles - User profile information
  • study_sessions - Study session management
  • uploaded_images - Image metadata and extracted text
  • ai_content - Generated summaries, explanations, and quizzes
  • chat_messages - Chat conversation history

All tables are protected with Row Level Security (RLS) policies.

🔒 Security Features

  • Row Level Security: All database operations are user-scoped
  • Authentication: Email verification required
  • File Validation: Image type and size restrictions
  • Steganography Detection: Identifies potentially malicious hidden content

🎯 Competition Evaluation Criteria

This application addresses all competition requirements:

Core Features ✅

  • Photo Upload: Drag & drop interface with multiple file support
  • Text Extraction: OCR using Tesseract.js with support for various handwriting qualities
  • AI Summaries: Concise, student-friendly content summaries
  • Explanations: Concept clarifications in simple language
  • Quiz Generation: MCQs, short answers, and flashcards

Input Handling ✅

  • Handwritten Notes: Clear and messy handwriting support
  • Textbook Pages: Dense text and highlighted content
  • Diagrams: Labeled diagrams with text extraction
  • Mixed Quality: Tilted, low-resolution, and cropped images
  • Real-world Scenarios: Classroom notes, textbook scanning, quick captures

Innovation ✅

  • Steganography Detection: Advanced security feature using multiple analysis techniques
  • Interactive Chat: AI assistant with context from uploaded materials
  • Real-time Processing: Live status updates and streaming responses
  • Comprehensive Analytics: Detailed analysis results and confidence scoring

🏆 Deployment

The application is deployed and accessible at: https://ai-study-helper.vercel.app

Deployment Features

  • Zero-config deployment on Vercel
  • Automatic HTTPS and global CDN
  • Environment variable management via Vercel dashboard
  • Database integration with Supabase
  • File storage with Vercel Blob

📱 Usage Guide

  1. Sign Up: Create an account with email verification
  2. Upload Images: Drag & drop or select study material photos
  3. AI Processing: Wait for automatic text extraction and analysis
  4. Review Content: Read generated summaries and explanations
  5. Take Quizzes: Test understanding with auto-generated questions
  6. Chat Assistant: Ask questions about your materials
  7. Security Check: Review steganography detection results

🔍 Steganography Detection

The innovative steganography detection feature uses multiple analysis techniques:

  • LSB Analysis: Examines least significant bits for hidden patterns
  • Statistical Analysis: Chi-square tests and pixel correlation analysis
  • Bit Plane Analysis: Complexity analysis across different bit planes
  • Confidence Scoring: Provides detection confidence percentage
  • Detailed Reports: Technical analysis with visual indicators

🤝 Contributing

This project was built for the Codestorm AI Competition. For questions or feedback, please contact the development team.

📄 License

This project is created for educational purposes as part of the Codestorm AI Competition.


Built with ❤️ for the Codestorm AI Competition Final Round

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages