Skip to content

Commit e0accd9

Browse files
committed
feat: Improve docs
1 parent 6953c26 commit e0accd9

29 files changed

Lines changed: 230 additions & 356 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN apt update && apt upgrade -y
1010
# Install necessary packages
1111
RUN apt install -y \
1212
build-essential git gh \
13+
mkdocs-material \
1314
protobuf-compiler \
1415
rustup \
1516
openjdk-21-jdk gradle

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@
2626
]
2727
}
2828
},
29-
"remoteUser": "${localEnv:USER:code}",
30-
"postStartCommand": "cargo clean"
29+
"remoteUser": "${localEnv:USER:code}"
3130
}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN cargo build -p controller --features wasm-plugins --release
1818
FROM alpine:latest
1919

2020
# Install necessary runtime dependencies
21-
RUN apk add --no-cache curl unzip
21+
RUN apk add --no-cache curl unzip openjdk21-jre
2222

2323
# Set the working directory
2424
WORKDIR /app

docker-compose.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ services:
1212
- PTERODACTYL=true
1313
- LOCAL=true
1414
volumes:
15-
- ./run/logs:/app/logs
16-
- ./run/auth:/app/auth
15+
- ./run/certs:/app/certs
1716
- ./run/configs:/app/configs
18-
- ./run/nodes:/app/nodes
1917
- ./run/groups:/app/groups
20-
- ./run/plugins:/app/plugins
18+
- ./run/logs:/app/logs
19+
- ./run/nodes:/app/nodes
20+
- ./run/plugins:/app/plugins
21+
- ./run/users:/app/users
22+
- ./run/data:/app/data

