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
- Version History: Track changes (in progress)
- 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 (in progress)
- Framework: Next.js
- Database: PostgreSQL with Drizzle ORM
- API: Type-safe APIs with tRPC
- Authentication: NextAuth.js
- Search: PostgreSQL full-text search with trigram similarity for fuzzy matching
- Styling: Tailwind CSS
- Deployment: Compatible with Vercel, Netlify, or self-hosted
- Permissions: Control who can view and edit content
- Centralized settings: Manage your wiki from a central settings page, with everything stored in the database
- S3 Asset Storage: Store assets in S3 or somewhere else
- Tags & Categories: Organize your content effectively
- Better version history: Track changes and revert to previous versions
- Real-time Collaboration: Multiple users can edit pages simultaneously
- Typo tolerance: Fuzzy search with typo tolerance
- PDF Upload: Upload PDFs to the wiki
- Video Upload: Upload videos to the wiki
- Audio Upload: Upload audio to the wiki
- Node.js 18+ (pnpm recommended)
- 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 .env.example .env.local
Update the values in
.env.local
with your database and authentication settings. -
Set up the database:
pnpm run db:setup # Create the database in docker pnpm run db:generate # Generate migrations pnpm run db:migrate # Apply migrations
-
Start the development server:
pnpm run dev
-
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) (in progress)
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.
├── drizzle/ # Database migrations
├── public/ # Static assets
├── src/
│ ├── app/ # Next.js app router
│ ├── components/ # React components
│ │ ├── auth/ # Authentication components
│ │ ├── layout/ # Layout components
│ │ ├── ui/ # UI components
│ │ └── wiki/ # Wiki-specific components
│ ├── lib/ # Shared libraries
│ │ ├── db/ # Database connection and schema
│ │ ├── utils/ # Utility functions
│ │ ├── services/ # Database service functions (one layer above the drizzle layer)
│ │ └── trpc/ # tRPC routers and procedures
│ └── types/ # TypeScript type definitions
└── ... configuration files
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.