Skip to content

NoteCraft is a full-stack web app built with Django, Celery, and Next.js that lets users upload academic PDFs, generate AI-powered notes, and retrieve relevant content using RAG. It's optimized for long documents, supports async processing, and runs fully containerized with Docker.

Notifications You must be signed in to change notification settings

ShlokArora2709/NoteCraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NoteCraft – Full-Stack Note Creation Web App

NoteCraft is a modern full-stack web application for managing notes and user data, built with Django, Celery, and Next.js. It enables users to upload academic content (PDFs), generate detailed notes using advanced AI models, and retrieve contextually relevant information using Retrieval-Augmented Generation (RAG). The platform is optimized for long documents and supports asynchronous processing for scalability, and is fully containerized using Docker and Docker Compose.

πŸ“‘ Index

  1. πŸ“ Project Structure
  2. πŸš€ Features
  3. πŸ–ΌοΈ System Architecture
  4. πŸ§ͺ Development Tools
  5. πŸ“‚ Academic Namespaces
  6. πŸš€ RAG Pipeline
  7. πŸ“Έ Image Rendering Format
  8. πŸ›  Setup & Installation
  9. βš™οΈ Environment Variables (.env)
  10. πŸ“Œ Useful Commands

πŸ“ Project Structure

.
β”œβ”€β”€ frontend/                      # Next.js Frontend (Client-side)
β”‚   β”œβ”€β”€ next.config.ts
β”‚   β”œβ”€β”€ package.json
β”‚   └── src/
β”‚       β”œβ”€β”€ app/                  # Pages (login, signup, notes, browse_pdfs)
β”‚       β”œβ”€β”€ components/           # Reusable UI Components
β”‚       └── utils/, contexts/     # Auth context, utility functions

β”œβ”€β”€ NoteCraft_backend/            # Django Backend (Server-side)
β”‚   β”œβ”€β”€ NoteCraft_backend/        # Django Project Root
β”‚   β”‚   β”œβ”€β”€ settings.py
β”‚   β”‚   β”œβ”€β”€ urls.py
β”‚   β”‚   β”œβ”€β”€ celery.py             # Celery configuration
β”‚   β”‚   β”œβ”€β”€ asgi.py / wsgi.py
β”‚   β”œβ”€β”€ NoteMaker/                # Django App: Notes functionality
β”‚   β”‚   β”œβ”€β”€ models.py, views.py, tasks.py, myutils.py
β”‚   β”œβ”€β”€ UserData/                 # Django App: User data and auth
β”‚   β”‚   β”œβ”€β”€ models.py, views.py, serializer.py
β”‚   β”œβ”€β”€ db.sqlite3
β”‚   β”œβ”€β”€ Dockerfile.web            # Backend container
β”‚   β”œβ”€β”€ Dockerfile.celery         # Celery worker container

β”œβ”€β”€ docker-compose.yaml           # Multi-service orchestration
β”œβ”€β”€ .env                          # Environment variables

πŸš€ Features

  • 🌐 Frontend: Built with Next.js and TypeScript, featuring:

    • Authentication (login/signup)
    • Browse and upload PDFs
    • View and manage notes
  • πŸ”§ Backend: Built with Django REST Framework

    • API for note creation and user management
    • Modular architecture via Django apps: NoteMaker, UserData
  • βš™οΈ Asynchronous Task Handling:

    • Powered by Celery and Redis
    • Background note generation, PDF processing, etc.
  • πŸ“¦ Containerized Deployment:

    • Dockerized services for frontend, backend, and celery worker
    • docker-compose for easy orchestration
  • ✍️ AI-generated academic notes using Qwen/QWQ-32B via OpenRouter.

  • πŸ” Semantic search with Pinecone Vector DB using Llama-text-embed-v2, indexing 6,000 documents across 18 academic namespaces.

  • πŸ“€ PDF upload and retrieval via Cloudinary.

  • 🧡 Asynchronous processing with Celery and Redis.

πŸ–ΌοΈ System Architecture

          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚   User (Browser)   β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚   Next.js Frontend β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ API Calls
                   β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚ Django REST API    │◄─────────────┐
          β”‚  (NoteMaker/User)  β”‚              β”‚
          β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
                β”‚                             β”‚
                β–Ό                             β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚   Celery Worker    │◄────────── Redis Broker  β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
                β–Ό
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚  Database   β”‚  (SQLite / Cloud PostgreSQL)
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ§ͺ Development Tools

Layer Technology
Frontend Next.js, React, TypeScript
Backend Django, Django REST Framework
Async Tasks Celery + Redis
Vector DB Pinecone + Llama-text-embed-v2
Text Gen Qwen/QWQ-32B via OpenRouter
Image Gen Google Image Search
Storage Cloudinary
DevOps Docker, Docker Compose

πŸ“‚ Academic Namespaces

Includes 18 namespaces for granular search and retrieval:

  • physics, chemistry, mathematics_applied_math, cs_math, biology, medicine, agriculture_food_science, earth_sciences, psychology_cognitive_science, social_sciences, arts_humanities, engineering, technology_innovation, energy_sustainability, business_management, law_policy, philosophy_ethics, history

πŸš€ RAG Pipeline

  1. User inputs an academic query.
  2. Query is embedded using llama-text-embed-v2.
  3. Pinecone is queried to retrieve relevant context across 18 academic namespaces.
  4. Retrieved context + user query is fed into Qwen/QWQ-32B (OpenRouter) for full-length note generation.
  5. Notes are parsed for &&&image:(description)&&& markers and Google Images API is used to fetch images.

πŸ“Έ Image Rendering Format

Use &&&image:(description of image)&&& within note generation prompts. These markers will be replaced with relevant Google Image Search results at runtime.

πŸ›  Setup & Installation

1. Clone the Repository

git clone https://github.com/yourusername/NoteCraft.git
cd NoteCraft

2. Configure Environment

Create a .env file in the root with your environment variables:

βš™οΈ Environment Variables (.env)

Create a .env file with the following:

# OpenRouter API
OPEN_ROUTER_API_KEY=your_openrouter_key

# Pinecone Vector DB
PINECONE_API_KEY=your_pinecone_key
or just use "pcsk_6cJ5U2_EcKRhfYQFY545a69Mm4k149Qmx6Ubiqw7uYdEZur8576AFYXaWRn4nYSscRh928"

# Google Image Search
GOOGLE_API_KEY=your_google_api_key
CX=your_google_custom_search_cx

# Cloudinary
CLOUDINARY_NAME
CLOUDINARY_API
CLOUDINARY_KEY
CLOUDINARY_URL

# Redis Broker URL
REDIS_URL

#Postgress URL
DB_URL

3. Build and Run with Docker Compose

docker-compose up --build

Visit the app at: http://localhost:3000

πŸ“Œ Useful Commands

Backend

# Run Django shell
docker exec -it notecraft_backend python manage.py shell

# Apply migrations
docker exec -it notecraft_backend python manage.py migrate

# Create superuser
docker exec -it notecraft_backend python manage.py createsuperuser

Frontend

# Start dev server (locally)
cd frontend
npm install
npm run dev

About

NoteCraft is a full-stack web app built with Django, Celery, and Next.js that lets users upload academic PDFs, generate AI-powered notes, and retrieve relevant content using RAG. It's optimized for long documents, supports async processing, and runs fully containerized with Docker.

Topics

Resources

Stars

Watchers

Forks