Skip to content

vividron/studysense-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

77 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StudySense AI

πŸ”— Live App: https://studysense-ai.vercel.app

StudySense AI turns your documents into an interactive study space. Upload your notes or any PDF and it generates quizzes to test you. If you get stuck on a question or have a doubt, you can ask the AI directly from the same document. It also provides quick summaries and helps you manage all your study material in one place. Built mainly for students, but works for anyone who wants to learn or remember things faster.

πŸ–₯️ Desktop View

Screenshot 2026-01-24 145616 Screenshot 2026-01-24 145641 Screenshot 2026-01-24 150201 Screenshot 2026-01-24 145753 Screenshot 2026-01-24 145833 Screenshot 2026-01-24 145912

πŸ“± Mobile View

✨ Key Features of StudySense AI

  • 🧠 AI-Powered Quiz Generation: Automatically generate quizzes from your study documents using Gemini AI
  • ❓ Interactive Chat: Ask AI doubts directly from your document to clarify concepts and get explanations
  • πŸ“š Document Summarization: Get AI-generated summaries of your study materials for faster revision
  • πŸ”₯ Quiz Streak System: To build daily study consistency
  • πŸ“Š Quiz Tracking: Track quiz performance and view detailed results
  • πŸ—‚οΈ Activity Dashboard: Monitor your study activity and overall progress
  • πŸ—ƒοΈ Organized Document Hub: Manage and access all uploaded documents in one place
  • πŸ”Ž Semantic Search: Find relevant content using vector-based document search
  • πŸ“± Fully Responsive UI: Smooth experience on desktop and mobile

πŸ› οΈ Tech Stack

Frontend

  • React 19 - UI library
  • Vite - Fast build tool and dev server
  • Tailwind CSS - Utility-first CSS framework
  • React Router - Client-side routing
  • React Hook Form - Form state management
  • Axios - HTTP client
  • React Markdown - Markdown rendering
  • Lucide React - Icon library
  • React Hot Toast - Toast notifications

Backend

  • Node.js - JavaScript runtime
  • Express 5 - Web framework
  • MongoDB - Database
  • Mongoose - MongoDB object modeling
  • Gemini API (Google Generative AI) - LLM for quiz generation, summaries, and Q&A
  • JWT - Authentication
  • Bcrypt - Password hashing
  • Multer - File upload handling
  • PDF-Parse - PDF text extraction

AI & Search

  • Gemini Embedding Model - Vector embeddings generation
  • MongoDB Vector Index - Semantic search and context retrieval
  • RAG (Retrieval Augmented Generation) - Document-based AI responses

Cloud & Storage

  • AWS S3 - Document storage
  • AWS S3 Presigned URLs - Secure, time-limited document access

πŸ’» Local Setup

πŸ“‹ Prerequisites

Before running this application, ensure you have:

  • Node.js (v16 or higher)
  • npm or yarn package manager
  • MongoDB (local or Atlas account)
  • Google Gemini API Key (for AI features)
  • AWS S3 Bucket with credentials (for cloud storage)

Clone the repository:

git clone https://github.com/vividron/studysense-ai.git
cd studysense-ai
# Backend
cd backend
npm install
# Frontend
cd frontend
npm install

Environment Variables

Create a .env file

#frontend
VITE_API_BASE_URL=http://localhost:8000
#backend
FRONTEND_URL=http://localhost:5173
PORT=8000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret

# Gemini
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-2.5-flash-lite
GEMINI_EMBEDDING_API_KEY=your_gemini_embedding_api_key
EMBEDDING_MODEL=gemini-embedding-001

# AWS S3
AWS_BUCKET_NAME=your_s3_bucket_name
AWS_REGION=your_s3_bucket_region
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key

Run the Project

cd backend
npm run dev
cd frontend
npm run dev

πŸ“‘ API Endpoints

Authentication (/api/auth)

  • POST /signup - Register a new user
  • POST /signin - Login user
  • POST /logout - Logout user

Documents (/api/documents)

  • GET / - Get all user documents
  • POST /upload - Upload a new document
  • GET /:id - Get document details
  • DELETE /:id - Delete a document

AI Features (/api/ai)

  • POST /chat - Chat about documents
  • POST /summarize - Generate document summary

Quizzes (/api/quizzes)

  • GET / - Get all quizzes
  • POST /generate - Generate quiz from document
  • GET /:id - Get quiz details
  • POST /:id/submit - Submit quiz answers
  • DELETE /:id - Delete a quiz

Activity (/api/activity)

  • GET / - Get user activity stats
  • GET /streak - Get study streak information

πŸ“ Project Structure

