Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 477b8fd

Browse files
committed
feat: getting-started pages
1 parent 4fe1150 commit 477b8fd

File tree

3 files changed

+416
-0
lines changed

3 files changed

+416
-0
lines changed

getting-started/config-file.mdx

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
---
2+
title: "How to create your squarecloud.app config file"
3+
sidebarTitle: "Config file"
4+
icon: "gear-complex-code"
5+
description: "Learn how to create your Square Cloud configuration file"
6+
---
7+
8+
## Configuration file? What is it? 🤔
9+
The configuration file is a file that contains the parameters of your application, such as the main file, memory, version, and other parameters. This file is used to configure and deploy your application on the Square Cloud platform.
10+
11+
## Creating the configuration file
12+
It's very simple to create the configuration file, just create a file with the name `squarecloud.app` or `squarecloud.config` and put the configuration parameters inside it.
13+
14+
<Steps>
15+
<Step title="Select extension">
16+
The configuration file can have two extensions: **.app** or **.config**. You can choose the extension you prefer. Tip: use **.app** to help promote Square (squarecloud.app). 😂
17+
<Info>In **macOS**, we recommend using the **.config** extension.</Info>
18+
<Warning>Note: **.app** or **.config** is the **file extension**, **not the name**.</Warning>
19+
20+
</Step>
21+
<Step title="Create file">
22+
Create a file with the extension you selected and put the configuration parameters inside it.
23+
</Step>
24+
</Steps>
25+
26+
## Configuration parameters
27+
Below you can see the configuration parameters that you can use in your configuration file.
28+
29+
<Steps>
30+
<Step title="MAIN [*]" icon="file">
31+
The **MAIN** parameter is used to define the main file of your application.
32+
```systemd Example:
33+
MAIN=index.js
34+
```
35+
```systemd Also, support subdirectories.
36+
MAIN=src/loaders/index.js
37+
```
38+
<Info>This parameter has maximum of **32 characters**.</Info>
39+
<Info>This configuration is **IGNORED** if you use START parameter.</Info>
40+
</Step>
41+
<Step title="MEMORY [*]" icon="memory">
42+
The **MEMORY** parameter is used to define the amount of memory that your application will use on the Square Cloud platform.
43+
```systemd
44+
MEMORY=256
45+
```
46+
<Info>The value is in megabytes (MB).</Info>
47+
<Note>The minimum memory for a bot is **512MB** and for a website is **512MB**.</Note>
48+
</Step>
49+
<Step title="VERSION [*]" icon="arrow-up-9-1">
50+
The **VERSION** parameter is used to define the version of your application.
51+
```systemd
52+
VERSION=recommended
53+
```
54+
<Info>For each language there is a different version, see the table below.</Info>
55+
| Language | Version `recommended` | Version `latest` |
56+
| ------------------------ | ---------------------- | ---------------- |
57+
| JavaScript [Node.js] | 20.9.0 (LTS - 2023) | 21.1.0 |
58+
| Python | 3.11.6 | 3.12 |
59+
| Java | JDK 17 | JDK 18 |
60+
| Elixir | 1.15.4 | 1.15.4 |
61+
| Rust | 1.76.0 | 1.76.0 |
62+
| PHP | 8.2.10 | 8.2.10 |
63+
| Go | 1.21.3 | 1.21.3 |
64+
| HTML/CSS | Build 07-29-23 | Build 07-29-23 |
65+
66+
<Tip>We recommend using the `recommended` version as our team has performed extensive testing on all recommended versions.</Tip>
67+
</Step>
68+
<Step title="DISPLAY_NAME [*]" icon="text">
69+
The **DISPLAY_NAME** parameter is used to define the name of your application.
70+
```systemd Example:
71+
DISPLAY_NAME=Admin BOT
72+
```
73+
<Info>This parameter has maximum of **32 characters**.</Info>
74+
</Step>
75+
<Step title="DESCRIPTION" icon="text">
76+
The **DESCRIPTION** parameter is used to define the description of your application.
77+
```systemd Example:
78+
DESCRIPTION=This bot is designed to help you with your daily tasks.
79+
```
80+
<Info>This parameter has maximum of **280 characters**.</Info>
81+
</Step>
82+
<Step title="AUTORESTART" icon="rotate">
83+
The **AUTORESTART** parameter is used to define if your application should restart automatically if it crashes.
84+
```systemd Example:
85+
AUTORESTART=true
86+
```
87+
<Info>By default, this parameter is set to `false`.</Info>
88+
</Step>
89+
<Step title="SUBDOMAIN" icon="globe">
90+
The **SUBDOMAIN** parameter is used to define the subdomain of your website.
91+
```systemd Example:
92+
SUBDOMAIN=mysite
93+
```
94+
<Info>This parameter has maximum of **63 characters**.</Info>
95+
<Note>Website url will be: mysite.squareweb.app</Note>
96+
</Step>
97+
<Step title="START" icon="play">
98+
The **START** parameter is used to define a custom startup command for your application.
99+
```systemd Example:
100+
START=npm run start
101+
```
102+
<Info>This parameter has maximum of **128 characters**.</Info>
103+
<Info>This parameter **ignores** the MAIN parameter, which is used to join Square's standardized initialization commands.</Info>
104+
</Step>
105+
</Steps>
106+
107+
108+
## Examples of configuration for bots
109+
We have some examples of configurations for bots, below you can see some examples.
110+
111+
```systemd This example just use required parameters. (minimum configuration)
112+
MAIN=index.js
113+
MEMORY=256
114+
VERSION=recommended
115+
DISPLAY_NAME=Robin bot
116+
```
117+
118+
```systemd This example is a bot with all parameters.
119+
MAIN=index.js
120+
MEMORY=256
121+
VERSION=recommended
122+
DISPLAY_NAME=Robin bot
123+
DESCRIPTION=Robin is a bot designed to help you with your daily tasks.
124+
AUTORESTART=true
125+
```
126+
127+
```systemd This example use all parameters and CUSTOM STARTUP COMMAND in a bot.
128+
MAIN=index.js
129+
MEMORY=512
130+
VERSION=recommended
131+
DISPLAY_NAME=Batman force
132+
START=npm run start
133+
```
134+
135+
## Examples of configuration for websites
136+
We have some examples of configurations for websites, below you can see some examples.
137+
138+
<Info>Website url will be: mysite.squareweb.app</Info>
139+
```systemd This example use all parameters and CUSTOM STARTUP COMMAND in a website.
140+
MAIN=index.js
141+
MEMORY=512
142+
VERSION=recommended
143+
DISPLAY_NAME=My website!
144+
DESCRIPTION=My website is very cool!
145+
SUBDOMAIN=mysite
146+
START=npm run build && npm run start
147+
AUTORESTART=true
148+
```
149+
150+
<Info>MAIN `next.config.js` used only to system recognize the project as a JavaScript project or TypeScript project (another .ts/.tsx file)</Info>
151+
```systemd Next.js website example.
152+
MAIN=next.config.js
153+
MEMORY=1024
154+
VERSION=recommended
155+
DISPLAY_NAME=Next.js website
156+
DESCRIPTION=This website is built with Next.js.
157+
SUBDOMAIN=nextjs
158+
START=npm run build && npm run start
159+
AUTORESTART=true
160+
```
161+
162+
## Reforcing the limits
163+
For security and performance reasons, there are limits on the configuration parameters, below you can see the limits of each parameter.
164+
165+
| Parameter | Character limit |
166+
| ------------- | --------------- |
167+
| MAIN | 32 characters |
168+
| DISPLAY_NAME | 32 characters |
169+
| DESCRIPTION | 280 characters |
170+
| START | 128 characters |
171+
| SUBDOMAIN | 63 characters |

