the main manager component of serve.zone
Go to file
2024-04-20 12:21:42 +02:00
.gitea/workflows fix(core): update 2024-04-20 12:21:41 +02:00
.vscode fix(core): update 2024-04-20 12:21:41 +02:00
html fix(core): update 2024-04-20 12:21:41 +02:00
scripts fix(core): update 2024-04-20 12:21:41 +02:00
test fix(core): update 2024-04-20 12:21:41 +02:00
ts fix(core): update 2024-04-20 12:21:41 +02:00
ts_apiclient fix(core): update 2024-04-20 12:21:41 +02:00
ts_cliclient fix(core): update 2024-04-20 12:21:41 +02:00
ts_web fix(core): update 2024-04-20 12:21:41 +02:00
.dockerignore fix(core): update 2024-04-20 12:21:41 +02:00
.gitignore fix(core): update 2024-04-20 12:21:41 +02:00
cli.child.ts fix(core): update 2024-04-20 12:21:41 +02:00
cli.js fix(core): update 2024-04-20 12:21:41 +02:00
cli.ts.js fix(core): update 2024-04-20 12:21:41 +02:00
Dockerfile fix(core): update 2024-04-20 12:21:41 +02:00
Dockerfile_cloudron_##version## fix(core): update 2024-04-20 12:21:41 +02:00
npmextra.json fix(core): update 2024-04-20 12:21:41 +02:00
package.json 1.0.214 2024-04-20 12:21:42 +02:00
pnpm-lock.yaml fix(core): update 2024-04-20 12:21:41 +02:00
qenv.yml fix(core): update 2024-04-20 12:21:41 +02:00
readme.hints.md fix(core): update 2024-04-20 12:21:41 +02:00
readme.md fix(core): update 2024-04-20 12:21:41 +02:00
tsconfig.json fix(core): update 2024-04-20 12:21:41 +02:00

@serve.zone/cloudly

configure the cloud

Install

To install @serve.zone/cloudly, run the following command in your terminal:

npm install @serve.zone/cloudly --save

This will install the package and add it to your project's package.json dependencies.

Usage

@serve.zone/cloudly is designed to help you manage and configure cloud environments. This package provides a comprehensive TypeScript and ESM-based interface for interacting with various cloud services, including Docker Swarmkit cluster management, and integration with cloud providers such as DigitalOcean, Hetzner Cloud, and Cloudflare.

Getting Started

Before diving into the specifics, ensure your environment is properly set up. This includes having Node.js installed (preferably the latest LTS version), and if you are working in a TypeScript project, ensure TypeScript is configured.

Initializing Cloudly

First, import Cloudly class from the package and initialize it as shown below:

import { Cloudly } from '@serve.zone/cloudly';

const myCloudlyInstance = new Cloudly();

The Cloudly class is the entry point to using the library features. It prepares the environment for configuring the cloud services.

Configuration

Configuration plays a pivotal role in how @serve.zone/cloudly operates. The library expects certain configurations to be provided, which can include credentials for cloud services, database connections, etc.

For example, to configure a connection to MongoDB, specify your MongoDB details as shown:

const myCloudlyConfig = {
    mongoDescriptor: {
        mongoDbUrl: 'mongodb+srv://<username>:<password>@<cluster>.mongodb.net/myFirstDatabase',
        mongoDbName: 'myDatabase',
        mongoDbUser: 'myUser',
        mongoDbPass: 'myPassword',
    },
    // Additional configuration values...
};

const myCloudlyInstance = new Cloudly(myCloudlyConfig);

Managing Docker Swarmkit Cluster

Cloudly allows managing Docker Swarmkit clusters through an abstracted interface, simplifying operations such as deployment and scaling.

// Assuming myCloudlyInstance is already configured and initialized

// Start the cloud instance
await myCloudlyInstance.start();

// Now you can perform various operations on your Docker Swarmkit cluster

Integration with Cloud Providers

@serve.zone/cloudly integrates seamlessly with cloud providers like DigitalOcean, Hetzner Cloud, etc., by leveraging the power of APIs provided by these platforms.

Managing DigitalOcean Resources

To manage DigitalOcean resources, you'll need to configure your DigitalOcean token and then use the provided interfaces to interact with the resources, such as creating droplets, managing volumes, etc.

// Set your DigitalOcean API token
const digitalOceanToken = "your_digital_ocean_api_token";

// Now you can use myCloudlyInstance to manage DigitalOcean resources

Using the Cloudflare Integration

Similarly, for managing DNS records and SSL certificates with Cloudflare, set up your Cloudflare API token:

const cloudflareToken = "your_cloudflare_api_token";

// Use myCloudlyInstance to interact with Cloudflare, such as setting DNS records

Advanced Usage

@serve.zone/cloudly offers more than just cloud resource management. It integrates various modules for error logging, security, working with JSON data, and much more. Explore the comprehensive documentation and typings to leverage the full potential of the package.

Conclusion

With @serve.zone/cloudly, configuring the cloud becomes a less tedious task. By abstracting away the complexities and providing a unified interface to manage cloud resources, development efficiency is significantly improved. The examples provided above merely scratch the surface of what's possible. Dive into the detailed documentation to explore all features and capabilities.

This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the license file within this repository.

Please note: The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.

Trademarks

This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.

Company Information

Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany

For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.

By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.