Skip to content

Repository files navigation

Note God πŸ“βœ¨

Note God is an intelligent, AI-powered note-taking application that transforms how you create, manage, and interact with your notes. Built with cutting-edge technologies, it combines the simplicity of note-taking with the power of artificial intelligence to enhance your productivity.

πŸš€ Features

Core Functionality

  • Smart Note Creation: Create and organize notes with a clean, intuitive interface
  • Real-time Editing: Seamless note editing experience with auto-save capabilities
  • User Authentication: Secure user registration, login, and profile management
  • Responsive Design: Optimized for desktop and mobile devices

AI-Powered Features

  • AI Note Generation: Generate comprehensive notes on any topic using advanced AI models (OpenAI, Gemini)
  • Interactive Q&A: Ask questions about your notes and get intelligent responses
  • Content Analysis: AI-powered insights and suggestions for your content
  • Smart Formatting: Automatic formatting and structure suggestions
  • PDF Chat (RAG): Upload PDF documents and chat with them using Retrieval Augmented Generation
  • AI Image Generation: Create stunning images from text prompts using Pollinations API

Advanced Capabilities

  • Real-time Collaboration: Live updates and synchronization via Socket.IO
  • Community Chat: Real-time messaging and collaboration with other users
  • Vector Search: Semantic search across your notes using Qdrant vector database
  • Background Processing: Asynchronous file processing with BullMQ workers
  • Search & Filter: Powerful search functionality across all your notes
  • Theme Support: Dark/light mode toggle for comfortable viewing
  • Export Options: Various export formats for your notes

πŸ› οΈ Tech Stack

Frontend

  • Next.js 15.2.8 - React framework with App Router
  • React 19 - Latest React with modern features
  • TypeScript - Type-safe development
  • Tailwind CSS 4 - Utility-first CSS framework
  • Radix UI - Accessible component primitives
  • Lucide React - Beautiful icons
  • Socket.IO Client - Real-time bidirectional communication

Backend & Infrastructure

  • Prisma ORM - Type-safe database client
  • PostgreSQL - Robust relational database
  • Supabase - Authentication and real-time features
  • Socket.IO Server - Real-time WebSocket server
  • Redis - In-memory data store for caching and queuing
  • BullMQ - Background job processing and task queue
  • Qdrant - Vector database for semantic search and RAG

AI Integration

  • Google Gemini - Alternative AI model support
  • LangChain - Framework for building AI applications
  • Pollinations API - AI image generation from text prompts
  • RAG (Retrieval Augmented Generation) - PDF document chat functionality

Development Tools

  • ESLint - Code linting and formatting
  • Prettier - Code formatting
  • Turbopack - Fast bundler for development
  • Docker & Docker Compose - Containerization and orchestration

πŸ“‹ Prerequisites

Before setting up Note God, ensure you have the following installed:

  • Node.js (version 18.0 or higher)
  • npm package manager
  • PostgreSQL database (local or cloud)
  • Git for version control

πŸ”§ Step-by-Step Setup Instructions

1. Clone the Repository

git clone https://github.com/abhas20/Note_God.git
cd Note_God

2. Install Dependencies

npm install

3. Environment Configuration

Create a .env file in the root directory and add run the command:

cp .env.example .env

Note: If using Docker Compose, some URLs will need to be adjusted (see Docker deployment section).

4. Database Setup

Option A: Local PostgreSQL

  1. Install PostgreSQL on your system
  2. Create a new database:
CREATE DATABASE note_god_db;
  1. Update the DB_URL in your .env.local file

Option B: Cloud PostgreSQL (Recommended)

  • Use services like Supabase or Neon
  • Copy the connection string to your DB_URL environment variable

5. Supabase Setup

  1. Go to Supabase and create a new project
  2. Get your project URL and anon key from the API settings
  3. Add these to your .env file
  4. Supabase will handle user authentication and real-time features

6. Additional Services Setup (Required for Full Functionality)

Redis Setup

Redis is required for background job processing and real-time features.

Local Installation:

# macOS
brew install redis
brew services start redis

# Ubuntu/Debian
sudo apt-get install redis-server
sudo systemctl start redis

# Windows (via WSL or download from Redis website)

Docker (Recommended):

docker run -d -p 6379:6379 --name redis redis:alpine

Qdrant Setup

Qdrant is required for vector search and PDF chat functionality.

Docker (Recommended):

docker run -d -p 6333:6333 --name qdrant qdrant/qdrant:latest

