Skip to content

mrigangha/SmartNotes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Notes

A Demo of a New Stack

Django Templates + Mounted Vue.js (Hybrid SSR)
Redis-Based Retrieval-Augmented Generation (RAG) System


Overview

Smart Notes is a demonstration of a modern hybrid full-stack architecture that combines:

  • Django for backend logic and routing
  • Django Templates for Server-Side Rendering (SSR)
  • Vue.js mounted selectively for client-side interactivity
  • Interactive Islands pattern for performance optimization
  • Redis-powered vector search for Retrieval-Augmented Generation (RAG)

This project demonstrates how to build a scalable AI-enabled web application without converting the frontend into a heavy Single Page Application (SPA).


Architecture Philosophy

Smart Notes follows a backend-first architecture:

  • Django renders complete HTML on the server
  • Vue enhances only specific interactive sections
  • Redis powers fast semantic retrieval
  • Large Language Models are called via API (not run locally)

This ensures:

  • Fast initial page load
  • Minimal frontend complexity
  • Strong security model
  • High performance AI retrieval

Core Stack

Backend

  • Django
  • Django ORM
  • PostgreSQL or SQLite
  • Redis (Vector Search + Cache)

Frontend

  • Vue 3 (Mounted Islands)
  • Fetch API

AI Layer

  • Sentence Transformers (Embeddings)
  • Redis Vector Index
  • External LLM API (Cloud-hosted)

Hybrid SSR + Interactive Islands

Instead of building a full SPA, Smart Notes uses:

  1. Server-Side Rendering with Django Templates
  2. Mounted Vue components for interactivity (Similar to hydration but without node.)

Only specific UI sections become reactive.

Benefits:

  • Smaller JavaScript footprint
  • Faster first paint
  • No full-page hydration
  • SEO-friendly
  • Backend-controlled routing

Redis-Based RAG System

Smart Notes integrates a Redis-powered Retrieval-Augmented Generation pipeline.

RAG Flow

User Query
→ Generate Embedding
→ Store/Search Embeddings in Redis
→ Retrieve Top-K Relevant Note Chunks
→ Construct Context Prompt
→ Send to LLM API
→ Return AI Response


Why Redis for RAG?

Redis is used because:

  • In-memory high-speed access
  • Vector similarity search support (Redis Stack)
  • Dual-purpose: cache + vector database
  • Low latency retrieval
  • Scales well for AI workloads

Data Flow (Complete System)

Client Request
→ Django View
→ Template Rendered (SSR)
→ Vue Island Mounted
→ User Submits Query
→ Django RAG Service
→ Redis Vector Search
→ Context Retrieved
→ LLM API Called
→ AI Response Returned
→ UI Updated via Vue


Performance Advantages

  • Fast server-rendered pages
  • Minimal hydration
  • Redis in-memory retrieval
  • Reduced client CPU usage
  • Efficient AI pipeline

Security Model

  • Session-based authentication
  • CSRF protection
  • Backend-controlled AI requests
  • No exposed API keys in frontend
  • Redis isolated at backend layer

How to Run

Will be explained soon.


When This Stack Is Ideal

  • AI-powered knowledge bases
  • SaaS dashboards
  • Internal tools
  • Notes applications
  • RAG chat systems
  • Backend-heavy systems with moderate interactivity

Hybrid vs Traditional SPA

Traditional SPA:

  • Heavy frontend bundle
  • Complex state management
  • Mandatory API layer
  • Slower first paint

Smart Notes Stack:

  • Server-rendered HTML
  • Mounted interactive islands
  • Backend-driven architecture
  • Redis-powered AI retrieval
  • Clean separation of concerns

Design Principles

  • Backend-first rendering
  • Progressive enhancement
  • Minimal frontend complexity
  • Performance-first approach
  • Clear system boundaries
  • Scalable AI integration

Future Improvements

  • Redis Cluster support
  • Streaming LLM responses
  • Background embedding workers
  • Dockerized deployment
  • Monitoring and observability integration

Conclusion

Smart Notes demonstrates a new stack that combines:

  • Django for structured backend rendering
  • Vue for targeted UI interactivity
  • Redis for vector-based semantic search
  • Cloud-hosted LLM for contextual AI responses

This architecture delivers high performance, strong security, scalability, and clean separation between rendering, interactivity, and AI logic.


License

MIT License

About

An AI powered notes platform created using a Very Unique tech stack.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors