Quick Start
This guide will help you quickly set up the NiteMoon AI Platform development environment and create your first AI application.
Prerequisites
| Software | Version | Description |
|---|---|---|
| Java | 17+ | JDK 17 or higher |
| Maven | 3.8+ | Build tool |
| MySQL | 8.0+ | Relational database |
| Redis | 6.0+ | Cache and vector storage |
| Neo4j | 5.0+ | Graph database (optional) |
| Node.js | 18+ | Frontend development (optional) |
Installation Steps
1. Clone the Project
git clone https://github.com/Nutgin/NiteMoon-Cloud.git
cd NiteMoon-Cloud2. Configure Database
Create the MySQL database:
CREATE DATABASE nitemoon DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;Import the database scripts:
mysql -u root -p nitemoon < docs/sql/nitemoon.sql3. Configure Redis
Ensure the Redis service is running:
redis-cli ping
# Should return PONG4. Configure Application
Edit the configuration file nitemoon-boot/src/main/resources/application.yml:
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/v15. Start the Application
# Build the project
mvn clean install -DskipTests
# Start the application (standalone mode)
cd nitemoon-boot
mvn spring-boot:run6. Access the System
After successful startup, access the following URLs:
| Service | URL | Description |
|---|---|---|
| Admin Dashboard | http://localhost:8000/boot | Backend management system |
| API Documentation | http://localhost:8000/boot/doc.html | Knife4j 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:
| Field | Value |
|---|---|
| Provider | OpenAI |
| Model Name | gpt-4 |
| API Key | your_api_key |
| API Endpoint | https://api.openai.com/v1 |
2. Create Knowledge Base
Navigate to Knowledge Base Management -> Knowledge Base List and create a knowledge base:
| Field | Value |
|---|---|
| Name | Product Documentation |
| Description | Product-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:
| Field | Value |
|---|---|
| Name | Smart Customer Service |
| Model | gpt-4 |
| Knowledge Base | Product Documentation |
| System Prompt | You 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 applicationTroubleshooting
Database Connection Failure
Issue: Startup throws Communications link failure
Solution:
- Check if the MySQL service is running
- Verify the database connection configuration is correct
- Check firewall settings
# Test MySQL connection
mysql -u root -p -h localhostRedis Connection Failure
Issue: Startup throws Unable to connect to Redis
Solution:
- Check if the Redis service is running
- Verify the Redis configuration is correct
- Check Redis password settings
# Test Redis connection
redis-cli pingModel Call Failure
Issue: Chat throws Model call failed
Solution:
- Check if the API Key is correct
- Verify the API endpoint is accessible
- Check if the model name is correct
- Ensure sufficient account balance
# 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:
- Check if documents were uploaded and parsed successfully
- Verify the embedding model is configured correctly
- Check if the vector storage is functioning properly
- Adjust the similarity threshold
Out of Memory
Issue: Startup throws OutOfMemoryError
Solution:
- Increase JVM memory:
java -Xmx4g -jar nitemoon-boot.jar- Reduce connection pool size
- Optimize query statements
Next Steps
- API Reference - Learn about the RESTful API
- Code Examples - View more examples
- Technical Architecture - Understand the system architecture
- Feature Overview - Explore platform features
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