Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  CrimsonLearn (CrimsonMind API)

Backend

CrimsonLearn Backend powers CrimsonMind, an AI-driven study assistant that transforms static notes into interactive learning through OCR, quizzes, and contextual explanations.

This backend exposes a REST API that the frontend consumes to provide a seamless learning experience.

โœจ Features

๐Ÿ“„ OCR Processing โ€“ Extracts text from uploaded handwritten or typed notes

๐Ÿง  AI Tutor (CrimsonMind) โ€“ Answers questions strictly based on provided notes

๐Ÿ“ Quiz Generator โ€“ Creates MCQs from notes for active recall

๐ŸŒ Frontend-ready API โ€“ Designed to integrate with a React/Vite frontend

๐Ÿ› ๏ธ Tech Stack

Backend Framework: Flask

AI Model: Google Gemini

OCR: Tesseract OCR + Pillow

Language: Python 3

Environment Management: python-dotenv

๐Ÿ“ Project Structure backend/ โ”‚ โ”œโ”€โ”€ app.py # Flask app & routes โ”œโ”€โ”€ chatbot.py # CrimsonMind AI logic โ”œโ”€โ”€ quiz.py # Quiz generation logic โ”œโ”€โ”€ ocr.py # OCR text extraction โ”œโ”€โ”€ requirements.txt # Python dependencies โ”œโ”€โ”€ .env # API keys (not committed) โ””โ”€โ”€ uploads/ # Uploaded note images

๐Ÿ”Œ API Endpoints ๐Ÿ“„ Upload Notes (OCR)

POST /api/upload

Input: Image file (PNG/JPG)

Output: Extracted text

๐Ÿ“ Generate Quiz

POST /api/generateQuiz

{ "notes": "your notes here", "num_questions": 5 }

๐Ÿง  Ask CrimsonMind

POST /api/chat

{ "notes": "your notes here", "question": "your question here" }

โš™๏ธ Setup Instructions 1๏ธโƒฃ Clone & Navigate git clone https://github.com/AdarshAlex751/crimsonmind cd backend

2๏ธโƒฃ Create Virtual Environment python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate

3๏ธโƒฃ Install Dependencies pip install -r requirements.txt

4๏ธโƒฃ Configure Environment

Create a .env file:

GEMINI_API_KEY=your_api_key_here

5๏ธโƒฃ Run the Server python app.py

Server runs on:

http://127.0.0.1:5000

๐Ÿš€ Purpose

This backend focuses on conceptual learning, ensuring AI responses stay grounded in the userโ€™s own study material rather than generic explanations.

Frontend

Built with performance and clean UI in mind.

โœจ Features

๐Ÿ“„ Upload notes for OCR processing

๐Ÿง  Chat with CrimsonMind AI

๐Ÿ“ Generate quizzes instantly

๐ŸŽจ Smooth animations & modern UI

๐ŸŒ™ Automatic dark/light mode

๐Ÿ› ๏ธ Tech Stack

Framework: React (Vite)

Styling: Tailwind CSS

Animations: Framer Motion

Icons: Lucide React

HTTP Client: Axios

๐Ÿ“ Project Structure frontend/ โ”‚ โ”œโ”€โ”€ index.html โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ main.jsx โ”‚ โ”œโ”€โ”€ App.jsx โ”‚ โ””โ”€โ”€ components/ โ”œโ”€โ”€ tailwind.config.js โ”œโ”€โ”€ postcss.config.js โ”œโ”€โ”€ vite.config.js โ”œโ”€โ”€ package.json โ””โ”€โ”€ package-lock.json

โš™๏ธ Setup Instructions 1๏ธโƒฃ Navigate to Frontend cd frontend

2๏ธโƒฃ Install Dependencies npm install

3๏ธโƒฃ Start Development Server npm run dev

Frontend runs at:

http://localhost:5173

The frontend is preconfigured to proxy API requests to the Flask backend.

๐Ÿ” Backend Connection

The frontend communicates with the backend via:

/api โ†’ http://127.0.0.1:5000

Make sure the backend server is running before using the app.

๐ŸŽฏ Design Philosophy

Minimal distractions

Fast feedback loops

Learning through interaction, not passive reading

๐Ÿ”ฎ Future Improvements

User authentication

Study progress tracking

Concept graphs & analytics

PDF and multi-page uploads

Voice-based interaction

About

CrimsonAI - AI Study Pal, helping you study better and more efficiently.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages