Skip to content

Repository files navigation

DiNotes β€” AI-Powered Knowledge Mapping & Markdown Platform 🧠

Visual note-taking, interactive 2D knowledge graph visualization, algorithmic similarity mapping, and Gemini AI document parsing.

React Version Vite Version Firebase Version Tailwind CSS License: MIT PRs Welcome


πŸ“Œ What is DiNotes?

DiNotes is an open-source visual knowledge mapping and Markdown note-taking web application designed to turn fragmented notes into an interconnected network of thoughts. DiNotes bridges plain text editing with interactive node graphs, enabling users to visualize relationships between ideas, auto-convert PDF/DOCX documents into clean Markdown using Google Gemini AI, and discover non-obvious conceptual connections using a Jaccard Similarity Matrix Engine.


✨ Key Features

  • πŸ•ΈοΈ Interactive 2D Knowledge Graph: Powered by React Flow and Dagre, offering top-to-bottom tree layouts, focus node isolation, and interactive link creation.
  • πŸ€– Gemini AI Document Converter: Upload PDF or DOCX files to extract text and format them into clean, structured Markdown using Google Gemini 2.5 Flash.
  • πŸ“ Full Markdown Editor & Live Preview: Real-time rendering with GitHub Flavored Markdown (react-markdown & remark-gfm).
  • πŸ“ Algorithmic Jaccard Similarity Engine: Quantifies note overlap across tags (40%), title tokens (30%), and content tokens (30%) to suggest hidden connections.
  • πŸ” Topological Pathfinder: Finds the shortest link distance between any two notes in your personal knowledge network.
  • πŸ”’ Secure Firebase Architecture: User authentication via Firebase Auth and multi-tenant document isolation backed by Firestore Security Rules.
  • πŸŒ™ Customizable Theme & Preferences: Built-in dark/light theme switching, graph node label toggles, and layout controls.

πŸ—οΈ Architecture & Data Flow

DiNotes connects client-side state hooks with Firebase Firestore realtime listeners, Dagre layout calculation, and Gemini AI endpoints:

flowchart TD
    subgraph UI ["User Interface Components"]
        Dash["Dashboard.jsx (Analytics & Cards)"]
        Graph["GraphView.jsx (2D React Flow Renderer)"]
        NotesMgr["NotesManager.jsx (Note Grid & Search)"]
        Detail["NoteDetail.jsx (Markdown Editor & AI Tools)"]
    end

    subgraph Core ["State & Algorithmic Engines"]
        AuthCtx["AuthContext.jsx (Firebase Observer)"]
        NotesCtx["NotesContext.jsx (Realtime Firestore Subscriptions)"]
        Similarity["similarity.js (Jaccard Index Engine)"]
        Converter["documentConverter.js (PDF/DOCX Extractor)"]
        Dagre["Dagre Tree Layout Engine"]
    end

    subgraph Services ["Cloud & AI Infrastructure"]
        Firestore["Firebase Firestore (/notes & /links)"]
        FirebaseAuth["Firebase Authentication"]
        Gemini["Google Gemini 2.5 Flash API"]
    end

    FirebaseAuth <--> AuthCtx
    Firestore <-->|Realtime Snapshot Sync| NotesCtx
    NotesCtx --> Dash
    NotesCtx --> NotesMgr
    NotesCtx --> Detail
    NotesCtx --> Similarity
    Similarity -->|Suggested Connections| Graph
    Dagre -->|Auto Node Positioning| Graph
    Converter -->|PDF/DOCX Extracted Text| Gemini
    Gemini -->|Structured Markdown| Detail
    Detail -->|Summarize Note| Gemini
Loading

πŸ› οΈ Tech Stack

Domain Technology Description
Frontend Core React 19.2 Modern component state, custom context hooks (AuthContext, NotesContext)
Build System Vite 8.0 High-speed HMR development server and production bundler
Styling & UI Tailwind CSS 3.4 Utility-first styling, glassmorphism UI, custom dark theme tokens
Graph Visualization React Flow 11 & Dagre Interactive 2D graph canvas and automated tree layout engine
Backend & Storage Firebase 12 Authentication (Email/Password) and Firestore NoSQL realtime database
AI Integration Google Gemini 2.5 Flash Document-to-Markdown parsing & automated note summarization
Document Parsers pdfjs-dist & mammoth Client-side text extraction from PDF and DOCX documents
Static Analysis ESLint 9.39 Flat config code linting and React Hooks enforcement

πŸ“‚ Project Structure