Or use the provided Docker Compose (see deployment section).

Gemini API

  1. Get an API key from Google AI Studio (https://makersuite.google.com/app/apikey)
  2. Add GEMINI_API_KEY to your .env file

7. Socket Server Setup

The socket server handles real-time communication. It needs its own .env file:

Create .env file in the socket-server directory:

cd socket-server
cp .env.example .env

Start the socket server in a separate terminal:

cd socket-server
npm install
npm run dev

8. Database Migration

Run Prisma migrations to set up your database schema:

npm run migrate
# or
npx prisma generate && npx prisma migrate dev

9. Start Development Server

Main Application:

npm run dev

Worker Process (in a separate terminal for background jobs):

npm run dev:workers

Or run both together:

npm run all

10. Run using Docker(Optional)

Ensure env files are created

  • (For Development)
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build -d
  • (For Production)
docker-compose up --build -d

Open http://localhost:3000 in your browser to see the application.

πŸ—οΈ Project Structure

Note_God/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ action/          # Server actions
β”‚   β”‚   β”œβ”€β”€ note.ts      # Note-related actions
β”‚   β”‚   β”œβ”€β”€ user.ts      # User-related actions
β”‚   β”‚   └── rag.ts       # RAG and file upload actions
β”‚   β”œβ”€β”€ app/             # Next.js App Router pages
β”‚   β”‚   β”œβ”€β”€ api/         # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ create-new-note/  # Create notes
β”‚   β”‚   β”‚   β”œβ”€β”€ query-rag/        # RAG query endpoint
β”‚   β”‚   β”‚   β”œβ”€β”€ messages/         # Chat messages
β”‚   β”‚   β”‚   └── ...               # Other API routes
β”‚   β”‚   β”œβ”€β”€ auth/        # Authentication pages
β”‚   β”‚   β”œβ”€β”€ login/       # Login page
β”‚   β”‚   β”œβ”€β”€ signup/      # Signup page
β”‚   β”‚   β”œβ”€β”€ profile/     # User profile
β”‚   β”‚   β”œβ”€β”€ chatpdf/     # PDF chat interface
β”‚   β”‚   β”œβ”€β”€ visualise/   # AI image generation
β”‚   β”‚   └── page.tsx     # Home page
β”‚   β”œβ”€β”€ auth/            # Authentication utilities
β”‚   β”‚   └── server.ts    # Server-side auth functions
β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”œβ”€β”€ ui/          # Base UI components
β”‚   β”‚   β”œβ”€β”€ AskAIButton.tsx        # AI Q&A functionality
β”‚   β”‚   β”œβ”€β”€ NewNoteButton.tsx      # Create new notes
β”‚   β”‚   β”œβ”€β”€ NoteGenerator.tsx      # AI note generation
β”‚   β”‚   β”œβ”€β”€ NoteTextInput.tsx      # Note editor
β”‚   β”‚   β”œβ”€β”€ ComunityChat.tsx       # Community chat UI
β”‚   β”‚   β”œβ”€β”€ Visualise.tsx          # Image generation UI
β”‚   β”‚   β”œβ”€β”€ FileLayout.tsx         # PDF file management
β”‚   β”‚   └── AppSideBar.tsx         # Application sidebar
β”‚   β”œβ”€β”€ db/              # Database configuration
β”‚   β”‚   β”œβ”€β”€ prisma.ts    # Prisma client
β”‚   β”‚   └── schema.prisma # Database schema
β”‚   β”œβ”€β”€ hooks/           # Custom React hooks
β”‚   β”œβ”€β”€ lib/             # Utility functions
β”‚   β”œβ”€β”€ worker/          # Background workers
β”‚   β”‚   └── fileProcessor.ts  # File processing worker
β”‚   β”œβ”€β”€ providers/       # React context providers
β”‚   β”œβ”€β”€ middleware.ts    # Next.js middleware
β”‚   └── style/           # Global styles
β”œβ”€β”€ socket-server/       # Real-time Socket.IO server
β”‚   β”œβ”€β”€ app.ts           # Socket server application
β”‚   β”œβ”€β”€ services/        # Socket services
β”‚   └── package.json     # Socket server dependencies
β”œβ”€β”€ ai/                  # AI configuration
β”œβ”€β”€ public/              # Static assets
β”œβ”€β”€ docker-compose.yml   # Docker Compose configuration
β”œβ”€β”€ Dockerfile           # Application Docker image
β”œβ”€β”€ package.json         # Dependencies and scripts
β”œβ”€β”€ tailwind.config.js   # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json        # TypeScript configuration
└── README.md           # Project documentation

πŸ“š Available Scripts

  • npm run dev - Start development server with Turbopack
  • npm run dev:workers - Start background worker process for file processing
  • npm run all - Run both dev server and workers concurrently
  • npm run build - Build the application for production (includes Prisma migrations)
  • npm start - Start the production server
  • npm run lint - Run ESLint for code linting
  • npm run format - Format code with Prettier
  • npm run migrate - Run Prisma database migrations

πŸš€ Deployment

Docker Compose Deployment (Recommended)

The easiest way to deploy Note God is using Docker Compose, which sets up all services:

  1. Create Environment Files:

Ensure .env in the root directory and .env in the socket-server directory:

  1. Start All Services:
docker-compose up -d

This will start:

  • Main Next.js application (port 3000)
  • Background workers for file processing
  • Socket.IO server (port 4000)
  • Redis (port 6379)
  • Qdrant vector database (port 6333)
  1. View Logs:
docker-compose logs -f
  1. Stop Services:
docker-compose down

🎯 Getting Started Guide

For New Users

  1. Sign Up: Create an account using email and password
  2. Create Your First Note: Click "New Note" to start writing
  3. Try AI Features:
    • Use "Ask AI to generate Notes" for automated content creation
    • Use "Ask AI Help" to get insights about your notes
  4. Upload PDFs: Navigate to the "Chat with PDF" section to upload documents and ask questions
  5. Generate Images: Use the "Visualise" feature to create AI-generated images from text prompts
  6. Community Chat: Connect with other users through real-time messaging
  7. Organize: Create multiple notes for different topics
  8. Search: Use the search functionality to find specific content

πŸ”’ Security Features

  • Secure Authentication: Powered by Supabase Auth
  • Data Encryption: All sensitive data is encrypted
  • API Protection: Server actions with user validation
  • Environment Security: Sensitive keys stored in environment variables

πŸ› Troubleshooting

Common Issues

Database Connection Error

# Verify your database URL and run:
npx prisma db push

Supabase Auth Issues

# Check your Supabase URL and keys in .env.local
# Ensure your Supabase project is active

AI Features Not Working

# Verify your OpenAI or Gemini API key
# Check if you have sufficient API credits

Redis Connection Error

# Ensure Redis is running:
redis-cli ping
# Should return: PONG

# Or start Redis:
brew services start redis  # macOS
sudo systemctl start redis  # Linux
docker start redis  # Docker

Qdrant Connection Error

# Check if Qdrant is running:
curl http://localhost:6333/health
# Should return: {"title":"qdrant - vector search engine","version":"..."}

# Or start Qdrant:
docker start qdrant

Socket Server Not Connecting

# Verify socket server is running on port 4000
# Check SOCKET_SERVER_URL in environment variables
# Ensure Redis is accessible to socket server

Worker Process Not Running

# Start workers separately:
npm run dev:workers

# Check Redis connection for BullMQ

PDF Upload/Chat Issues

# Ensure Qdrant is running and accessible
# Verify QDRANT_URL in environment variables
# Check worker process is running for file processing

Getting Help

If you encounter issues:

  1. Check the console for error messages
  2. Verify all environment variables are set correctly
  3. Ensure your database is properly configured
  4. Check that all services (Redis, Qdrant, Socket server) are running
  5. Verify APIs (Supabase, Gemini) are accessible
  6. Review Docker logs if using Docker Compose: docker-compose logs -f

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Acknowledgments

🌟 Key Features Highlights

πŸ“„ PDF Chat with RAG

Upload any PDF document and have intelligent conversations about its content. The system uses Retrieval Augmented Generation (RAG) with Qdrant vector database for semantic search.

🎨 AI Image Generation

Transform your ideas into stunning visuals using the Pollinations API. Generate images from text prompts with customizable parameters.

πŸ’¬ Real-time Community Chat

Connect with other users through WebSocket-powered real-time messaging. All messages are synchronized instantly across all connected clients.

πŸ”„ Background Processing

Heavy tasks like PDF processing and vector embeddings run asynchronously using BullMQ workers, ensuring the UI remains responsive.

πŸ” Vector Search

Leverage Qdrant's vector database for semantic search across your notes and documents, finding relevant content even when exact keywords don't match.


Note God - Transform your note-taking experience with the power of AI! πŸš€

About

An intelligent, AI-powered note-taking application that transforms how you create, manage, and interact with your notes.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages