Relevant source files
This page provides a quick start guide for setting up and running the yuncang warehouse management system. It covers the essential prerequisites, deployment options, and verification steps to get the system operational.
For detailed Docker deployment instructions, see Docker Deployment. For development environment setup and build processes, see Development Environment. For comprehensive system architecture details, see System Architecture.
The yuncang system is a Spring Boot 3 application built with Java 21 that provides comprehensive warehouse management capabilities including inventory tracking, order processing, and AGV automation. The system uses MySQL for persistent data storage and Redis for caching and session management.
flowchart TD
APP["yuncang-app:8080"]
JAR["yuncang-0.0.1-SNAPSHOT.jar"]
MAIN["YuncangApplication.class"]
MYSQL["yuncang-mysql:3307"]
REDIS["yuncang-redis:6380"]
DOCKER["docker-compose.yml"]
POM["pom.xml"]
DOCKERFILE["Dockerfile"]
MYSQLDATA["./docker/mysql/data"]
REDISDATA["./docker/redis/data"]
INITSCRIPT["./docker/mysql/init.sql"]
DOCKER --> APP
DOCKER --> MYSQL
DOCKER --> REDIS
APP --> MYSQL
APP --> REDIS
MYSQL --> MYSQLDATA
MYSQL --> INITSCRIPT
REDIS --> REDISDATA
subgraph subGraph3 ["Data Persistence"]
MYSQLDATA
REDISDATA
INITSCRIPT
end
subgraph subGraph2 ["Configuration Files"]
DOCKER
POM
DOCKERFILE
end
subgraph subGraph1 ["Database Services"]
MYSQL
REDIS
end
subgraph subGraph0 ["Application Container"]
APP
JAR
MAIN
APP --> JAR
JAR --> MAIN
end
Sources: docker-compose.yml L1-L55
flowchart TD
KNIFE4J["knife4j-openapi3-jakarta-spring-boot-starter:4.1.0"]
SPRINGBOOT["spring-boot-starter-parent:3.4.4"]
SECURITY["spring-boot-starter-security"]
WEB["spring-boot-starter-web"]
MYBATISPLUS["mybatis-plus-spring-boot3-starter:3.5.12"]
MYSQL_CONN["mysql-connector-j"]
REDIS_STARTER["spring-boot-starter-data-redis"]
JWT["java-jwt:4.3.0"]
FASTJSON["fastjson2:2.0.51"]
LOMBOK["lombok:1.18.30"]
WEB --> MYBATISPLUS
SECURITY --> JWT
WEB --> REDIS_STARTER
subgraph subGraph2 ["Security & Utilities"]
JWT
FASTJSON
LOMBOK
end
subgraph subGraph1 ["Data Layer"]
MYBATISPLUS
MYSQL_CONN
REDIS_STARTER
MYBATISPLUS --> MYSQL_CONN
end
subgraph subGraph0 ["Application Layer"]
SPRINGBOOT
SECURITY
WEB
SPRINGBOOT --> WEB
SPRINGBOOT --> SECURITY
end
subgraph Documentation ["Documentation"]
KNIFE4J
end
Sources: pom.xml L32-L132
Before running the yuncang system, ensure you have the following installed:
| Requirement | Version | Purpose |
|---|---|---|
| Docker | Latest | Container runtime for services |
| Docker Compose | Latest | Multi-container orchestration |
| Java | 21+ | Development and build (if building from source) |
| Maven | 3.6+ | Build tool (if building from source) |
The fastest way to get yuncang running is using the provided Docker Compose configuration:
- Clone the repository
- Start all services:
docker-compose up -d
This command will:
- Build the Spring Boot application using the
Dockerfile - Start MySQL 8.0 on port 3307 with the
yuncangdatabase - Start Redis 6.2 on port 6380
- Start the yuncang application on port 8080
- Initialize the database schema using the init script
For development and debugging, you can run the services separately:
- Start infrastructure services:
docker-compose up -d db redis - Run the application locally (requires Java 21 and Maven)
For detailed development setup, see Development Environment.
The Docker Compose setup configures the following service connections:
| Service | Container Name | Host Port | Internal Port | Configuration |
|---|---|---|---|---|
| Application | yuncang-app |
8080 | 8080 | Spring Boot application |
| MySQL | yuncang-mysql |
3307 | 3306 | Database with empty root password |
| Redis | yuncang-redis |
6380 | 6379 | Cache and session store |
The application container is configured with these key environment variables:
flowchart TD
DB_URL["SPRING_DATASOURCE_URL"]
DB_USER["SPRING_DATASOURCE_USERNAME"]
DB_PASS["SPRING_DATASOURCE_PASSWORD"]
REDIS_HOST["SPRING_DATA_REDIS_HOST"]
REDIS_PORT["SPRING_DATA_REDIS_PORT"]
REDIS_DB["SPRING_DATA_REDIS_DATABASE"]
DB_SERVICE["db:3306"]
REDIS_SERVICE["redis:6379"]
DB_URL --> DB_SERVICE
REDIS_HOST --> REDIS_SERVICE
REDIS_PORT --> REDIS_SERVICE
subgraph subGraph2 ["Service Discovery"]
DB_SERVICE
REDIS_SERVICE
end
subgraph subGraph1 ["Redis Configuration"]
REDIS_HOST
REDIS_PORT
REDIS_DB
end
subgraph subGraph0 ["Database Configuration"]
DB_URL
DB_USER
DB_PASS
end
Sources: docker-compose.yml L46-L54
After starting the system, verify it's running correctly:
# Check all containers are running
docker-compose ps
# Check application logs
docker-compose logs app
# Check database connection
docker-compose logs db| Endpoint | Purpose | Expected Response |
|---|---|---|
http://localhost:8080 |
Application health | Application response |
http://localhost:8080/doc.html |
API documentation | Knife4j Swagger UI |
The MySQL service should be accessible at localhost:3307 with:
- Username:
root - Password: `` (empty)
- Database:
yuncang
If you encounter port conflicts, modify the port mappings in docker-compose.yml L12-L45
:
ports:
- "3308:3306" # Change MySQL port
- "6381:6379" # Change Redis port
- "8081:8080" # Change application portIf the application container fails to build, ensure the JAR file exists:
# Build the JAR file first
mvn clean package -DskipTests
# Then rebuild containers
docker-compose build --no-cacheOnce the system is running successfully:
- Production Deployment: See Docker Deployment for production-ready configuration options, including volume mounts and environment-specific settings.
- Development Setup: See Development Environment for IDE configuration, debugging setup, and development workflow.
- System Configuration: Explore System Administration for configuring factory settings and user management.
- API Exploration: Use the Swagger UI at
http://localhost:8080/doc.htmlto explore available endpoints, or refer to API Reference for detailed documentation.
Sources: docker-compose.yml L1-L55