Dante Cloud Documentation

repository·master·Indexed 21 days ago

https://github.com/dromara/dante-cloud

An enterprise-grade, cloud-native microservices foundation built on the Spring ecosystem and Domain-Driven Design (DDD). It features a unique "one code, two architectures" approach, allowing the same codebase to run as either a monolith or microservices. The project is split into Dante Cloud (application runtime) and Dante Engine (core component library), supporting JDK 25+, Spring Boot 4.1.0, and Spring Cloud 2025.1.2.

Tokens
4.5K
Snippets
6
Records
17
Agent score
76%

What's inside Dante Cloud

  1. Overview of Dante Cloud

    master

    Dante Cloud is an enterprise-grade, cloud-native microservices foundation designed for high-quality code, low security vulnerabilities, and high modularity. It is built on the Spring ecosystem and utilizes Domain-Driven Design (DDD) principles.

    Key features include:

    • Dual-Architecture Support: A unique "one code, two architectures" approach that allows seamless switching between monolithic and microservices architectures using the same codebase.
    • Security-Focused: Supports IoT device authentication (Smart TVs, etc.), meets National Level 3 security requirements, and supports Chinese national cryptographic (Guomi) digital envelope encryption.
    • Modular & Extensible: Highly modular and componentized design, allowing for "pluggable" functionality and adaptation to various business scenarios.
    • High-Performance: Supports both blocking and reactive services in parallel.
  2. Determine if Dante Cloud is suitable for your project

    master

    Dante Cloud is an enterprise-grade technical middle-platform and cloud-native microservices foundation. It is built heavily on the Spring ecosystem (nearly 80% of core components are native Spring components).

    • Traditional Project Users: Start with the Monolith version (single-body) to experience front-back separation and multi-terminal adaptation, then migrate smoothly to the Microservices version.
    • Digital Transformation Users: Use the Microservices version directly to avoid the complexity of integrating fragmented base components and managing version compatibility.
    • Complex Project Users: Use the Microservices version to focus on business logic instead of infrastructure setup.
    • Startup Teams: Start with the Monolith version with proper module division to allow seamless migration to microservices later.
    • Technical Explorers: Use the project to explore new technologies integrated into business services.
    • Learners: Use the project to study elegant code implementation and clear domain partitioning following Spring ecosystem standards.
    • Users who strictly require a simple monolith architecture.
    • Projects that only require a Web terminal without mobile/mini-program/desktop support or scalability needs.
    • Users who only want to use mainstream technologies (like basic MySQL/MyBatis) without adopting new technical stacks.
    • Users seeking a feature-rich,
  3. Understand the Dante Cloud and Dante Engine relationship

    master

    Since version 2.7.X, the project has been split into two distinct engineering entities:

    1. Dante Cloud: The main application runtime and module combination engineering. It provides a set of microservices that can be flexibly split or assembled like Lego blocks.
    2. Dante Engine: The core component library engineering. It contains highly abstracted code designed for high reusability across different projects.

    Users typically interact with Dante Cloud to deploy systems, but can leverage the underlying component architecture for custom implementations.

  4. Understand the Dante Engine component structure

    master

    Dante Engine is the core component library for Dante Cloud. It is organized into several functional modules that provide infrastructure, business logic, and starters for microservices:

    • dante-assistant: Auxiliary modules for third-party login, captchas, and AWS SDK V2 OSS.
    • dante-data: Data access modules including dante-data-commons, dante-data-jpa, and dante-data-rest.
    • dante-framework: Core framework modules such as dante-autoconfigure, dante-cache, dante-core, dante-security, dante-spring, and dante-web.
    • dante-logic: Built-in business logic for identity (dante-logic-identity), messaging (dante-logic-message), and UPMS (dante-logic-upms).
    • dante-message: Messaging support including dante-message-emqx and dante-message-servlet-websocket.
    • dante-oauth2: OAuth2 authentication and authorization modules based on Spring Authorization Server.
    • dante-persistence: Data access layer modules like dante-persistence-sas-jpa.
    • dante-rest: REST interface modules for OSS, identity, messaging, and UPMS.
    • dante-starter: Spring Boot Starters for various features (cache, logging, OSS, multi-tenancy, web, etc.).
    dante-engine
    ├── dante-assistant
    ├── dante-data
    ├── dante-dependencies
    ├── dante-framework
    ├── dante-logic
    ├── dante-message
    ├── dante-oauth2
    ├── dante-persistence
    ├── dante-rest
    ├── dante-starter
    └── readme
  5. Set up a PostgreSQL database for the Dante Monolith application

    master

    To set up the database for the Dante Monolith version, you need to create a specific user and database. This script creates a user named athena with the password athena, initializes a database named dante_athena owned by that user, and grants full privileges to the user.

    Note: For production environments, you should adjust the privilege settings and credentials according to your security requirements.

    -- Create user athena with password 'athena'. Skip if user already exists.
    CREATE USER athena WITH PASSWORD 'athena';
    
    -- Create database dante_athena and assign owner to athena
    CREATE DATABASE dante_athena OWNER athena;
    
    -- Grant all privileges on dante_athena to athena. Adjust for production.
    GRANT ALL PRIVILEGES ON DATABASE dante_athena TO athena;
  6. Manually create default users in Nacos 3.2.0

    master

    Nacos 3.2.0 does not support automatic user creation. To set up the default user with credentials nacos / nacos, execute the following SQL script against your Nacos database. This creates a user named nacos with the corresponding hashed password and enabled status.

    INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);
  7. Customize component configurations using default templates

    master

    The configurations/scripts/tick/ directory contains default configuration files for components like InfluxDB and Telegraf. These files are exported based on official documentation to serve as templates for external custom configurations.

    To use these configurations in your own environment, follow the directory structure defined in the volumes configuration within env.tick.yml. Place your customized configuration files into the corresponding directories mapped by those volumes.

  8. Best practices for upgrading Dante Cloud

    master

    To ensure smooth upgrades and maintain compatibility with official releases, follow these guidelines:

    1. Minimize Customizations: Avoid modifying the source code of Dante Engine, Dante OSS, or other core components outside of your own project.
    2. Contribute Changes: If you must modify core components, submit a Pull Request to the official repository so your changes can be synchronized with future official updates.
    3. Consult Release Logs: Check the Official Update Logs for new features and improvements in each version.
    4. Follow Breaking Change Guides: For versions with significant architectural changes, refer to the Breaking Change Guides for specific migration instructions.
  9. Use application.properties for Nacos Docker environments

    master
    For Nacos Docker deployments, it is recommended to use the application.properties sourced from the official Nacos Docker repository. This version contains numerous environment variables that facilitate configuration via Docker environment settings. While you can use the application.properties from the nacos-server-3.2.0.zip release package, ensure you do not introduce errors during manual modification.
  10. Create a Nacos database using PostgreSQL

    master

    To set up a PostgreSQL database for Nacos, execute the following SQL commands. This script creates a dedicated user named nacos with the password nacos, creates a database named nacos owned by that user, and grants all privileges to the user.

    Note: In production environments, you should adjust the user permissions and password strength according to your security requirements.

    -- Create user nacos with password 'nacos'. If the user already exists, you can skip this.
    CREATE USER nacos WITH PASSWORD 'nacos';
    
    -- Create database nacos and assign the user nacos as the owner.
    CREATE DATABASE nacos OWNER nacos;
    
    -- Grant all privileges on the nacos database to the nacos user.
    -- Adjust this for production environments based on actual needs.
    GRANT ALL PRIVILEGES ON DATABASE nacos TO nacos;
  11. Configure nacos-logback.xml for Nacos 3.2.0 Docker deployment

    master
    When using Nacos 3.2.0 with Docker, you must enable plugins by mounting the Nacos configuration directory (conf) as a volume. The local directory used for this volume must contain the nacos-logback.xml file, otherwise the Nacos image will fail to start. This file is sourced from the official Nacos GitHub release package nacos-server-3.2.0.zip.
  12. Initialize PostgreSQL databases for Dante Cloud and Athena

    master

    To set up the required PostgreSQL databases for Dante Cloud and Athena, execute the following SQL commands. These scripts create dedicated users and databases with appropriate ownership and privileges.

    Dante Cloud Setup

    Creates a user herodotus and a database dante_cloud.

    Athena Setup

    Creates a user athena and a database dante_athena.

    Note: For production environments, you should adjust the GRANT ALL PRIVILEGES settings according to your security requirements.

    -- Dante Cloud Setup
    CREATE USER herodotus WITH PASSWORD 'herodotus';
    CREATE DATABASE dante_cloud OWNER herodotus;
    GRANT ALL PRIVILEGES ON DATABASE dante_cloud TO herodotus;
    
    -- Athena Setup
    CREATE USER athena WITH PASSWORD 'athena';
    CREATE DATABASE dante_athena OWNER athena;
    GRANT ALL PRIVILEGES ON DATABASE dante_athena TO athena;