getting-started/overview.mdx

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
title: "😁 Welcome to the Square Platform"
3+
sidebarTitle: "Overview"
4+
icon: "book"
5+
description: "Square Cloud is a platform that provides hassle-free, user-friendly enterprise hosting services. Get started in minutes. ✨"
6+
---
7+
8+
<CardGroup>
9+
<Card
10+
title="Quick Start Guide"
11+
icon="book"
12+
href="/getting-started/quick-start"
13+
>
14+
Get a fast overview in your first steps with Square Cloud.
15+
</Card>
16+
<Card title="Official API" icon="code" href="/api-reference">
17+
Our API documentation for developers (and you're here!).
18+
</Card>
19+
</CardGroup>
20+
21+
<Snippet file="before-begin.mdx" />
22+
23+
Once you've signed up, you can start deploying your applications on Square Cloud after selected the plan that suits your needs.
24+
25+
## Facilitating your journey with CLI 💻
26+
This Overview uses a [Square Cloud CLI](/cli) to deploy your applications. The CLI is a command-line tool that allows you to interact with Square Cloud services. You can use the CLI to deploy applications, manage services, and view logs.
27+
28+
To use the CLI, you need to install it on your local machine. You can install the CLI using the following commands:
29+
30+
<Frame>
31+
<img src="https://cdn.squarecloud.app/blog/posts/changelog/01-02-2024/square-cli-install.gif" />
32+
</Frame>
33+
<br/>
34+
35+
<CodeGroup>
36+
```bash macOS, Linux, and WSL
37+
curl -fsSL https://cli.squarecloud.app/install | bash
38+
```
39+
40+
```bash Windows with npm
41+
npm install -g @squarecloud/cli
42+
```
43+
44+
```bash Windows with yarn
45+
yarn global add @squarecloud/cli
46+
```
47+
</CodeGroup>
48+
49+
<Steps>
50+
<Step title="Read the instructions about your language">
51+
<Snippet file="languages.mdx" />
52+
<Info>For this example, we will use the JavaScript (Node.js) language.</Info>
53+
</Step>
54+
<Step title="Create your Square Cloud config file">
55+
After installing the CLI, you need to create a configuration file. You can create a [configuration file](/getting-started/config-file) reading this article [here](/getting-started/config-file).
56+
57+
My configuration file looks like this:
58+
```systemd
59+
MAIN=index.js
60+
MEMORY=512
61+
VERSION=recommended
62+
DISPLAY_NAME=Robin bot
63+
DESCRIPTION=This bot system is designed to help you with your daily tasks.
64+
```
65+
</Step>
66+
<Step title="Upload your project">
67+
After this journey, you need to upload your project to Square Cloud. You can do this by running the following command:
68+
```bash
69+
squarecloud upload
70+
```
71+
</Step>
72+
</Steps>
73+
74+
75+
## Facilitating your journey with web interface 😉
76+
If you don't like command lines or prefer to use the web interface, you can upload your project directly to the Square Cloud website. To do this, follow these steps:
77+
78+
<Steps>
79+
<Step title="Access the Square Cloud website">
80+
Access the [Square Cloud dashboard](https://squarecloud.app/dashboard) using your account.
81+
</Step>
82+
<Step title="Create your Square Cloud config file">
83+
After accessing the dashboard, you need to create a configuration file. You can create a [configuration file](/getting-started/config-file) reading this article [here](/getting-started/config-file).
84+
</Step>
85+
<Step title="ZIP your project">
86+
After creating the configuration file, you need to zip your project.
87+
```bash Using the CLI
88+
squarecloud zip
89+
```
90+
91+
Or you can zip your project manually:
92+
<CodeGroup>
93+
```bash Windows
94+
1. Locate the file or folder that you want to zip.
95+
2. Press and hold (or right-click) the file or folder, select (or point to) Send to, and then select Compressed (zipped) folder.
96+
3. A new zipped folder with the same name is created in the same location. To rename it, press and hold (or right-click) the folder, select Rename, and then type the new name.
97+
```
98+
```bash Linux
99+
1. Locate the file or folder that you want to zip.
100+
2. Right-click the file or folder, then choose Compress from the shortcut menu.
101+
3. A new zipped folder with the same name is created in the same location. To rename it, press and hold (or right-click) the folder, select Rename, and then type the new name.
102+
```
103+
```bash macOS
104+
1. Locate the file or folder that you want to zip.
105+
2. Control-click the file or folder, then choose Compress from the shortcut menu.
106+
3. A new zipped folder with the same name is created in the same location. To rename it, press and hold (or right-click) the folder, select Rename, and then type the new name.
107+
```
108+
</CodeGroup>
109+
110+
Or you can use the command line to compress your project folder:
111+
<CodeGroup>
112+
```bash macOS, Linux, and WSL
113+
zip -r my-project.zip .
114+
```
115+
116+
```bash Windows (powershell)
117+
Compress-Archive -Path . -DestinationPath my-project.zip
118+
```
119+
</CodeGroup>
120+
</Step>
121+
<Step title="Deploy your project">
122+
After uploading your project, click on the "Add New" button to deploy your project.
123+
</Step>
124+
</Steps>
125+
126+
## What's next?
127+
Now that you've learned how to deploy your project, you can explore the Square Cloud platform further. Here are some resources to help you get started:
128+
129+
<CardGroup>
130+
<Card
131+
title="API Reference"
132+
icon="server"
133+
href="/api-reference"
134+
>
135+
Learn more about the Square Cloud API.
136+
</Card>
137+
<Card
138+
title="CLI Reference"
139+
icon="code"
140+
href="/cli-reference"
141+
>
142+
Learn more about the Square Cloud CLI.
143+
</Card>
144+
</CardGroup>
145+
146+
Join our community on [Discord](https://discord.gg/squarecloud) to get help from other developers and share your experiences.
147+
<Card
148+
title="Square Cloud Community"
149+
icon="discord"
150+
href="https://discord.gg/squarecloud"
151+
color="#7289DA"
152+
>
153+
Join our community on Discord. We're here to help you!
154+
</Card>
155+
156+
If you have any questions or need help, you can reach out to our [support team](https://squarecloud.app/support). We're here to help you! 🚀

0 commit comments

Comments
 (0)