docs/api/jvm/channels.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Channels are a pub/sub (publish/subscribe) messaging system within Atomic Cloud
88
- [Prerequisites](#prerequisites)
99
- [Receiving Messages](#receiving-messages)
1010
- [Sending Messages](#sending-messages)
11-
- [Conclusion](#conclusion)
1211

1312
## What Are Channels?
1413

@@ -34,13 +33,12 @@ To receive messages from a channel, subscribe and register a message handler usi
3433
### Example
3534

3635
```java
37-
// Subscribe to the "party/invites" channel
38-
Cloud.channels().subscribe("party/invites");
39-
40-
// Register a handler to process incoming messages on "party/invites"
41-
Cloud.channels().registerHandler("party/invites", (message) -> {
42-
// Define your message handling logic here
43-
System.out.println("Received message: " + message);
36+
var channel = Cloud.channels().subscribeToStrings("testChannel");
37+
channel.handler(message -> {
38+
// A message was received from the channel.
39+
});
40+
channel.errorHandler(throwable -> {
41+
// Oh no! An error occurred while trying to receive a message from the channel.
4442
});
4543
```
4644

@@ -53,12 +51,7 @@ Sending messages is simple. Use the API to send a message to a channel, and all
5351
### Example
5452

5553
```java
56-
// Send a message to the "party/invites" channel
57-
Cloud.channels().sendMessage("party/invites", "test");
54+
Cloud.channels().publishString("testChannel", "MESSAGE");
5855
```
5956

60-
In this example, the string `"test"` is broadcast to all clients subscribed to the "party/invites" channel.
61-
62-
## Conclusion
63-
64-
Channels in Atomic Cloud offer a robust and secure method for inter‑server communication, allowing you to easily implement real‑time features with minimal setup. By following the steps above, you can integrate channels into your project to enable seamless, efficient messaging between distributed services.
57+
In this example, the string `"MESSAGE"` is broadcast to all clients subscribed to the "testChannel" channel.

docs/api/jvm/index.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,35 @@ To include the API in a **Maven** project, add the following dependency to your
1111
<dependency>
1212
<groupId>io.atomic.cloud</groupId>
1313
<artifactId>api</artifactId>
14-
<version>0.1.0-SNAPSHOT</version>
14+
<version>0.7.0-SNAPSHOT</version>
1515
</dependency>
1616
```
1717

1818
### **Gradle**
1919
For **Gradle** projects, add the following dependency to your `build.gradle.kts` file:
2020

2121
```kotlin
22+
repositories {
23+
mavenCentral()
24+
maven {
25+
url = uri("https://maven.pkg.github.com/HttpRafa/atomic-cloud")
26+
name = "GitHub Packages"
27+
credentials {
28+
username = project.findProperty("gpr.username") as String?
29+
password = project.findProperty("gpr.password") as String?
30+
}
31+
}
32+
}
33+
2234
dependencies {
23-
implementation("io.atomic.cloud:api:0.1.0-SNAPSHOT")
35+
implementation("io.atomic.cloud:api:0.7.0-SNAPSHOT")
2436
}
2537
```
2638

2739
If you're using Groovy-based Gradle (`build.gradle`), use:
2840

2941
```gradle
3042
dependencies {
31-
implementation 'io.atomic.cloud:api:0.1.0-SNAPSHOT'
43+
implementation 'io.atomic.cloud:api:0.7.0-SNAPSHOT'
3244
}
3345
```
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
# Command Line Interface (CLI)
1+
# What is the CLI?
22

3-
This guide provides instructions on how to download, install, and use the CLI tool for managing the controller.
3+
The **CLI** is an essential part of Atomic Cloud. Similar to how `kubectl` functions for Kubernetes, the CLI allows you to manage the cloud without needing to provide everyone with SSH access to the server.
44

5-
## Download the CLI
5+
# Installation
6+
This guide provides instructions on how to download, install, and use the CLI tool for managing the controller.
67

8+
## Step 1: Download
79
Download the latest CLI binary from the [GitHub releases page](https://github.com/HttpRafa/atomic-cloud/releases/).
810

9-
## Installation
10-
11-
1. **Download:**
12-
Choose and download the binary appropriate for your operating system.
13-
2. **Set Up PATH:**
14-
Place the downloaded binary in a directory that is included in your system's PATH. This ensures you can run the CLI from any terminal session.
11+
## Step 2: Set Up PATH
12+
Place the downloaded binary in a directory that is included in your system's PATH. This ensures you can run the CLI from any terminal session.
1513

16-
## Usage
14+
# Usage
1715

1816
- **Launching the CLI:**
1917
Open your terminal and run the CLI command.
2018
- **Interactive Guidance:**
21-
Follow the on-screen instructions provided by the CLI to control the controller and manage your cloud resources.
19+
Follow the on-screen instructions provided by the CLI to control the controller and manage your cloud network.
2220

2321
> **Note:**
2422
> We’re actively working to expand and enhance this documentation. Please check back soon for more detailed content and additional usage examples.
83.1 KB
Loading

docs/controller/index.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# What is the Controller?
2+
3+
The **Controller** is a vital component of Atomic Cloud. It acts as the central management server by:
4+
5+
- **Overseeing Nodes:**
6+
It monitors and manages the nodes.
7+
8+
- **Managing Servers:**
9+
It is responsible for initiating and supervising the servers launched by the cloud.
10+
11+
---
12+
13+
# Docker Installation (Recommended)
14+
15+
The most straightforward method to install the controller is by utilizing a Docker image. Follow the steps below to set it up using Docker Compose:
16+
17+
## Step 1: Create the `docker-compose.yml` File
18+
First, use a text editor to create the `docker-compose.yml` file:
19+
```bash
20+
nano docker-compose.yml
21+
```
22+
Next, add the following content to the file:
23+
```yaml
24+
services:
25+
controller:
26+
image: ghcr.io/httprafa/atomic-cloud:latest
27+
ports:
28+
- "8080:8080"
29+
environment:
30+
- PTERODACTYL=true # Enable Pterodactyl plugin installation
31+
- LOCAL=true # Enable Local plugin installation
32+
volumes:
33+
- ./certs:/app/certs
34+
- ./configs:/app/configs
35+
- ./groups:/app/groups
36+
- ./logs:/app/logs
37+
- ./nodes:/app/nodes
38+
- ./plugins:/app/plugins
39+
- ./users:/app/users
40+
- ./data:/app/data
41+
```
42+
43+
## Step 2: Start the Container
44+
To start the container, execute the following command:
45+
```bash
46+
docker compose up
47+
```
48+
49+
---
50+
51+
# Manual Installation
52+
53+
Follow the steps below to manually install Atomic Cloud.
54+
55+
## Step 1: Download the CLI and Controller
56+
57+
Download the latest release from our [GitHub releases page](https://github.com/HttpRafa/atomic-cloud/releases).
58+
59+
**Controller:** Choose the version that corresponds to the operating system where the Controller will run.
60+
61+
**CLI:** Choose the version that matches the operating system on your local machine, from which you will manage the cloud.
62+
63+
## Step 2: Start the Controller
64+
65+
1. Open a terminal and navigate to the directory where the Controller is located.
66+
2. Start the Controller.
67+
3. **Important:** After startup, note the authentication token that is displayed. You will need this token later.
68+
If you lose the token, you can retrieve it from our [token retrieval guide](../usage/controller/retrieve_token.md).
69+
70+
## Step 3: Download and Install the Plugin
71+
72+
1. Download the latest plugin version from our [GitHub releases page](https://github.com/HttpRafa/atomic-cloud/releases).
73+
2. Place the plugin file into the `plugins` folder.
74+
3. Restart the Controller to load the new plugin.
75+
76+
## Step 4: Start the CLI
77+
78+
1. Open a terminal on your local device where you want to control the cloud.
79+
2. Start the CLI application.
80+
3. When prompted, select **"Add new controller"** and follow the on-screen instructions to complete the setup.
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
## Retrieve the Admin Token on First Launch
22

3-
When you run the controller for the first time, an admin token will be displayed in the console. You will need this token to connect via the CLI. For more information, please refer to the [How to use the CLI](../usage/cli/index.md) guide.
4-
5-
![First Startup](images/first_startup.png)
6-
3+
When you run the controller for the first time, an admin token will be displayed in the console. You will need this token to connect via the CLI. For more information, please refer to the [How to use the CLI](../cli/index.md) guide.
74

5+
![First Startup](image/first_startup.png)
86

97
## Retrieve the Admin Token After the First Launch
108

11-
If you lose the token after the initial launch, you can retrieve it from the default admin user's file. The file is located in the `auth/users` directory within your controller's installation folder.
9+
If you lose the token after the initial launch, you can retrieve it from the default admin user's file. The file is located in the `users` directory within your controller's installation folder.

0 commit comments

Comments
 (0)