DiNotes/
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/
β”‚   β”‚   β”œβ”€β”€ bug_report.md         # Standardized bug reporting template
β”‚   β”‚   └── feature_request.md    # Feature suggestion template
β”‚   β”œβ”€β”€ workflows/
β”‚   β”‚   └── ci.yml                # GitHub Actions automated build & lint workflow
β”‚   β”œβ”€β”€ CODEOWNERS                # Maintainer code ownership definitions
β”‚   β”œβ”€β”€ PULL_REQUEST_TEMPLATE.md  # Contributor PR submission checklist
β”‚   └── dependabot.yml            # Automated dependency update configuration
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ GETTING_STARTED.md        # Comprehensive installation & running guide
β”‚   β”œβ”€β”€ ARCHITECTURE.md           # System design, Jaccard engine & database schema
β”‚   β”œβ”€β”€ DEVELOPMENT.md            # Available scripts, build pipeline & styling
β”‚   β”œβ”€β”€ CONTRIBUTING.md           # Contributor guidelines and workflow
β”‚   β”œβ”€β”€ SECURITY.md               # Security policy & data isolation rules
β”‚   └── FAQ.md                    # Frequently asked project questions
β”œβ”€β”€ public/                       # Static web assets
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ common/
β”‚   β”‚   β”‚   └── MetricCard.jsx    # Analytics stat card component
β”‚   β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   β”‚   β”œβ”€β”€ AppLayout.jsx     # Main shell wrapper
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx        # Navigation bar component
β”‚   β”‚   β”‚   └── Sidebar.jsx       # Side navigation bar
β”‚   β”‚   └── notes/
β”‚   β”‚       β”œβ”€β”€ LinkModal.jsx     # Connection creation modal
β”‚   β”‚       β”œβ”€β”€ NoteCard.jsx      # Note preview card component
β”‚   β”‚       └── NoteModal.jsx     # Quick note creation modal
β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx       # Firebase authentication state
β”‚   β”‚   β”œβ”€β”€ NotesContext.jsx      # Firestore realtime data state
β”‚   β”‚   β”œβ”€β”€ SettingsContext.jsx   # Graph layout & feature toggles
β”‚   β”‚   └── ThemeContext.jsx      # Dark/light theme state
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx         # Overview dashboard page
β”‚   β”‚   β”œβ”€β”€ GraphView.jsx         # 2D Knowledge Graph view
β”‚   β”‚   β”œβ”€β”€ Login.jsx             # User authentication login
β”‚   β”‚   β”œβ”€β”€ NoteDetail.jsx        # Note markdown editor & viewer
β”‚   β”‚   β”œβ”€β”€ NotesManager.jsx      # Note list & grid manager
β”‚   β”‚   β”œβ”€β”€ Settings.jsx          # App configuration & data purge
β”‚   β”‚   └── Signup.jsx            # User registration page
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ authService.js        # Firebase Auth wrapper methods
β”‚   β”‚   β”œβ”€β”€ firebase.js           # Firebase SDK initialization
β”‚   β”‚   └── noteService.js        # Firestore CRUD & realtime subscriptions
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ documentConverter.js  # PDF/DOCX extraction & Gemini AI converter
β”‚   β”‚   β”œβ”€β”€ similarity.js         # Jaccard similarity & AI summarization
β”‚   β”‚   └── timeFormat.js         # Relative date formatting utility
β”‚   β”œβ”€β”€ App.css                   # Custom styles & keyframe animations
β”‚   β”œβ”€β”€ App.jsx                   # React Router routing configuration
β”‚   β”œβ”€β”€ index.css                 # Global CSS reset & Tailwind imports
β”‚   └── main.jsx                  # Application entry point
β”œβ”€β”€ .env.example                  # Environment variable configuration template
β”œβ”€β”€ .gitignore                    # Git tracking rules
β”œβ”€β”€ eslint.config.js              # ESLint Flat Config rules
β”œβ”€β”€ firestore.rules               # Firestore security rules
β”œβ”€β”€ index.html                    # HTML shell
β”œβ”€β”€ LICENSE                       # MIT License
β”œβ”€β”€ package.json                  # Dependencies & scripts manifest
β”œβ”€β”€ postcss.config.js             # PostCSS Tailwind plugin config
β”œβ”€β”€ README.md                     # Project landing documentation
β”œβ”€β”€ tailwind.config.js            # Tailwind CSS configuration
└── vite.config.js                # Vite bundler configuration

πŸš€ Getting Started

Prerequisites

  • Node.js: v18.0.0 or higher
  • npm: v9.0.0 or higher
  • Firebase Project: Free account with Auth & Firestore enabled.

Quickstart

  1. Clone the repository:

    git clone https://github.com/TheVicky1/DiNotes.git
    cd DiNotes
  2. Install dependencies:

    npm install
  3. Setup Environment Variables: Copy .env.example to .env:

    cp .env.example .env

    Fill in your Firebase keys and optional Google Gemini API key in .env.

  4. Start local development server:

    npm run dev

    Open http://localhost:5173 in your browser.

  5. Build for production:

    npm run build
  6. Run static analysis:

    npm run lint

βš™οΈ Environment Configuration

Variable Description
VITE_API_KEY Firebase API Key
VITE_AUTH_DOMAIN Firebase Auth Domain (project.firebaseapp.com)
VITE_PROJECT_ID Firebase Project ID
VITE_STORAGE_BUCKET Firebase Storage Bucket
VITE_MESSAGING_SENDER_ID Firebase Messaging Sender ID
VITE_APP_ID Firebase App ID
VITE_MEASUREMENT_ID Firebase Measurement ID
VITE_GEMINI_API_KEY Google Gemini API Key (for AI PDF/DOCX conversion & summarization)

πŸ“– Documentation Architecture

Explore deeper technical guides in the docs/ directory:


🀝 Contributing

Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'feat: Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please review our Contributing Guidelines for details.


πŸ”’ Security

For security vulnerability reporting and Firestore access policy details, please refer to our Security Policy.


πŸ“œ License

Distributed under the MIT License. See LICENSE for more information.


πŸ’– Acknowledgements

About

Turn notes into an interconnected network of thoughts with 2D knowledge graphs, Jaccard similarity engine, and Gemini AI document parsing.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages