Skip to content

Quick Start

This guide will help you quickly set up the NiteMoon AI Platform development environment and create your first AI application.

Prerequisites

SoftwareVersionDescription
Java17+JDK 17 or higher
Maven3.8+Build tool
MySQL8.0+Relational database
Redis6.0+Cache and vector storage
Neo4j5.0+Graph database (optional)
Node.js18+Frontend development (optional)

Installation Steps

1. Clone the Project

bash
git clone https://github.com/Nutgin/NiteMoon-Cloud.git
cd NiteMoon-Cloud

2. Configure Database

Create the MySQL database:

sql
CREATE DATABASE nitemoon DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Import the database scripts:

bash
mysql -u root -p nitemoon < docs/sql/nitemoon.sql

3. Configure Redis

Ensure the Redis service is running:

bash
redis-cli ping
# Should return PONG

4. Configure Application

Edit the configuration file nitemoon-boot/src/main/resources/application.yml:

yaml
spring:
  datasource:
    url: jdbc:mysql://localhost:3306/nitemoon?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
    username: root
    password: your_password
  
  data:
    redis:
      host: localhost
      port: 6379
      password: # If a password is set

# LLM configuration (choose one)
llm:
  providers:
    openai:
      api-key: ${OPENAI_API_KEY}
      base-url: https://api.openai.com/v1

5. Start the Application

bash
# Build the project
mvn clean install -DskipTests

# Start the application (standalone mode)
cd nitemoon-boot
mvn spring-boot:run

6. Access the System

After successful startup, access the following URLs:

ServiceURLDescription
Admin Dashboardhttp://localhost:8000/bootBackend management system
API Documentationhttp://localhost:8000/boot/doc.htmlKnife4j API documentation

Default admin credentials:

  • Username: admin
  • Password: admin123

Your First Application

1. Configure LLM Model

Log in to the admin dashboard, navigate to System Management -> Model Configuration, and add an LLM model:

FieldValue
ProviderOpenAI
Model Namegpt-4
API Keyyour_api_key
API Endpointhttps://api.openai.com/v1

2. Create Knowledge Base

Navigate to Knowledge Base Management -> Knowledge Base List and create a knowledge base:

FieldValue
NameProduct Documentation
DescriptionProduct-related documents

3. Upload Documents

On the knowledge base detail page, upload documents:

  • Supported formats: PDF, Word, TXT, Markdown
  • Automatic parsing and chunking
  • Automatic embedding vector generation

4. Create Chat Application

Navigate to Application Management -> Application List and create a chat application:

FieldValue
NameSmart Customer Service
Modelgpt-4
Knowledge BaseProduct Documentation
System PromptYou are a professional customer service assistant...

5. Test the Conversation

On the application detail page, click Chat Test and enter a question:

User: How do I configure a RAG knowledge base?
AI: The steps to configure a RAG knowledge base are as follows:
1. Go to the Knowledge Base Management page
2. Create a new knowledge base
3. Upload documents
4. Configure retrieval parameters
5. Associate the knowledge base with your application

Troubleshooting

Database Connection Failure

Issue: Startup throws Communications link failure

Solution:

  1. Check if the MySQL service is running
  2. Verify the database connection configuration is correct
  3. Check firewall settings
bash
# Test MySQL connection
mysql -u root -p -h localhost

Redis Connection Failure

Issue: Startup throws Unable to connect to Redis

Solution:

  1. Check if the Redis service is running
  2. Verify the Redis configuration is correct
  3. Check Redis password settings
bash
# Test Redis connection
redis-cli ping

Model Call Failure

Issue: Chat throws Model call failed

Solution:

  1. Check if the API Key is correct
  2. Verify the API endpoint is accessible
  3. Check if the model name is correct
  4. Ensure sufficient account balance
bash
# Test API connection
curl https://api.openai.com/v1/models \
  -H "Authorization: Bearer your_api_key"

Knowledge Base Retrieval Failure

Issue: RAG retrieval returns empty results

Solution:

  1. Check if documents were uploaded and parsed successfully
  2. Verify the embedding model is configured correctly
  3. Check if the vector storage is functioning properly
  4. Adjust the similarity threshold

Out of Memory

Issue: Startup throws OutOfMemoryError

Solution:

  1. Increase JVM memory:
bash
java -Xmx4g -jar nitemoon-boot.jar
  1. Reduce connection pool size
  2. Optimize query statements

Next Steps

Online Demo

Try the live demo at: platform.nitemoon.cn

  • Username: demo
  • Password: UhOtrDnzRh

Get Help

  • GitHub Issues: Submit issues and suggestions
  • Documentation: Review detailed documentation
  • Community: Join the developer community
  • Email: nutgin@foxmail.com

Copyright © 2023-2026 nitemoon.cn All Rights Reserved