A powerful collaborative knowledge management platform built with Next.js 15, TypeScript, and AI-powered features
Documentation • API Reference • Report Bug • Request Feature
Knowledge Network is a comprehensive collaborative knowledge management platform designed for modern teams. It combines powerful document editing, real-time collaboration, AI-powered features, and advanced search capabilities in one unified platform.
- 📝 Rich Text Editor - Advanced editor with Markdown support, code highlighting, and real-time collaboration
- 👥 Real-time Collaboration - Live cursors, presence indicators, and conflict-free simultaneous editing
- 🤖 AI-Powered Intelligence - Smart suggestions, auto-summarization, and semantic search
- 🔍 Advanced Search - Full-text search with filters, operators, and AI-powered semantic understanding
- 📱 Mobile & PWA - Responsive design with offline support and installable Progressive Web App
- 🔒 Enterprise Security - JWT authentication, RBAC, encryption, and compliance features
- 📊 Analytics Dashboard - Usage insights, content metrics, and team activity tracking
- 🔌 Extensible API - RESTful API with WebSocket support for real-time features
┌─────────────────────────────────────────────────────┐
│ Next.js 15 App │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ UI │ │ Auth │ │ State Manager │ │
│ │ Layer │ │ System │ │ (Zustand) │ │
│ └─────┬────┘ └─────┬────┘ └─────────┬────────┘ │
│ │ │ │ │
│ ┌─────▼─────────────▼─────────────────▼──────────┐ │
│ │ API Routes & Middleware │ │
│ └───────────────────┬────────────────────────────┘ │
└──────────────────────┼──────────────────────────────┘
│
┌─────────────┼─────────────┐
│ │ │
┌────▼────┐ ┌─────▼─────┐ ┌────▼────┐
│Postgres │ │ Redis │ │ S3 │
│ DB │ │ Cache │ │ Storage │
└─────────┘ └───────────┘ └─────────┘
- Node.js 20+ or Bun 1.0+
- PostgreSQL 15+
- Redis 7+
- Git
# Clone the repository
git clone https://github.com/knowledge-network/app.git
cd app
# Install dependencies (using Bun - recommended)
bun install
# Or using npm
npm install
# Set up environment variables
cp .env.example .env.local
# Run database migrations
bun run migrate
# Start development server
bun run devOpen http://localhost:3000 to see the application.
bun run devstarts the Next.js app, GraphQL API, and REST routes on http://localhost:3000. The dev server hot-reloads changes and proxies database calls through Prisma.- Ensure Postgres, Redis, and (optionally) Elasticsearch are running locally; credentials come from
.env.local. - When you need a production-like build, use
bun run buildfollowed bybun run start(served from.next/standalone). - Apply Prisma migrations before first run with
bun run migrate.
bun run storybooklaunches the component workbench on http://localhost:6006.- Build a static Storybook bundle with
bun run build-storybook(outputs tostorybook-static/). - Storybook consumes the same Tailwind, Radix, and theme tokens as the app, so design changes stay in sync.
- Next.js API routes and the GraphQL endpoint (
/api/graphql) run alongside the main app when you executebun run devorbun run start. - Realtime collaboration is optional but recommended for editor sessions. Start it with
bun run realtime(Bun WebSocket server on port 3005) orbun run realtime:elysiaif you prefer the Elysia wrapper. Health check:curl http://localhost:3005/health. - The realtime server reads
COLLAB_PORT,COLLAB_WS_PATH, andJWT_SECRET; align these with the app’sNEXT_PUBLIC_COLLAB_WS_URLso clients connect correctly.
- The Next.js app renders UI, handles authentication, and talks to Prisma-powered services (Postgres, Redis, Elasticsearch) through
/apiand/api/graphql. - The realtime server stores CRDT snapshots in
data/collab/and broadcasts updates that the editor consumes viaNEXT_PUBLIC_COLLAB_WS_URL. - Storybook reuses the same component library (
src/components/ui) and Tailwind theme, letting you iterate on UI states before shipping them to pages. - Shared environment files (
.env.local,.env.docker) keep ports, secrets, and service URLs aligned across runtimes.
# Build and start core services (app, Postgres, Redis, Elasticsearch)
docker compose up --build
# Include realtime collaboration server
docker compose --profile realtime up --build
# Add Kibana for search inspection
docker compose --profile observability up
# Shut everything down
docker compose downNotes:
- Environment defaults live in
.env.docker; adjust secrets or service URLs there before running. - Prisma migrations execute automatically on container start (
bunx prisma migrate deploy). - Data persists through named volumes (
postgres-data,redis-data,es-data,uploads-data,collab-data). - The realtime service is optional; enable the
realtimeprofile when collaborative editing is required. - Kibana is gated behind the
observabilityprofile to keep the default stack lightweight.
Create a .env.local file with the following variables: See the env.example for extensive feature configuration and dev mode settings
# Application
NODE_ENV=development
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/knowledge_network
# Redis
REDIS_URL=redis://localhost:6379
# Authentication
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-here
# JWT
JWT_SECRET=your-jwt-secret
JWT_REFRESH_SECRET=your-refresh-secret
# Optional: S3 Storage
S3_BUCKET=your-bucket
S3_REGION=us-east-1
S3_ACCESS_KEY=your-key
S3_SECRET_KEY=your-secretknowledge-network/
├── src/
│ ├── app/ # Next.js 15 app directory
│ │ ├── api/ # API routes
│ │ ├── auth/ # Authentication pages
│ │ ├── editor/ # Editor interface
│ │ └── ...
│ ├── components/ # React components
│ │ ├── ui/ # UI component library
│ │ ├── editor/ # Editor components
│ │ ├── auth/ # Auth components
│ │ └── help/ # Help system
│ ├── lib/ # Utility libraries
│ ├── server/ # Server-side code
│ ├── types/ # TypeScript definitions
│ └── utils/ # Helper functions
├── docs/ # Documentation
│ ├── user-guide/ # User documentation
│ ├── admin-guide/ # Admin documentation
│ ├── api-reference/ # API documentation
│ └── support/ # Support resources
├── prisma/ # Database schema
├── public/ # Static assets
└── tests/ # Test suites
# Development
bun run dev # Start development server
bun run build # Build for production
bun run start # Start production server
# Database
bun run migrate # Run database migrations
bun run migrate:create # Create new migration
bun run seed # Seed database with sample data
# Testing
bun run test # Run unit tests
bun run test:e2e # Run E2E tests
bun run test:coverage # Generate coverage report
# Code Quality
bun run lint # Run ESLint
bun run format # Format with Prettier
bun run type-check # TypeScript type checking- Framework: Next.js 15+ (App Router)
- Language: TypeScript 5+
- Styling: Tailwind CSS 4+
- Components: Radix UI + Custom Components
- State: Zustand
- Forms: React Hook Form + Zod
- Runtime: Node.js 20+ / Bun 1.0+
- Database: PostgreSQL 15+ with Prisma ORM
- Cache: Redis 7+
- Storage: S3-compatible (AWS S3, MinIO)
- Search: Elasticsearch 8+ (optional)
- Queue: BullMQ
- Container: Docker
- CI/CD: GitHub Actions
- Monitoring: Prometheus + Grafana
- Logging: Winston + ELK Stack
# Unit tests
bun run test
# Integration tests
bun run test:integration
# E2E tests (Playwright)
bun run test:e2e
# Watch mode
bun run test:watch
# Coverage report
bun run test:coveragetests/
├── unit/ # Unit tests
├── integration/ # Integration tests
├── e2e/ # End-to-end tests
└── fixtures/ # Test data
Comprehensive documentation is available in the /docs directory:
- User Guide - Complete user documentation
- Admin Guide - System administration
- API Reference - REST API documentation
- FAQ - Frequently asked questions
- Troubleshooting - Common issues
// Authentication
const response = await fetch('/api/v1/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: '[email protected]',
password: 'password'
})
});
const { accessToken } = await response.json();
// Create document
const doc = await fetch('/api/v1/documents', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'My Document',
content: '# Hello World'
})
});See API Documentation for complete reference.
- Build the application:
bun run build-
Set production environment variables
-
Run migrations:
NODE_ENV=production bun run migrate- Start the server:
bun run start# Build image
docker build -t knowledge-network .
# Run container
docker run -p 3000:3000 \
-e DATABASE_URL=your_db_url \
-e REDIS_URL=your_redis_url \
knowledge-network# Start all services
docker-compose up -d
# Stop services
docker-compose downWe welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow the existing code style
- Use TypeScript strict mode
- Write tests for new features
- Update documentation as needed
| Metric | Target | Actual |
|---|---|---|
| First Contentful Paint | < 1.5s | 1.2s ✅ |
| Time to Interactive | < 3.5s | 2.8s ✅ |
| Lighthouse Score | > 90 | 94 ✅ |
| Bundle Size | < 200KB | 175KB ✅ |
- Enable Redis caching
- Use CDN for static assets
- Configure proper database indexes
- Enable compression
- Implement lazy loading
- JWT-based authentication
- Role-based access control (RBAC)
- Encryption at rest and in transit
- Rate limiting
- CSRF protection
- XSS prevention
- SQL injection prevention
Please report security vulnerabilities to [email protected]
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- Prisma - Database ORM
- Radix UI - UI components
- Zustand - State management
Thanks to all contributors who have helped build Knowledge Network!
- Documentation: docs.knowledgenetwork.com
- Community Forum: community.knowledgenetwork.com
- Email Support: [email protected]
- Status Page: status.knowledgenetwork.com
- Core platform release
- Real-time collaboration
- Mobile PWA
- Advanced AI features
- Plugin system
- Advanced analytics
- Enterprise SSO
- Multi-language support
- Native mobile apps
- Advanced workflows
- API v2
- Performance improvements
See the open issues for a full list of proposed features and known issues.
Made with ❤️ by the Knowledge Network Team
© 2025 Knowledge Network. All rights reserved.