An open-source wiki system built with modern web technologies, inspired by WikiJS. NextWiki provides a flexible, extensible platform for creating and managing knowledge bases.
- Modern Stack: Built with Next.js 15, React 19, Drizzle ORM, tRPC, NextAuth, Tailwind CSS, Codemirror, Shadcn UI, and more
- Markdown Support: Write content using simple Markdown syntax
- Direct Image Upload: Upload images directly with paste or drag and drop
- Syntax Highlighting: Syntax highlighting for code blocks
- Page/Folder Moving Functionality: Move/rename pages and folders to different locations
- Authentication: Secure login with credentials or OAuth providers (only password login is implemented for now)
- Advanced Search: Full-text and fuzzy search
- Tags & Categories: Organize your content effectively
- Asset Manager: Upload, delete, and manage assets (images, videos, PDFs, etc.)
- Permissions: Group and granular permission based access control
- Settings: Centralized settings for the wiki, manageable by the admin
- Framework: Next.js (for the frontend and core features)
- Backend: Optional NestJS on Fastify (for features like WebSockets, planned for Yjs integration)
- Database: PostgreSQL with Drizzle ORM
- API: Type-safe APIs with tRPC (primarily within Next.js)
- Authentication: NextAuth.js
- Search: PostgreSQL full-text search with trigram similarity for fuzzy matching
- Styling: Tailwind CSS
- Monorepo Management: Turborepo
- Deployment: Compatible with Vercel, Netlify, or self-hosted (NestJS backend requires a Node.js environment)
Note: Most functionality resides within the Next.js application and can run on serverless platforms like Vercel. The NestJS backend is included to support optional self-hosted WebSocket functionality, anticipating future integration with Yjs for real-time collaboration, without relying on external providers.
- S3 Asset Storage: Store assets in S3 or somewhere else
- Version history: Track changes and revert to previous versions
- Visual editor: A visual editor for creating and editing pages
- Real-time Collaboration: Multiple users can edit pages simultaneously using Yjs
- Better Settings: Better settings, ability to manage authentication providers, etc.
- Different theme support: Ability to switch between different themes
- Import/Export: Ability to import and export pages from and to other wiki systems
- Node.js 18+ (pnpm required)
- PostgreSQL database (or Neon serverless PostgreSQL)
-
Clone the repository:
git clone https://github.com/barisgit/nextwiki.git cd nextwiki
-
Install dependencies:
pnpm install
-
Copy the environment file and configure it:
cp apps/web/.env.example apps/web/.env cp packages/db/.env.example packages/db/.env
Update the values in
.env
with your database and authentication settings. -
Set up the database with one of the following commands:
pnpm run db:setup # Create the database in docker and seed it with example data pnpm run db:docker # Just create the database in docker without seeding it
-
Start the development server:
pnpm run dev:web pnpm run dev:backend
-
Open http://localhost:3000 in your browser to see the wiki.
NextWiki includes a powerful search system with several capabilities:
- Full-text search: Using PostgreSQL's tsvector/tsquery for efficient text search
- Fuzzy matching: Find content even when search terms have typos
- Highlighted results: Search results and matched terms are highlighted
- Multi-layer approach:
- Exact vector matching (highest relevance)
- Title matching (high relevance)
- Content matching (medium relevance)
- Similarity matching for typos (lower relevance)
When a user clicks a search result, they'll be taken directly to the page with all instances of the search term highlighted, and the view will automatically scroll to the first match.
This project uses a Turborepo monorepo structure:
├── apps/
│ ├── backend/ # Optional NestJS backend (Fastify)
│ └── web/ # Next.js frontend application
├── packages/
│ ├── auth/ # Authentication utilities (NextAuth)
│ ├── db/ # Drizzle ORM schema, migrations, and seeding
│ ├── eslint-config/ # Shared ESLint configuration
│ ├── logger/ # Shared logger configuration
│ ├── tailwind-config/ # Shared Tailwind CSS configuration
│ ├── types/ # Shared TypeScript types
│ ├── typescript-config/ # Shared TypeScript configuration
│ └── ui/ # Shared React UI components (Shadcn UI)
├── .github/ # GitHub Actions workflows
├── schema.dbml # Database schema ER diagram
├── assets/ # Static assets like images for README
├── docs/ # Project documentation
└── ... configuration files (pnpm, turbo, prettier, etc.)
We welcome contributions! Please see our CONTRIBUTING.md guide for details on how to get started. Even non-code contributions like documentation improvements, bug reports, and feature suggestions are appreciated!
This project is licensed under the MIT License - see the LICENSE file for details.