A modern, open-source wiki encyclopedia system built with Node.js, Express.js, and Markdown. 中文文档
- Markdown Editor - Write articles with a rich Markdown editor supporting live preview
- User Authentication - Secure user registration and login system with bcrypt password hashing
- Theme System - 8 beautiful themes including dark, light, cyberpunk, forest, and more
- Tag System - Organize articles with colorful tags
- Search Functionality - Full-text search across all articles
- Responsive Design - Mobile-friendly UI with modern aesthetics
- Image Support - Upload and display images in articles
- External Database - Flexible database integration via REST API
- Backend: Node.js, Express.js
- Frontend: Vanilla JavaScript, HTML5, CSS3
- Authentication: Express Session, bcryptjs
- Database: External REST API integration
- Markdown: Custom MDParser library
NeoWiki/
├── src/
│ ├── server.js # Main Express server
│ ├── config.js # Configuration management
│ ├── database.js # Database API integration
│ ├── middleware/
│ │ └── auth.js # Authentication middleware
│ └── routes/
│ ├── api.js # General API routes
│ ├── articles.js # Article CRUD operations
│ └── users.js # User management
├── public/
│ ├── index.html # Landing page
│ ├── home.html # Homepage with article list
│ ├── article.html # Article viewer
│ ├── editor.html # Markdown editor
│ ├── search.html # Search page
│ ├── login.html # Login page
│ ├── register.html # Registration page
│ ├── admin.html # Admin dashboard
│ ├── settings.html # User settings
│ ├── user.html # User profile
│ ├── css/
│ │ └── style.css # Global styles
│ ├── js/
│ │ ├── api.js # API client
│ │ ├── components.js # Reusable UI components
│ │ ├── theme.js # Theme management
│ │ └── wiki-settings.js # Wiki configuration
│ └── lib/
│ ├── MDParser.js # Markdown parser
│ ├── editor-app.js # Editor functionality
│ └── editor-styles.css # Editor styles
├── uploads/ # User uploaded files
├── package.json
└── .env.example
- Node.js >= 14.0.0
- npm or yarn
- Clone the repository:
git clone https://github.com/SoraStr/NeoWiki.git
cd NeoWiki- Install dependencies:
npm install- Configure environment variables:
cp .env.example .env
# Edit .env with your database API endpoint- Start the server:
npm start- Open your browser and visit
http://localhost:3000
On first run, you'll be prompted to:
- Set your wiki name and description
- Create an admin account
Create a .env file in the project root:
PORT=3000
DATABASE_API_URL=https://your-database-api.com
SESSION_SECRET=your-secret-key-hereCustomize your wiki through the admin panel:
- Wiki name and description
- Logo (emoji or image URL)
- Feature cards
- Available themes
- Vocaloid Dark (default) - Purple and pink gradient theme
- Light - Clean white theme
- Sepia - Warm paper-like theme
- Cyberpunk - Neon-infused dark theme
- Forest - Natural green theme
- Ocean - Deep blue theme
- Sunset - Warm orange gradient
- Hacker - Terminal-style theme
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/articles |
List all articles |
| GET | /api/articles/:id |
Get article by ID |
| POST | /api/articles |
Create new article |
| PUT | /api/articles/:id |
Update article |
| DELETE | /api/articles/:id |
Delete article |
| GET | /api/articles/search?q= |
Search articles |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/register |
Register new user |
| POST | /api/login |
User login |
| POST | /api/logout |
User logout |
| GET | /api/user |
Get current user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/users |
List all users |
| PUT | /api/admin/users/:id/role |
Update user role |
| DELETE | /api/admin/users/:id |
Delete user |
| GET | /api/admin/settings |
Get site settings |
| PUT | /api/admin/settings |
Update site settings |
npm run devThe project uses vanilla JavaScript with consistent naming conventions:
- CamelCase for functions and variables
- PascalCase for component constructors
Edit public/css/style.css and add a new [data-theme="theme-name"] selector with your color variables.
The custom MDParser in public/lib/MDParser.js can be extended to support additional Markdown syntax.
Modify src/database.js to connect to your preferred database while maintaining the same API interface.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Express.js team for the web framework
- The open-source community for various utilities