中文版 | English
Light Chaser data visualization editor backend basic open source version
- Java 17
- SpringBoot 3.2.5
- Mybatis Plus 3.5.5
- SQLite Database (Out-of-the-box)
- Clone the project
git clone https://github.com/xiaopujun/light-chaser-server.git
- Run the project (automatically creates SQLite database)
mvn spring-boot:run
After the project starts, it will automatically:
- Create SQLite database file (
./data/light_chaser_server.db
) - Execute database initialization scripts
- Store uploaded resource files in the
./data/resources
directory
The project uses SQLite database by default with the following advantages:
- No need to install database server
- Out-of-the-box, automatically creates database files
- Lightweight, suitable for development and small deployments
- Database file location:
./data/light_chaser_server.db
To modify the database path or other configurations, adjust in application.yml:
spring:
datasource:
url: jdbc:sqlite:./data/light_chaser_server.db # SQLite database file path
light-chaser:
project-resource-path: ./data/resources # Project resource path
source-image-path: /static/images/ # Project image component upload path
cover-path: /static/covers/ # Project cover path
migration: # Whether to automatically run database migration scripts
enable: true
The project supports connection testing for multiple database types:
- SQLite - Default database, ready to use
- MySQL - Full support with connection pooling and configuration optimization
- PostgreSQL - Complete driver support with timeout configuration
- Oracle - Enterprise database support with connection management
- SQL Server - Microsoft SQL Server support with SSL configuration
Use the REST API to test database connections:
# Test SQLite connection (default)
curl http://localhost:8080/api/datasource/test/1
# Add and test other database types
curl -X POST -H "Content-Type: application/json" -d '{
"name": "MySQL Test",
"type": 1,
"username": "root",
"password": "password",
"url": "localhost:3306/testdb",
"des": "MySQL database test connection"
}' http://localhost:8080/api/datasource/add
Database | Type ID | Default Port | URL Format |
---|---|---|---|
SQLite | 0 | - | jdbc:sqlite:./data/database.db |
MySQL | 1 | 3306 | jdbc:mysql://localhost:3306/dbname |
PostgreSQL | 2 | 5432 | jdbc:postgresql://localhost:5432/dbname |
Oracle | 3 | 1521 | jdbc:oracle:thin:@localhost:1521/XE |
SQL Server | 4 | 1433 | jdbc:sqlserver://localhost:1433;databaseName=dbname |
- Multi-database Connection Management - Support for mainstream databases
- Intelligent URL Normalization - Automatic completion of incomplete database URLs
- Connection Pool Optimization - HikariCP with database-specific configurations
- Friendly Error Handling - Detailed error messages with solutions
- Data Visualization Backend - RESTful APIs for data visualization editor
- File Upload Management - Support for images and project files
- Database Migration System - Automatic schema versioning and updates
- Java 17 or higher
- Maven 3.6+
- Git
mvn clean compile
mvn test
mvn clean package
GET /api/datasource/list
- Get all data sourcesPOST /api/datasource/add
- Add new data sourceGET /api/datasource/test/{id}
- Test data source connectionPOST /api/datasource/update
- Update data sourceDELETE /api/datasource/del/{id}
- Delete data source
- File upload and management
- Project configuration and data persistence
- Cover image handling
Apache License 2.0
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
If you encounter any issues or have questions, please create an issue in the GitHub repository.