A modern personal knowledge management system with interactive graph visualization. Built with Next.js, GraphQL, and Prisma.
- Smart Content Management: Articles, code snippets, and bookmarks with rich editing
- Interactive Knowledge Graph: D3.js-powered visualization of your knowledge network
- Advanced Search & Tagging: Full-text search with customizable, color-coded tags
- Semantic Relationships: Connect entries with typed relationships (related, references, builds on, etc.)
- Browser Extension: Save content from any webpage with Chrome/Edge extension
- Data Export/Import: JSON and Markdown format support
- Modern UI: Responsive design with dark/light theme
git clone https://github.com/MridulTailor/knowledge-vault.git
cd knowledge-vault
npm install- Create
.envfile:
DATABASE_URL="file:./dev.db" # or PostgreSQL for production
JWT_SECRET="your-secure-secret-min-32-chars"- Initialize database:
npx prisma generate
npx prisma db push- Start development server:
npm run dev- Navigate to
browser-extensionfolder - Run
node build.js - Load unpacked extension in Chrome/Edge from
chrome://extensions/ - Configure server URL in extension settings
Shortcuts:
Ctrl+Shift+S- Save current pageCtrl+Shift+N- Quick note
- Frontend: Next.js 14, TypeScript, Tailwind CSS, shadcn/ui
- Backend: GraphQL (Apollo), Prisma ORM
- Database: PostgreSQL (SQLite for dev)
- Visualization: D3.js force-directed graphs
- Auth: JWT with bcrypt
npm run dev- Development servernpm run build- Production buildnpm run db:push- Update database schemanpm run db:studio- Database management UI
- Create entries - Choose from articles, code snippets, or bookmarks
- Add relationships - Connect related knowledge with semantic links
- Explore graph - Visualize your knowledge network interactively
- Search & filter - Find content by text, tags, or type
- Export data - Backup as JSON or Markdown
- Fork the repo
- Create feature branch:
git checkout -b feature/name - Commit changes:
git commit -m 'Add feature' - Push and create Pull Request
MIT License - see LICENSE file for details.
Transform your digital knowledge into an interconnected, searchable network! π
- Next.js 14: React framework with App Router for full-stack development
- TypeScript: Type-safe development with enhanced developer experience
- Tailwind CSS: Utility-first CSS framework for rapid UI development
- shadcn/ui: Modern, accessible React components built on Radix UI primitives
- React Hook Form + Zod: Type-safe form handling with validation
- D3.js: Powerful data visualization library for the interactive knowledge graph
- CodeMirror: Advanced code editor with syntax highlighting for 15+ languages
- Lucide React: Beautiful, consistent icon library
- Next.js API Routes: Serverless API endpoints with built-in optimizations
- Apollo GraphQL Server: Type-safe GraphQL API with efficient data fetching
- Prisma ORM: Modern database toolkit with type-safe client generation
- PostgreSQL: Primary database for production (SQLite supported for development)
- JWT Authentication: Secure, stateless authentication with bcrypt password hashing
- Knowledge Graph: D3.js force-directed graph with performance optimizations for large datasets
- Real-time Updates: GraphQL subscriptions and optimistic UI updates
- Responsive Design: Mobile-first approach with adaptive layouts
- Theme System: System-aware dark/light mode with smooth transitions
- Search Engine: Full-text search with advanced filtering capabilities
- Data Export: JSON and Markdown export with complete data preservation
The application uses a normalized relational database structure:
Core Models:
User: User accounts with authentication credentialsEntry: Knowledge entries supporting multiple content typesTag: Organizational tags with optional color codingRelationship: Typed connections between entries with descriptionsEntryTag: Many-to-many junction table for entry-tag associations
Relationship Types:
RELATED_TO: General topical connectionsREFERENCES: Citation and reference relationshipsBUILDS_ON: Progressive knowledge buildingSOURCE_FOR: Foundational knowledge relationshipsINSPIRED_BY: Creative inspiration linksCONTRADICTS: Opposing viewpoint connections
npm run dev- Start development server with hot reloadnpm run build- Build optimized production bundlenpm run start- Start production servernpm run lint- Run ESLint for code quality checksnpm run db:push- Push Prisma schema changes to databasenpm run db:generate- Generate Prisma client after schema changesnpm run db:migrate- Create and run database migrationsnpm run db:deploy- Deploy migrations to productionnpm run db:reset- Reset database and run all migrationsnpm run db:studio- Launch Prisma Studio for database management
The Knowledge Graph is the centerpiece feature that sets Knowledge Vault apart from traditional note-taking applications. It provides a visual, interactive representation of your knowledge network.
- D3.js Force Simulation: Physics-based layout engine that creates natural clustering
- Performance Optimized: Handles large graphs (100+ nodes) with throttled rendering
- Responsive Interactions: Real-time highlighting and tooltip system
- Adaptive Scaling: Dynamic node sizing based on content length and connections
- Visual Node Types: Color-coded circles representing different content types
- Blue: Articles and notes
- Green: Code snippets
- Orange: Bookmarks
- Relationship Visualization: Different line styles and colors for relationship types
- Search Integration: Real-time highlighting of matching nodes
- Zoom & Pan: Smooth navigation with mouse or touch controls
- Drag Interactions: Reorganize layout by dragging individual nodes
- Fullscreen Mode: Immersive exploration experience
- Hover Details: Contextual information without navigation
- Click Navigation: Deep dive into specific entries
- Connection Insights: Identify highly connected nodes (knowledge hubs)
- Cluster Detection: Visual identification of related topic groups
- Relationship Patterns: Understand how different types of content relate
- Knowledge Gaps: Spot areas with few connections for potential expansion
New users can load sample data to immediately experience the knowledge graph with:
- Interconnected articles on web development topics
- Code snippets with practical examples
- Bookmarks to relevant documentation
- Multiple relationship types demonstrating the system's flexibility
- Update Database Schema: Add new type to
EntryTypeenum inprisma/schema.prisma - GraphQL Schema: Update the enum in
lib/graphql/schema.ts - Frontend Components:
- Add the new type to entry form components
- Update type filters and display logic
- Add appropriate icons and styling
- Apply Changes: Run
npx prisma db pushto update the database
- Database Update: Extend
RelationshipTypeenum in Prisma schema - GraphQL Integration: Update schema and resolvers
- UI Components:
- Update relationship form with new type options
- Add appropriate colors and styling to graph visualization
- Update relationship display logic
- Migration: Push database changes with
npx prisma db push
The application uses Tailwind CSS with a comprehensive design system:
- Color Palette: Customizable through CSS custom properties
- Component Library: Built on shadcn/ui for consistency
- Dark/Light Modes: Automatic system detection with manual override
- Responsive Design: Mobile-first approach with breakpoint-aware layouts
The GraphQL API is easily extensible:
- Add Resolvers: Extend
lib/graphql/resolvers.tswith new queries/mutations - Update Schema: Add new types and operations to
lib/graphql/schema.ts - Frontend Integration: Use generated types for type-safe client integration
- Database Setup: Configure PostgreSQL database
- Environment Variables: Set production environment variables
- Build Application: Run
npm run build - Database Migration: Run
npx prisma migrate deploy - Start Server: Run
npm start
- Vercel: Seamless Next.js deployment with automatic CI/CD
- Railway: Simple PostgreSQL hosting with automatic deployments
- DigitalOcean: VPS hosting for full control
- AWS/Google Cloud: Enterprise-scale deployment options
# Database (PostgreSQL recommended)
DATABASE_URL="postgresql://username:password@host:port/database"
# Authentication
JWT_SECRET="your-secure-production-secret-minimum-32-characters"
# Optional: Custom domain for browser extension
NEXT_PUBLIC_APP_URL="https://your-domain.com"We welcome contributions from the community! Here's how you can get involved:
- Fork the Repository: Click the "Fork" button on GitHub
- Clone Your Fork:
git clone https://github.com/your-username/knowledge-vault.git cd knowledge-vault - Install Dependencies: Run
npm install - Set Up Development Environment: Follow the installation guide above
- Create Feature Branch:
git checkout -b feature/your-amazing-feature
- Code Style: Follow the existing TypeScript and React patterns
- Commit Messages: Use conventional commit format (
feat:,fix:,docs:, etc.) - Testing: Ensure your changes don't break existing functionality
- Documentation: Update README and code comments as needed
- New Features: Additional content types, advanced search, collaboration features
- Browser Extensions: Firefox support, mobile browser integration
- Integrations: Third-party service connections (Notion, Obsidian, etc.)
- Performance: Database query optimization, frontend performance improvements
- UI/UX: Design improvements, accessibility enhancements
- Documentation: Tutorials, API documentation, video guides
- Test Your Changes: Ensure everything works in development
- Commit Your Changes:
git commit -m 'feat: add amazing new feature' - Push to Your Fork:
git push origin feature/your-amazing-feature
- Create Pull Request: Open a PR with a clear description of your changes
This project is licensed under the MIT License - see the LICENSE file for complete details.
- β Commercial Use: Free to use in commercial projects
- β Modification: Modify and adapt the code as needed
- β Distribution: Share and distribute the software
- β Private Use: Use privately without restrictions
- β Attribution: Include copyright notice in distributions
Built with β€οΈ using these incredible open-source technologies:
- Next.js - The React framework for production
- Prisma - Next-generation ORM for TypeScript
- Apollo GraphQL - Comprehensive GraphQL platform
- D3.js - Data-driven document manipulation
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Low-level UI primitives
- shadcn/ui - Re-usable components built with Radix UI