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.
- π Project Structure
- π Features
- πΌοΈ System Architecture
- π§ͺ Development Tools
- π Academic Namespaces
- π RAG Pipeline
- πΈ Image Rendering Format
- π Setup & Installation
- βοΈ Environment Variables (.env)
- π Useful Commands
.
βββ 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
-
π 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.
ββββββββββββββββββββββ
β User (Browser) β
ββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββ
β Next.js Frontend β
ββββββββββ¬ββββββββββββ
β API Calls
βΌ
ββββββββββββββββββββββ
β Django REST API ββββββββββββββββ
β (NoteMaker/User) β β
βββββββ¬βββββββββββββββ β
β β
βΌ β
ββββββββββββββββββββββ ββββββββΌβββββββββ
β Celery Worker ββββββββββββ€ Redis Broker β
ββββββββββββββββββββββ βββββββββββββββββ
β
βΌ
βββββββββββββββ
β Database β (SQLite / Cloud PostgreSQL)
βββββββββββββββ
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 |
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
- User inputs an academic query.
- Query is embedded using
llama-text-embed-v2
. - Pinecone is queried to retrieve relevant context across 18 academic namespaces.
- Retrieved context + user query is fed into Qwen/QWQ-32B (OpenRouter) for full-length note generation.
- Notes are parsed for
&&&image:(description)&&&
markers and Google Images API is used to fetch images.
Use &&&image:(description of image)&&&
within note generation prompts. These markers will be replaced with relevant Google Image Search results at runtime.
git clone https://github.com/yourusername/NoteCraft.git
cd NoteCraft
Create a .env
file in the root with your environment variables:
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
docker-compose up --build
Visit the app at: http://localhost:3000
# 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
# Start dev server (locally)
cd frontend
npm install
npm run dev