studysense-ai/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/                 # Configuration files
β”‚   β”‚   β”œβ”€β”€ aws.js              # AWS S3 setup
β”‚   β”‚   β”œβ”€β”€ db.js               # MongoDB connection
β”‚   β”‚   └── multer.js           # File upload config
β”‚   β”œβ”€β”€ controllers/            # Request handlers
β”‚   β”‚   β”œβ”€β”€ activityController.js
β”‚   β”‚   β”œβ”€β”€ aiController.js
β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”œβ”€β”€ documentController.js
β”‚   β”‚   └── quizController.js
β”‚   β”œβ”€β”€ middleware/             # Express middleware
β”‚   β”‚   β”œβ”€β”€ authMiddleware.js
β”‚   β”‚   └── errorHandler.js
β”‚   β”œβ”€β”€ models/                 # Database schemas
β”‚   β”‚   β”œβ”€β”€ chat.js
β”‚   β”‚   β”œβ”€β”€ document.js
β”‚   β”‚   β”œβ”€β”€ quiz.js
β”‚   β”‚   └── user.js
β”‚   β”œβ”€β”€ routes/                 # API routes
β”‚   β”‚   β”œβ”€β”€ activityRoutes.js
β”‚   β”‚   β”œβ”€β”€ aiRoutes.js
β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”œβ”€β”€ documentRoutes.js
β”‚   β”‚   └── quizRoutes.js
β”‚   β”œβ”€β”€ utils/                  # Utility functions
β”‚   β”‚   β”œβ”€β”€ AppError.js
β”‚   β”‚   β”œβ”€β”€ fileSizeFormatter.js
β”‚   β”‚   β”œβ”€β”€ geminiService.js
β”‚   β”‚   β”œβ”€β”€ pdfParser.js
β”‚   β”‚   β”œβ”€β”€ quizStreakHelper.js
β”‚   β”‚   └── textChunker.js
β”‚   β”œβ”€β”€ uploads/                # Local uploads directory
β”‚   β”œβ”€β”€ package.json
β”‚   └── server.js               # Entry point
β”‚
└── frontend/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ api/                # API integration
    β”‚   β”‚   β”œβ”€β”€ activity.api.js
    β”‚   β”‚   β”œβ”€β”€ ai.api.js
    β”‚   β”‚   β”œβ”€β”€ auth.api.js
    β”‚   β”‚   β”œβ”€β”€ document.api.js
    β”‚   β”‚   β”œβ”€β”€ quiz.api.js
    β”‚   β”‚   └── config/
    β”‚   β”‚       β”œβ”€β”€ axios.js
    β”‚   β”‚       └── utils/
    β”‚   β”œβ”€β”€ assets/             # Static assets
    β”‚   β”‚   └── fonts/
    β”‚   β”œβ”€β”€ components/         # Reusable React components
    β”‚   β”‚   β”œβ”€β”€ document-detail/
    β”‚   β”‚   β”œβ”€β”€ documents/
    β”‚   β”‚   β”œβ”€β”€ layout/
    β”‚   β”‚   β”œβ”€β”€ quizzes/
    β”‚   β”‚   β”œβ”€β”€ Button.jsx
    β”‚   β”‚   β”œβ”€β”€ DeleteConfimModal.jsx
    β”‚   β”‚   β”œβ”€β”€ Loader.jsx
    β”‚   β”‚   β”œβ”€β”€ ProtectedRoute.jsx
    β”‚   β”‚   β”œβ”€β”€ StatCard.jsx
    β”‚   β”‚   └── Tabs.jsx
    β”‚   β”œβ”€β”€ context/            # React Context
    β”‚   β”‚   └── authContext.jsx
    β”‚   β”œβ”€β”€ pages/              # Page components
    β”‚   β”‚   β”œβ”€β”€ auth/
    β”‚   β”‚   β”œβ”€β”€ documents/
    β”‚   β”‚   β”œβ”€β”€ quizzes/
    β”‚   β”‚   β”œβ”€β”€ ActivityPage.jsx
    β”‚   β”‚   └── ProfilePage.jsx
    β”‚   β”œβ”€β”€ schemas/            # Validation schemas
    β”‚   β”‚   └── authSchema.js
    β”‚   β”œβ”€β”€ App.jsx
    β”‚   β”œβ”€β”€ index.css
    β”‚   └── main.jsx
    β”œβ”€β”€ eslint.config.js
    β”œβ”€β”€ package.json
    β”œβ”€β”€ vite.config.js
    β”œβ”€β”€ vercel.json
    β”œβ”€β”€ README.md
    └── index.html

πŸ“ Contributing

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

πŸ“§ Support

For issues, questions, or suggestions, please open an issue on the repository.


Happy Studying! πŸ“š

About

AI-powered learning platform using RAG to transform documents into quizzes, summaries, and contextual Q&A.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages