Skip to content

SoraStr/NeoWiki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NeoWiki

A modern, open-source wiki encyclopedia system built with Node.js, Express.js, and Markdown. δΈ­ζ–‡ζ–‡ζ‘£

License Node Express

Features

  • 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

Tech Stack

  • Backend: Node.js, Express.js
  • Frontend: Vanilla JavaScript, HTML5, CSS3
  • Authentication: Express Session, bcryptjs
  • Database: External REST API integration
  • Markdown: Custom MDParser library

Project Structure

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

Getting Started

Prerequisites

  • Node.js >= 14.0.0
  • npm or yarn

Installation

  1. Clone the repository:
git clone https://github.com/SoraStr/NeoWiki.git
cd NeoWiki
  1. Install dependencies:
npm install
  1. Configure environment variables:
cp .env.example .env
# Edit .env with your database API endpoint
  1. Start the server:
npm start
  1. Open your browser and visit http://localhost:3000

First-Time Setup

On first run, you'll be prompted to:

  1. Set your wiki name and description
  2. Create an admin account

Configuration

Environment Variables

Create a .env file in the project root:

PORT=3000
DATABASE_API_URL=https://your-database-api.com
SESSION_SECRET=your-secret-key-here

Wiki Settings

Customize your wiki through the admin panel:

  • Wiki name and description
  • Logo (emoji or image URL)
  • Feature cards
  • Available themes

Available Themes

  1. Vocaloid Dark (default) - Purple and pink gradient theme
  2. Light - Clean white theme
  3. Sepia - Warm paper-like theme
  4. Cyberpunk - Neon-infused dark theme
  5. Forest - Natural green theme
  6. Ocean - Deep blue theme
  7. Sunset - Warm orange gradient
  8. Hacker - Terminal-style theme

API Reference

Articles

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

Users

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

Admin

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

Development

Running in Development

npm run dev

Code Style

The project uses vanilla JavaScript with consistent naming conventions:

  • CamelCase for functions and variables
  • PascalCase for component constructors

Customization

Adding New Themes

Edit public/css/style.css and add a new [data-theme="theme-name"] selector with your color variables.

Extending the Markdown Parser

The custom MDParser in public/lib/MDParser.js can be extended to support additional Markdown syntax.

Integrating Different Databases

Modify src/database.js to connect to your preferred database while maintaining the same API interface.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

  • Express.js team for the web framework
  • The open-source community for various utilities

About

NeoWiki is a fast, Javascript-based Markdown Wiki System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors