# Authentication Source: https://docs.squarecloud.app/en/api-reference/authentication Learn what it takes to authenticate to the Square Cloud API. First you need to get an API key from the [Developer Dashboard](https://squarecloud.app/en/account/security). You can use this API key to authenticate to the Square Cloud API. ```bash theme={null} 'Authorization': '' ``` ## API Usage You can use the API key to authenticate to the Square Cloud API. You can use the API key in the `Authorization` header. Remembering that the use of the API is subject to the [Terms of Service](https://squarecloud.app/legal) and the [Acceptable Use Policy](https://squarecloud.app/legal/policy). Learn about the limits and restrictions of the Square Cloud API. # Commit Application Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/commit POST https://api.squarecloud.app/v2/apps/{app_id}/commit Send a change to your application. It has a rate limit of 1 request every 3 seconds. The ID of the application. You can find this in the URL of your application's dashboard. Use FormData or NodeJS Buffer (single file or compress \[zip]) ### Response A message indicating the status of the commit. ```json theme={null} { "status": "success" } ``` # Delete Application Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/delete DELETE https://api.squarecloud.app/v2/apps/{app_id} Remove your application from Square Cloud. (yellow category) The ID of the application. You can find this in the URL of your application's dashboard. ### Response ```json theme={null} { "status": "success" } ``` # Add/Edit Variables Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/envs/add_n_edit POST https://api.squarecloud.app/v2/apps/{appId}/envs Add or edits the environment variables. The application ID. The key and value of environment variables. ### Response The key and value of all environment variables you defined. ```json theme={null} { "status": "success", "response": { "TEST": "myTest" } } ``` # List Variables Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/envs/get GET https://api.squarecloud.app/v2/apps/{appId}/envs Get environment variables. The application ID. ### Response The key and value of all environment variables you defined. ```json theme={null} { "status": "success", "response": { "TEST": "myTest" } } ``` # Overwrite Variables Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/envs/overwrite PUT https://api.squarecloud.app/v2/apps/{appId}/envs Overwrites environment variables with the new values. The application ID. The key and value variables you want on the environment. ### Response The key and value of all environment variables you defined. ```json theme={null} { "status": "success", "response": { "TEST": "overwriteTest" } } ``` # Remove Variables Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/envs/remove DELETE https://api.squarecloud.app/v2/apps/{appId}/envs Remove a environment variable. The application ID. The array containing the keys to remove. ### Response The key and value of all remaining environment variables. ```json theme={null} { "status": "success", "response": { "REMAINING": "secret" } } ``` # Read File Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/content GET https://api.squarecloud.app/v2/apps/{app_id}/files/content Read a file from your application. The ID of the application. You can find this in the URL of your application's dashboard. The path to the file you want to read. This is relative to the root of your application. ### Response The contents of the file. The type of the data. It is "Buffer" for binary data. The data of the file represented as an array of numbers. These numbers represent the bytes of the file. ```json theme={null} { "status": "success", "response": { "type": "Buffer", "data": [ 112, 111, 120, 97, 44, 32, 116, 97, 32, 113, 117, 101, 114, 101, 110, 100, 111, 32, 99, 111, 112, 105, 97, 114, 32, 97, 116, 195, 169, 32, 111, 32, 98, 117, 102, 102, 101, 114, 63 ] } } ``` # List Files Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/list GET https://api.squarecloud.app/v2/apps/{app_id}/files List the files of your application. The ID of the application. You can find this in the URL of your application's dashboard. The path of the directory whose files you want to list. Default is the root directory. ### Response The list of files and directories in the specified path. The type of the entry. Can be `file` or `directory`. The name of the file or directory. The size of the file in bytes. For directories, it is 0. The last modified timestamp of the file or directory in milliseconds since the epoch. ```json theme={null} { "status": "success", "response": [ { "type": "file", "name": ".env", "size": 86, "lastModified": 1676168978000 }, { "type": "file", "name": ".gitignore", "size": 8, "lastModified": 1675125328000 }, { "type": "file", "name": "index.js", "size": 614, "lastModified": 1676168350000 }, { "type": "file", "name": "squarecloud.app", "size": 65, "lastModified": 1676169188000 }, { "type": "directory", "name": "src", "lastModified": 1676155738000 } ] } ``` # Get Application Info Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/info GET https://api.squarecloud.app/v2/apps/{app_id} Retrieve technical information about your application. The ID of the application. You can find this in the URL of your application's dashboard. ### Response The status code of the response. The contents of the response. The application's name. The application's ID. The ID of the application owner. The application's cluster. The application's RAM usage in MB. The application's programming language. The application's domain (null if not applicable). Custom information about the application (null if not applicable). ```json Response theme={null} { "status": "success", "response": { "name": "Best bot forever", "id": "64d0c750212742ca8704fb458c9771af", "owner": "3133971456989594464", "cluster": "fl-micron-1", "ram": 1024, "language": "rust", "domain": null, "custom": null } } ``` # Get Application Logs Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/logs GET https://api.squarecloud.app/v2/apps/{app_id}/logs Collect the latest 1000 lines of logs from your application. It has a rate limit of 1 request every 5 seconds. The ID of the application. You can find this in the URL of your application's dashboard. ### Response The contents of the response. The latest logs from the application. ```json theme={null} { "status": "success", "response": { "logs": "Working!" } } ``` # Restart Application Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/restart POST https://api.squarecloud.app/v2/apps/{app_id}/restart Initiate your application. The ID of the application. You can find this in the URL of your application's dashboard. ### Response ```json theme={null} { "status": "success" } ``` # List Snapshots Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/snapshots/get GET https://api.squarecloud.app/v2/apps/{app_id}/snapshots This route allows you to retrieve a list of snapshots for a specific application. The ID of the application. You can find this in the URL of your application's dashboard. ### Response The contents of the response. The ID of the application from which you fetched the snapshots. Size of the backup in bytes. Date of the last modification of the backup. AWS access key for the backup. ```json theme={null} { "status": "success", "response": [ { "name": "1d2cdc0d6ebd435c91315c6329d12eab", "size": 12900705, "modified": "2024-06-27T06:23:42.326Z", "key": "AWSAccessKeyId=access key" }, { "name": "1d2cdc0d6ebd435c91315c6329d12eab", "size": 12900705, "modified": "2024-06-26T07:05:40.000Z", "key": "AWSAccessKeyId=access key" }, { "name": "1d2cdc0d6ebd435c91315c6329d12eab", "size": 12900705, "modified": "2024-06-25T05:15:51.533Z", "key": "AWSAccessKeyId=access key" }, ] } ``` The format of the URL to download the desired snapshot is: [https://snapshots.squarecloud.app/applications/\{accountID}/\{name}.zip?\{key}](https://snapshots.squarecloud.app/applications/\{accountID}/\{name}.zip?\{key}) # Create Snapshot Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/snapshots/post POST https://api.squarecloud.app/v2/apps/{app_id}/snapshots Perform a snapshot of your application. It has a rate limit of 1 request every 5 seconds. Each account can perform up to (RAM / 256) \* 2 snapshots every 24 hours. The ID of the application. You can find this in the URL of your application's dashboard. ### Response The contents of the response. The URL to download the snapshot of your application. The key to download the snapshot of your application. ```json theme={null} { "status": "success", "response": { "url": "https://snapshots.squarecloud.app/applications/23457145698959364/a23d130fcc9ddaf2d288ae9599a4292c32.zip?AWSAccessKeyId=i06Xdad2dRD74Pm8Xly&Expires=1753081182&Signature=riWPedawcsouRAPGU5n3kGHnWoOuw%3D", "key": "AWSAccessKeyId=i06Xdad2dRD74Pm8Xly&Expires=1753081182&Signature=riWPedawcsouRAPGU5n3kGHnWoOuw%3D" } } ``` # Start Application Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/start POST https://api.squarecloud.app/v2/apps/{app_id}/start Initiate your application. The ID of the application. You can find this in the URL of your application's dashboard. ### Response ```json theme={null} { "status": "success" } ``` # Get Application Status Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/status GET https://api.squarecloud.app/v2/apps/{app_id}/status Collect status information about your application. The ID of the application. You can find this in the URL of your application's dashboard. If you want raw data. True, returns the values in bytes. ### Response The status code of the response. The contents of the response. The CPU usage of the application. The RAM usage of the application. The status of the application. Indicates whether the application is currently running. The storage used by the application. The total network usage of the application. The current network usage of the application. The uptime of the application in milliseconds. ```json theme={null} { "status": "success", "response": { "cpu": "0.01%", "ram": "31.79", "status": "running", "running": true, "storage": "2.72MB", "network": { "total": "602 KB ↑ 134 KB ↓", "now": "14 KB ↑ 3.3 KB ↓" }, "uptime": 1662927833666 } } ``` # All Applications Status Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/status-all GET https://api.squarecloud.app/v2/apps/status Collect status information about all your applications in real time. It has a rate limit of 15 request every 60 seconds. A workspace id. You can found it below your workspace name on dashboard. If `workspaceId` isn't provided, will get your account applications status. ### Response The contents of the response. The application ID. The CPU usage of the application. The RAM usage of the application. Indicates whether the application is currently running. ```json theme={null} { "status": "success", "response": [ { "id": "5bbd020126ee4692aga43e0ca0a75454", "cpu": "0.00%", "ram": "55.88MB", "running": true }, { "id": "e1b286ba30f14a87baed4b4ad3b53c47", "cpu": "0.01%", "ram": "68.44MB", "running": true } ] } ``` # Stop Application Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/stop POST https://api.squarecloud.app/v2/apps/{app_id}/stop Initiate your application. The ID of the application. You can find this in the URL of your application's dashboard. ### Response ```json theme={null} { "status": "success" } ``` # Upload Application Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/upload POST https://api.squarecloud.app/v2/apps Send an application to Square Cloud. It has a rate limit of 1 request every 3 seconds. The application to be uploaded must be compressed in a zip file (.zip) and the Content-Type must be multipart/form-data. ### Response The status code of the response. The contents of the response. The ID of the uploaded application. The name of the uploaded application. The description of the uploaded application. The subdomain of the uploaded application (null if not applicable). The RAM usage of the uploaded application in MB. The CPU usage of the uploaded application. The programming language of the uploaded application. The recommended version of the programming language. The cluster where the application is cloud hosted. ```json theme={null} { "status": "success", "code": "SUCCESS", "response": { "id": "945f574e6cc14ea6818f91d7d56de101", "name": "Estrelinha Legal", "description": "Nossa, fui enviada na velocidade da luz! ✨", "domain": null, "ram": 1024, "cpu": 6, "language": { "name": "JavaScript", "version": "recommended" } } } ``` # Create Database Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/create POST https://api.squarecloud.app/v2/databases Creates a Database instance hosted on Square Cloud. ## Request ### Headers ### Body The name of the Database. Must be \[a-z] \[A-Z] \[0-9]. The RAM allocated to it. Redis minimum is 512 and Mongo, 1024. The database type, Mongo, Redis or any other available. The version of Database. Mongo 8.0.11 and Redis 7.4.5. ## Response The contents of the response. The ID of the database. The name you have choosed to the Database The memory allocated to the database The number of vCPUs allocated to the database The type of the database. The password for the database. The certificate needed to connect to it. You can save it in a `.pem` file. The url to connect to the database. ```json theme={null} { "status":"success", "response": { "id": "a14b8d5e1cb7405a851eb4c075506121", "name": "test", "memory": 1024, "cpu": 2, "type": "mongo", "password": "PASSWORD", "certificate": "CERTIFICATE_IN_BASE_64_FORMAT", "connection_url": "mongodb://default:PASSWORD@square-cloud-db-ID.squareweb.app:PORT" } } ``` # Get Certificate Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/credentials/get_certificate GET https://api.squarecloud.app/v2/databases/{databaseId}/credentials/certificate Gets the certificate of a database hosted on Square Cloud. ## Request ### Headers ### Path The ID of the database. ## Response The contents of the response. The certificate encoded in base64. ```json theme={null} { "status": "success", "response": { "certificate": "CERTIFICATE_IN_BASE_64_FORMAT" } } ``` # Reset Credentials Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/credentials/reset POST https://api.squarecloud.app/v2/databases/{databaseId}/credentials/reset Resets the certificate or a password of a database hosted on Square Cloud. ## Request ### Headers ### Path The ID of the database. ### Body The credential you want to reset, password or certificate. ## Response ### If is a password reset The contents of the response. The new generated password. ```json theme={null} { "status":"success", "response":{ "password":"f3T1hdskMkchMwK6Hxqinoyb" } } ``` # Delete Database Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/delete DELETE https://api.squarecloud.app/v2/databases/{databaseId} Deletes a database hosted on Square Cloud ## Request ### Headers ### Path The ID of the database. ## Response ```json theme={null} { "status":"success" } ``` # Edit Database Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/edit PATCH https://api.squarecloud.app/v2/databases/{databaseId} Edits a database hosted on Square Cloud, changing name and/or memory ## Request ### Headers ### Path The ID of the database. ### Body The name of the Database. Must be \[a-z] \[A-Z] \[0-9]. The amount of RAM to allocate, in megabytes. Minimums: Redis 512 MB, MongoDB and PostgreSQL 1024 MB. ## Response ```json theme={null} { "status":"success" } ``` # Get Database Metrics Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/metrics GET https://api.squarecloud.app/v2/databases/{databaseId}/metrics Gets the metrics of your hosted database. ## Request ### Headers ### Path The ID of the database. ## Response The contents of the response. The date in ISO format. The current CPU usage percentage. The current RAM usage An array representing total network used. First the input, second the output. ```json theme={null} { "status": "success", "response": [ { "date": "2025-08-13T12:55:01.348Z", "cpu": 0.45, "ram": 111.27, "net": [ 16834, 126 ] }, { "date": "2025-08-13T12:50:01.349Z", "cpu": 0.45, "ram": 111.22, "net": [ 16834, 126 ] }, { "date": "2025-08-13T12:45:01.350Z", "cpu": 0.58, "ram": 111.36, "net": [ 16834, 126 ] }, { "date": "2025-08-13T12:40:01.348Z", "cpu": 0.43, "ram": 118.44, "net": [ 16834, 126 ] } ] } ``` # Create Snapshot Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/snapshots/do_snapshot POST https://api.squarecloud.app/v2/databases/{databaseId}/snapshots Perform a snapshot of your database. It has a rate limit of 1 request every 5 seconds. Each account can perform up to (RAM / 256) \* 2 snapshots every 24 hours. ### Path The ID of the database. ## Response The contents of the response. The URL to download the snapshot of your application. The key to download the snapshot of your application. ```json theme={null} { "status":"success", "response":{ "url":"https://snapshots.squarecloud.app/databases/384443501775028242/a14b8d5e1cb7405a851eb4c075506121.zip?AWSAccessKeyId=accesskey&Expires=1757683751&Signature=JR3danhvtVywQmcaIanWsoJFqhQ%3D", "key":"AWSAccessKeyId=accesskey&Expires=1757683751&Signature=JR3danhvtVywQmcaIanWsoJFqhQ%3D" } } ``` # List Snapshots Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/snapshots/get GET https://api.squarecloud.app/v2/databases/{databaseId}/snapshots Get a list of all snapshots related with a single database ## Request ### Headers ### Path The ID of the database. ## Response The contents of the response. The id of your Database hosted on Square Cloud. Size of the backup in bytes. Date of the last modification of the backup. AWS access key for the backup. ```json theme={null} { "status":"success", "response":[ { "name":"a14b8d5e1cb7405a851eb4c075506121", "size":10644463, "modified":"2025-08-13T13:29:11.263Z", "key":"AWSAccessKeyId=accesskey&Expires=1757683751&Signature=VZ03MSxcNw3%2FtPezXv0IhTs0jq4%3D&versionId=45ec0b49-9af6-445e-a55c-abd7ec5278b2" }, { "name":"a14b8d5e1cb7405a851eb4c075506121", "size":2742383, "modified":"2025-08-13T00:01:47.010Z", "key":"AWSAccessKeyId=accesskey&Expires=1757683751&Signature=7zw5apjyaOd1xPZl3gRgp8Y4yEs%3D&versionId=f65e1378-8717-45c5-8aec-bb233eedb5ce" } ] } ``` The format of the URL to download the desired snapshot is: [https://snapshots.squarecloud.app/applications/\{accountID}/\{name}.zip?\{key}](https://snapshots.squarecloud.app/applications/\{accountID}/\{name}.zip?\{key}) # Restore Snapshot Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/snapshots/restore POST https://api.squarecloud.app/v2/databases/{databaseId}/snapshots/restore Restores a database based on a snapshot of it. ## Request ### Headers ### Path The ID of the database. ### Body The database id you wanna restore. The snapshot of the database you wanna restore. ## Response ```json theme={null} { "status":"success" } ``` # Start Database Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/start POST https://api.squarecloud.app/v2/database/{databaseId}/start Initiate your Database. ## Request ### Headers ### Path The ID of the database. ## Response ```json theme={null} { "status":"success" } ``` # Get Database Status Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/status GET https://api.squarecloud.app/v2/databases/{databaseId}/status Get all status info related with a single database ## Request ### Headers ### Path The ID of the database. If you want raw data. True, returns the values in bytes. ## Response The contents of the response. The current CPU usage percentage. The current RAM usage The boolean value if is running. The current storage it is using. The network usage and total used. The total used. The current use. The timestamp representing the uptime. ```json theme={null} { "status": "success", "response": { "cpu": "0.54%", "ram": "111.32MB", "status": "running", "running": true, "storage": "210.1MB", "network": { "total": "16.83KB ↑ 126B ↓", "now": "0B ↑ 0B ↓" }, "uptime": 1755028584438 } } ``` # All Databases Status Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/status-all GET https://api.squarecloud.app/v2/databases/status Gets all databases statuses. ## Request ### Headers ## Response The contents of the response. The ID of the database. The boolean value if is running. The current CPU usage percentage. The current RAM usage ```json theme={null} { "status": "success", "response": [ { "id": "a14b8d5e1cb7405a851eb4c075506121", "running": true, "ram": "118.95MB", "cpu": "0.40%" } ] } ``` # Stop Database Source: https://docs.squarecloud.app/en/api-reference/endpoint/databases/stop POST https://api.squarecloud.app/v2/database/{databaseId}/stop Shuts down your Database. ## Request ### Headers ### Path The ID of the database. ## Response ```json theme={null} { "status":"success" } ``` # Get Service Status Source: https://docs.squarecloud.app/en/api-reference/endpoint/service/status GET https://api.squarecloud.app/v2/service/status Check the real-time status of Square Cloud services This route has a 5-minute cache and does not reflect the real-time status of status.squarecloud.app. ### Response The current status of Square Cloud, with `online` indicating the service is online, `degraded` indicating issues, and `unknown` indicating unavailable. Message about the current status of Square Cloud services. ```json theme={null} { "status": "online", "message": "All services are online." } ``` # Get Account Info Source: https://docs.squarecloud.app/en/api-reference/endpoint/users/me GET https://api.squarecloud.app/v2/users/me Get information about your account. ### Response The contents of the response. The user's ID. The user's name. The user's email. The user's locale. The user's plan name. The user's plan memory details. The user's plan memory limit in MB. The user's available memory in MB. The user's used memory in MB. The user's plan duration in milliseconds. The application's name. The application's ID. The application's description. The application's RAM usage. The application's language. The application's domain. The application's custom domain. The application's cluster. The database ID. The database name. The database type. The database cluster. The database RAM usage. ```json Response theme={null} { "status": "success", "response": { "user": { "id": "313397145698959364", "name": "joaootavios", "email": "joao@squarecloud.app", "plan": { "name": "standard-4", "memory": { "limit": 4096, "available": 3840, "used": 256 }, "duration": 1732072955446 } }, "applications": [ { "name": "Square Example APP", "id": "446b0b4118634a1c99e73bac9a54e475", "desc": "This is a example of description", "ram": 512, "lang": "javascript", "domain": "square-example-app.squareweb.app", "custom": "mydomain.com", "cluster": "suki-cluster" } ], "databases": [ { "id": "db1234567890", "name": "example-database", "type": "mongodb", "cluster": "suki-cluster", "ram": 1024 } ] } } ``` # List Snapshots Source: https://docs.squarecloud.app/en/api-reference/endpoint/users/snapshots GET https://api.squarecloud.app/v2/users/snapshots Get List of all Snapshots. ### Query Parameters Specifies the type of snapshots to retrieve. * `applications` (default): Returns snapshots of applications * `databases`: Returns snapshots of databases ### Response The contents of the response. The ID of the application to which the snapshot belongs. Size of the snapshot in bytes. Date of the last modification of the snapshot. AWS access key for the snapshot. ```json Response theme={null} { "status": "success", "response": [ { "name": "1d2cdc0d6ebd435c91315c6329d12eab", "size": 12900705, "modified": "2024-06-27T06:23:42.326Z", "key": "AWSAccessKeyId=accesskey" }, { "name": "1d2cdc0d6ebd435c91315c6329d12eab", "size": 12900705, "modified": "2024-06-26T07:05:40.000Z", "key": "AWSAccessKeyId=accesskey" }, ] } ``` The format of the URL to download the desired snapshot is: [https://snapshots.squarecloud.app/applications/\{accountID}/\{name}.zip?\{key}](https://snapshots.squarecloud.app/applications/\{accountID}/\{name}.zip?\{key}) # Limitations and Restrictions Source: https://docs.squarecloud.app/en/api-reference/limitations-and-restrictions There are some limitations and restrictions on the use of the Square Cloud API. Due to regulations, local laws, security and privacy issues, certain countries may be blocked from accessing our services and APIs. We are constantly working to expand our services to more countries, but we cannot guarantee that we will be able to provide services in your country. ## Blocked Countries by Sanctions or Regulatory Restrictions The following countries are currently blocked from accessing our services and APIs due to sanctions and regulatory restrictions: | Country | Code | Reason | | :----------- | :--- | :---------------------- | | Afghanistan | AF | Regulatory restrictions | | Belarus | BY | Regulatory restrictions | | Cuba | CU | Regulatory restrictions | | China | CN | Regulatory restrictions | | Iran | IR | Regulatory restrictions | | North Korea | KP | Regulatory restrictions | | Russia | RU | Regulatory restrictions | | Syria | SY | Regulatory restrictions | | Antartica | AN | Regulatory restrictions | | All TOR IP's | T1 | Regulatory restrictions | ## Captcha Countries The following countries are required to solve a captcha before accessing our services and APIs: | Country | Code | Reason | | :---------- | :--- | :--------------- | | Bangladesh | BD | Security reasons | | India | IN | Security reasons | | Iraq | IQ | Security reasons | | Philippines | PH | Security reasons | | Ukraine | UA | Security reasons | | Venezuela | VE | Security reasons | | Vietnam | VN | Security reasons | | Indonesia | ID | Security reasons | | Malaysia | MY | Security reasons | ## API Limits Illegal or abusive use of our API may result in your account being blocked. If you are rate limited, you will receive a `429 Too Many Requests` response. If you receive this response, you should wait **30 minutes before making another request**. Applications hosted **outside of Square Cloud** have a **maximum** rate limit of **300 requests per minute**. The API is subject to rate limits (subject to change). The current rate limits are: | Account Plan | Rate Limit (60s) | Max daily requests | | :-------------- | :--------------: | :-----------------: | | HOBBY-1 | 30 requests | 43,200 requests | | HOBBY-2 | 60 requests | 86,400 requests | | STANDARD-4 | 120 requests | 172,800 requests | | STANDARD-6 | 180 requests | 259,200 requests | | STANDARD-8 | 240 requests | 345,600 requests | | PRO-12 | 300 requests | 432,000 requests | | PRO-16 | 300 requests | 432,000 requests | | ENTERPRISE-32 | 480 requests | 691,200 requests | | ENTERPRISE-48 | 720 requests | 1,036,800 requests | | ENTERPRISE-64 | 960 requests | 1,382,400 requests | | ENTERPRISE-96 | 1,200 requests | 1,728,000 requests | | ENTERPRISE-128 | 1,600 requests | 2,304,000 requests | | ENTERPRISE-160 | 2,000 requests | 2,880,000 requests | | ENTERPRISE-192 | 2,400 requests | 3,456,000 requests | | ENTERPRISE-224 | 2,800 requests | 4,032,000 requests | | ENTERPRISE-256 | 3,200 requests | 4,608,000 requests | | ENTERPRISE-288 | 3,600 requests | 5,184,000 requests | | ENTERPRISE-320 | 4,000 requests | 5,760,000 requests | | ENTERPRISE-384 | 4,800 requests | 6,912,000 requests | | ENTERPRISE-448 | 5,600 requests | 8,064,000 requests | | ENTERPRISE-512 | 6,400 requests | 9,216,000 requests | | ENTERPRISE-640 | 8,000 requests | 11,520,000 requests | | ENTERPRISE-768 | 9,600 requests | 13,824,000 requests | | ENTERPRISE-1024 | 12,800 requests | 18,432,000 requests | It is important to note that these API usage limits are set to ensure that the Square Cloud platform can be used equitably by all users and to protect the integrity of the systems. If you need more requests per minute or other broader limitations, it may be possible to upgrade to a higher tier plan that offers these additional features. # Getting Started with Bun on Square Cloud Source: https://docs.squarecloud.app/en/articles/getting-started-with-bun Learn how to get started with Bun JS on Square Cloud ## 🚀 Introduction * The Bun runtime is an alternative JavaScript runtime you can choose for your project. If you don't have Bun installed locally yet, you have two main options: * Install via npm (recommended to ensure `npx bun` is available during deploy): ```bash theme={null} npm install bun ``` * Or install Bun with the official native installer (check Bun's docs for instructions). * By adding `bun` as a dependency you can use `npx bun` in the `START` field of your `squarecloud.app` to run your app with Bun. See the "Starting the Application" section below for `START` examples. * Next, you'll need to create a Square Cloud account via the [login page](https://squarecloud.app/en/signin). You can sign up with your email, GitHub, or both. * Finally, you must have an active paid plan on your account. You can view and purchase plans [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud configuration file The `squarecloud.app` file is a configuration file used to configure your application; it defines the name, description, version, main file, and more. ## ▶️ Starting the Application * To use the Bun runtime on Square Cloud, add the `bun` package to your project (for example `npm install bun`) so the `npx bun` command is available in the runtime environment. * Then set the `START` field in your `squarecloud.app` to the command that starts your app using Bun. Example: ```squarecloud.app OR .config theme={null} START=npx bun main.js ``` Alternately, if you need to run `package.json` scripts with Bun, use: ``` START=npx bun run start ``` * Remember: if the `START` field is defined, its value will be executed directly. For more information about configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). * If the `node_modules` folder is not present, Square Cloud will run: ```bash theme={null} npm install --no-package-lock --no-audit --no-fund ``` to install dependencies and clean the `.npm` folder. If you plan to use Bun as the runtime, we recommend adding `bun` as a dependency (`npm install bun`) to ensure `npx bun` is available during deploy. If you prefer Bun's native installer, check compatibility and build requirements before choosing that approach. ## 🖥️ Preparing your Bun project ### 📁 Essential configuration files When preparing your Bun project for deploy on Square Cloud, make sure to include the configuration file (`squarecloud.app/.config`) and your application's essential files inside a zip archive. The configuration file (`squarecloud.app/.config`) must be located at the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. #### 🗑️ Files to exclude before upload * `node_modules`: This folder does not need to be uploaded because it will be recreated during production install. * `package-lock.json`: This file is not required because the production environment will install dependencies based on `package.json`. ### 🤔 Why exclude these files? There are several reasons to exclude `node_modules` and `package-lock.json` before uploading your project: 1. **Consistent installs:** Not uploading `node_modules` ensures dependencies are installed by the production environment, resulting in a consistent build free from local system discrepancies. 2. **Updated installations:** The production environment will install compatible, up-to-date versions of dependencies listed in `package.json`, providing a clean start for your app. 3. **Reduced upload size:** Excluding these folders reduces the upload size, speeding up upload and deployment. Doing so helps ensure your Bun application is optimized for hosting on Square Cloud. ### 📄 Required files The following files are required to host your Bun project: * [squarecloud.app/.config](https://docs.squarecloud.app/en/getting-started/config-file) * mainFile.js/.ts (example main file) * [package.json](./how-to-create-your-package-json) (dependencies file) ## 💡 Troubleshooting This error occurs when the file defined as "main" for your application in the configuration file does not exist, is written incorrectly, or the path is incorrect. If your main file is inside a folder, for example, you should enter `folder/file.js`. The minimum amount of RAM required to host a bot is 256MB, and for a website/API, it's 512MB. However, depending on the size and complexity of your application, it may be advisable to allocate a larger amount of RAM to avoid the [LACK\_OF\_RAM](https://docs.squarecloud.app/en/faqs/troubleshooting/LACK_OF_RAM) error. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started on Square Cloud with C# Source: https://docs.squarecloud.app/en/articles/getting-started-with-csharp Learn how to get started on Square Cloud with C# ## 🚀 Introduction * Before you begin, make sure you have Dotnet on your system. If you don't have them yet, you can download them from the [official Dotnet website](https://dotnet.microsoft.com/pt-br/download). * Next, you will need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/signin). You can use your email, GitHub, or both to create the account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## 📄 Required Files * **project/project.csproj** (Example of main file). In the example above, the main application file is inside a folder. If your configuration file is also inside a folder, it's necessary to define its path in the `MAIN` field, for example: `MAIN=folder/file.csproj` * [squarecloud.app](https://docs.squarecloud.app/en/getting-started/config-file) (file that contains the Square Cloud configuration). ## ▶️ Start Application * If the `START` field is not defined in the configuration file, Square Cloud will by default uses `restore & run` to start your application. If the `START` field is defined in the configuration file, the value in the `START` field will be executed directly. For more information on configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). * Square Cloud uses `dotnet restore` to restore project dependencies and `dotnet run --project MAIN` to build and run the project specified by `MAIN`. ## 🖥️ Preparing Project for Upload Before hosting your project on Square Cloud, you must first have the files of your project properly configured, so that you can host it later. The configuration (`squarecloud.app/.config`) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started on Square Cloud with Elixir Source: https://docs.squarecloud.app/en/articles/getting-started-with-elixir Learn how to get started on Square Cloud with Elixir ## 🚀 Introduction * Before you begin, make sure you have Elixir on your system. If you don't have them yet, you can download them from the [official Elixir website](https://elixir-lang.org/install.html). * Next, you will need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/signin). You can use your email, GitHub, or both to create the account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## 📄 Required Files * main.ex (Example of main file). * mix.exs (Dependency file). * [squarecloud.app](https://docs.squarecloud.app/en/getting-started/config-file) (file that contains the Square Cloud configuration). ## ▶️ Start Application * If the `START` field is not defined in the configuration file, Square Cloud will run `mix run --no-halt` to start the project. If the `START` field is defined in the configuration file, the value in the `START` field will be executed directly. For more information on configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). * Square Cloud performs a local installation of the `hex` and `rebar` tools and obtains project dependencies with `mix deps.get`. ## 🖥️ Preparing Project for Upload Before hosting your project on Square Cloud, you must first have the files of your project properly configured, so that you can host it later. The configuration (`squarecloud.app/.config`) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started on Square Cloud with Go Source: https://docs.squarecloud.app/en/articles/getting-started-with-go Learn how to get started on Square Cloud with Go ## 🚀 Introduction * Before you begin, make sure you have Go on your system. If you don't have them yet, you can download them from the [official Go website](https://go.dev/doc/install). * Next, you will need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/signin). You can use your email, GitHub, or both to create the account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## 📄 Required Files * main.go (Example of main file). * go.mod (Dependency file). * OR go.work (Dependency file). * go.sum (Checksum file, optional). * [squarecloud.app](https://docs.squarecloud.app/en/getting-started/config-file) (file that contains the Square Cloud configuration). ## ▶️ Start Application * If the `START` field is not defined in the configuration file, Square Cloud will run `go run MAIN` to compile and execute the Go file specified in the `MAIN` field. If the `START` field is defined in the configuration file, the value in the `START` field will be executed directly. For more information on configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). * Square Cloud runs the `go mod tidy` command to update your project's dependencies. ## 🖥️ Preparing Project for Upload Before hosting your project on Square Cloud, you must first have the files of your project properly configured, so that you can host it later. The configuration (`squarecloud.app/.config`) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started with HTML/CSS on Square Cloud Source: https://docs.squarecloud.app/en/articles/getting-started-with-html Learn how to get started with HTML/CSS on Square Cloud ## 🚀 Introduction * Before you begin, make sure you have a suitable text editor for creating HTML and CSS files. We recommend [Visual Studio Code](https://code.visualstudio.com/) or any other editor of your preference. * Next, you'll need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/signin). You can use your email, GitHub, or both to create the account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). Square Cloud offers native support for static projects, such as HTML/CSS websites. This means you can easily host your HTML, CSS, and other static resource files on the platform. With integrated premium CDN, your sites will be delivered quickly to users worldwide. ## 📄 Required Files * index.html (Main file example). * vite.html (Main file example for Vite projects). * 404.html (404 error routing file, optional). ## 🖥️ Preparing the Project for Upload Before hosting your project on Square Cloud, first verify that the project files are correctly configured for hosting. ## 📤 Uploading the Project to Square Cloud After preparing the project files, you can upload them to Square Cloud and host your application. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started on Square Cloud with Java Source: https://docs.squarecloud.app/en/articles/getting-started-with-java Learn how to get started on Square Cloud with Java ## 🚀 Introduction * Before you begin, make sure you have Java on your system. If you don't have them yet, you can download them from the [official Java website](https://www.java.com/download/manual.jsp). * Next, you will need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/signin). You can use your email, GitHub, or both to create the account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## 📄 Required Files * project.jar (Example of main file). * MANIFEST.MF (Dependency file). * pom.xml or build.gradle (Build / dependency file). (CASE YOU USE IT) * [squarecloud.app](https://docs.squarecloud.app/en/getting-started/config-file) (file that contains the Square Cloud configuration). ## ▶️ Start Application * If the `START` field is not defined in the configuration file, Square Cloud will run `java -jar MAIN`, where the file specified in the `MAIN` field is the `JAR` file. If the `START` field is defined in the configuration file, the value in the `START` field will be executed directly. For more information on configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). ## 🖥️ Preparing Project for Upload Before hosting your project on Square Cloud, you must first have the files of your project properly configured, so that you can host it later. The configuration (`squarecloud.app/.config`) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started on Square Cloud with Node.js Source: https://docs.squarecloud.app/en/articles/getting-started-with-nodejs Learn how to get started on Square Cloud with Node.js ## 🚀 Introduction * Before you begin, make sure you have Node.js and npm installed on your system. If you don't have them yet, you can download them from the [official Node.js website](https://nodejs.org/). * Next, you will need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/signin). You can use your email, GitHub, or both to create the account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## ▶️ Start Application * If the `START` field is not defined in the configuration file, Square Cloud will by default run `node` with optimization options and specific parameters. If the `START` field is defined in the configuration file, the value in the `START` field will be executed directly. For more information on configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). * If the `START` field is not defined in the configuration file, Square Cloud will by default run `npx tsx MAIN` to compile and execute the main TypeScript file specified by `MAIN` field. If the `START` field is defined in the configuration file, the value in the `START` field will be executed directly. For more information on configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). * If the `node_modules` folder does not exist, Square Cloud will run `npm install --no-package-lock --no-audit --no-fund` to install dependencies and clean the `.npm` folder. ## 🖥️ Preparing Your Node.js Project ### 📁 Essential Configuration Files When preparing your Node.js project for deployment on Square Cloud, ensure that you include your configuration file (`squarecloud.app/.config`) and the essential files of your application in a zip file. The configuration (`squarecloud.app/.config`) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. #### 🗑️ Files to Exclude Before Uploading * `node_modules`: This folder is not required to be sent as it will be created during the installation process in the production environment. * `package-lock.json`: This file is not necessary because the production environment will install dependencies based on `package.json`. ### 🤔 Why Exclude These Files? There are several reasons to exclude `node_modules` and `package-lock.json` before uploading your project: 1. **Installation Consistency:** Not sending the `node_modules` folder ensures that dependencies are installed by the production environment, resulting in a consistent build free from local system discrepancies. 2. **Updated Installations:** The production environment will install the latest compatible versions of the dependencies listed in `package.json`, providing a clean start for your application. 3. **Reduced Upload Size:** Leaving out these files decreases the size of your upload file, which speeds up the upload process and makes deployment more efficient. By doing this, you can ensure that your Node.js application is optimally prepared and secure for deployment to Square Cloud. ### 📄 Required Files Three files are required to host your Node project: * [squarecloud.app/.config](https://docs.squarecloud.app/en/getting-started/config-file) * mainFile.js/.ts (Example of main file) * [package.json](./how-to-create-your-package-json) (Dependency file) Square Cloud natively supports `TypeScript`, running your project through ts-node, but it is recommended to always compile to `JavaScript` since we are a production platform. ## 💡 Troubleshooting This error occurs when the file defined as "main" for your application in the configuration file does not exist, is written incorrectly, or the path is incorrect. If your main file is inside a folder, for example, you should enter `folder/file.js`. The minimum amount of RAM required to host a bot is 256MB, and for a website/API, it's 512MB. However, depending on the size and complexity of your application, it may be advisable to allocate a larger amount of RAM to avoid the [LACK\_OF\_RAM](https://docs.squarecloud.app/en/faqs/troubleshooting/LACK_OF_RAM) error. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started on Square Cloud with PHP Source: https://docs.squarecloud.app/en/articles/getting-started-with-php Learn how to get started on Square Cloud with PHP ## 🚀 Introduction * Before you begin, make sure you have PHP on your system. If you don't have them yet, you can download them from the [official PHP website](https://www.php.net/). * Next, you will need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/signin). You can use your email, GitHub, or both to create the account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## 📄 Required Files * index.php (Example of main file). * `composer.json` (\*Optional dependency file). * [squarecloud.app](https://docs.squarecloud.app/en/getting-started/config-file) (a file containing your Square Cloud configuration). ## ▶️ Start Application * If the `START` field is not defined in the configuration file, a local PHP server will be started using the `php -S 0.0.0.0:80` command. If the `START` field is defined in the configuration file, the value in the `START` field will be executed directly. For more information on configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). * If the `composer.json` file exists, all dependencies will be installed using the `php composer.phar install` command. ## PHP with Swoole * Swoole is a tool that enhances performance of the standard PHP, allowing the webserver serve multiple requests asynchronously. * With this tools, you can create microservices, websockets, queue on background, etc. It allows you to execute events like in JavaScript. * It's also important to mention that Swoole has compatibility with other PHP frameworks. A good example of a PHP framework is Laravel, which is compatible with Swoole thanks to the Octane. * You can use it instead of default PHP server by setting a custom START. Example: ``` npm run build && composer install --no-interaction --prefer-dist --optimize-autoloader && php artisan optimize && php artisan migrate --force && php -v && php artisan octane:start --host=0.0.0.0 --port=80 --workers=4 --task-workers=8 --server=swoole ``` * You can check out all the powerful features of Swoole [here](https://www.php.net/manual/en/book.swoole.php) ## 🖥️ Preparing Project for Upload Before you can host your project on Square Cloud, ensure your project files are correctly configured for hosting. If your project includes a `composer.json` file, Square Cloud will automatically install dependencies using Composer. However, if your project also has Node dependencies (i.e., a `package.json` file), you should specify the installation process in the `START` field of your `squarecloud.app` file. For example: ```plaintext theme={null} START=npm install && php ..... ``` The configuration (`squarecloud.app/.config`) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started on Square Cloud with Python Source: https://docs.squarecloud.app/en/articles/getting-started-with-python Learn how to get started on Square Cloud with Python ## 🚀 Introduction * Before you begin, make sure you have Python on your system. If you don't have them yet, you can download them from the [official Python website](https://www.python.org/). * Next, you will need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/signin). You can use your email, GitHub, or both to create the account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## ▶️ Start Application * If the `START` field is not defined in the configuration file, Square Cloud will run `python MAIN` to execute the Python file specified in the `MAIN` field. If the `START` field is defined in the configuration file, the value in the `START` field will be executed directly. For more information on configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). * Square Cloud uses `pip install` to install all dependencies listed in the `requirements.txt`. ## 🖥️ Preparing Your Python Project ### 📁 Essential Configuration Files When preparing your Python project for deployment on Square Cloud, ensure that you include your configuration file (`squarecloud.app/.config`) and the essential files of your application in a zip file. The configuration (`squarecloud.app/.config`) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. #### 🗑️ Files to Exclude Before Uploading * `ffmpeg`: This software is pre-installed in the Square Cloud environment, so there's no need to include this folder in your project. * `.venv`: This folder contains the virtual environment for your project. Square Cloud provides an isolated environment, so this folder is not required. * `poetry.lock`: Since Square Cloud does not currently support Poetry, this file should be excluded to avoid any potential issues during deployment. ### 🤔 Why Exclude These Files? Excluding `ffmpeg`, `.venv` and `poetry.lock` is important for several reasons: 1. **Clean Environment:** Square Cloud creates a fresh environment for your project. Including these files is unnecessary and could lead to conflicts with the cloud environment's configurations. 2. **Efficiency:** Removing these files reduces the size of your upload, making the process faster and more streamlined. 3. **Compatibility:** Excluding `poetry.lock` ensures that there are no compatibility issues, as Square Cloud relies on `requirements.txt` for installing dependencies. Before uploading, make sure to zip your project files in **.zip** format, excluding the unnecessary files mentioned above. This will help ensure that your Python application is ready for a successful deployment to Square Cloud. ### 📄 Required Files * main.py (Example of main file). * [requirements.txt](./how-to-create-your-requirements) (Dependency file). * OR \[pyproject.toml] (Dependency file). * [squarecloud.app](https://docs.squarecloud.app/en/getting-started/config-file) (file that contains the Square Cloud configuration). ## 💡 Troubleshooting This error occurs when the file defined as "main" for your application in the configuration file does not exist, is written incorrectly, or the path is incorrect. If your main file is inside a folder, for example, you should enter `folder/file.js`. The minimum amount of RAM required to host a bot is 256MB, and for a website/API, it's 512MB. However, depending on the size and complexity of your application, it may be advisable to allocate a larger amount of RAM to avoid the [LACK\_OF\_RAM](https://docs.squarecloud.app/en/faqs/troubleshooting/LACK_OF_RAM) error. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started with Ruby on Square Cloud Source: https://docs.squarecloud.app/en/articles/getting-started-with-ruby Learn how to get started with Ruby on Square Cloud ## 🚀 Introduction * Before you begin, make sure Ruby is installed on your system. If you don't have it yet, you can download it from the [official Ruby website](https://www.ruby-lang.org/en/), or use version managers such as [rbenv](https://github.com/rbenv/rbenv) or [rvm](https://rvm.io/). * Next, you'll need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/en/signin). You can create an account with your email, GitHub, or both. * Finally, you must have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud configuration file The `squarecloud.app` file is a configuration file used to configure your application; it defines the name, description, version, main file, and more. ## 📄 Required Files * main.rb (Example main file — your Ruby entrypoint). * Gemfile (Dependencies file, if you use Bundler). * Gemfile.lock (Generated by Bundler; recommended to include for reproducible builds). * [squarecloud.app](https://docs.squarecloud.app/en/getting-started/config-file) (file that contains Square Cloud configuration). ## ▶️ Starting the Application * If the `START` field is not defined in the configuration file, Square Cloud will run `ruby MAIN`, where `MAIN` refers to the Ruby file (for example `main.rb`). If the `START` field is defined, its value will be executed directly. For apps using Bundler, it's common to set `START` to `bundle exec ruby main.rb` or another appropriate start command. For more information about configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/getting-started/config-file#configuration-parameters). For Ruby applications that use **Bundler**, it's important to properly configure environment variables to optimize the dependency installation process on Square Cloud. Square Cloud runs the bundler installation using environment variables. To exclude unnecessary gem groups in production, configure the `BUNDLE_WITHOUT=development:test` variable. This also helps remove **deprecations** from **Bundler 2.x**. ## 🖥️ Preparing Project for Upload Before hosting your project on Square Cloud, you must first have the files of your project properly configured, so that you can host it later. The configuration (`squarecloud.app/.config`) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # Getting Started on Square Cloud with Rust Source: https://docs.squarecloud.app/en/articles/getting-started-with-rust Learn how to get started on Square Cloud with Rust ## 🚀 Introduction * Before you begin, make sure you have Rust on your system. If you don't have them yet, you can download them from the [official Rust website](https://www.rust-lang.org/tools/install). * Next, you will need to create an account on Square Cloud, which can be done through the [login page](https://squarecloud.app/signin). You can use your email, GitHub, or both to create the account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## ⚙️ Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## 📄 Required Files * main.rs (Example of main file). * Cargo.toml (dependency file). * [squarecloud.app](https://docs.squarecloud.app/en/getting-started/config-file) (file that contains the Square Cloud configuration). ## ▶️ Start Application * If the `START` field is not defined in the configuration file, Square Cloud will run the `cargo run --release` command to build and execute the code in release mode. If the `START` field is defined in the configuration file, the value in the `START` field will be executed directly. For more information on configuration file parameters, visit [configuration parameters](https://docs.squarecloud.app/en/getting-started/config-file#configuration-parameters). ## 🖥️ Preparing Project for Upload Before hosting your project on Square Cloud, you must first have the files of your project properly configured, so that you can host it later. The configuration (`squarecloud.app/.config`) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment. ## 📤 Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` # How to create your package.json file Source: https://docs.squarecloud.app/en/articles/how-to-create-your-package-json Learn how to create a package.json file for Node.js projects # Creating Your package.json File A `package.json` file is a standard way to specify the dependencies of your Node.js project. It lists all the external packages your project relies on, making it easier for others to reproduce your environment and for you to manage your dependencies. Here"s a step-by-step guide on how to create your `package.json` file. ## Step 1: Initialization There are two main paths to kickstart your package.json: ### Automatic (Recommended) Navigate to your project"s root directory and run `npm init -y`. This interactive prompt will guide you through filling in the basic details. ### Manual Create a file named `package.json` and write the `JSON structure yourself`. While this offers more control, it requires familiarity with the format. ## Step 2: Essential Fields Every package.json needs these key landmarks: * `name:` Your project"s unique identifier, like "my-project". * `version:` Your project"s current stage, typically starting with "1.0.0". * `description:` A concise overview of what your project does. ## Step 3: Dependencies Specify the exact version (using ==) for each package to ensure consistency and reproducibility List all the external packages your project relies on under the dependencies property. Use the package name followed by the desired version (e.g., "`discord.js`": "`^14.14.1`"). **Remember:** * Exact versions (using `==`): Pin your project to specific versions for predictable behavior. * Ranges (using `^` or `~`): Allow for minor or patch updates without manual intervention. ## Step 4: Additional Features Your package.json can be a treasure trove of other helpful features: * `scripts:` Define custom commands to automate tasks like testing or deployment. * `keywords:` Improve discoverability by specifying relevant keywords. * `author:` Share your project"s creator(s). ## Step 5: Share and Use Your package.json is a vital part of sharing your project. Include it in your version control system and use it to: * Install dependencies for newcomers with `npm install `. * Deploy your project to Square Cloud. ## Bonus Tips: * Use tools like `npm audit` to identify and address potential vulnerabilities in your dependencies. * Group related dependencies into sub-packages for better organization. * Keep your package.json concise and well-documented for future reference. * When setting up your package.json, you may also encounter the `devDependencies` property. This is used to list packages that are only needed during development, such as testing libraries or build tools. These dependencies are not included when the project is deployed to production environments, like Square Cloud. This helps to keep the production environment clean and free of unnecessary packages that are not needed for the app to run. By following these steps and tips, you"ll craft a package.json that steers your Node.js project towards smooth sailing and success. Remember, a well-managed dependency landscape is a happy developer"s landscape! # How to create your requirements.txt file Source: https://docs.squarecloud.app/en/articles/how-to-create-your-requirements Learn how to create a requirements.txt file for Python projects # Creating Your requirements.txt File A `requirements.txt` file is a standard way to specify the dependencies of your Python project. It lists all the external packages your project relies on, making it easier for others to reproduce your environment and for you to manage your dependencies. Here"s a step-by-step guide on how to create your `requirements.txt` file. ## Step 1: Activate Virtual Environment (optional but recommended) Before creating the `requirements.txt` file, it"s a good practice to work within a virtual environment to keep your project dependencies isolated. Activate your virtual environment using the appropriate command for your operating system. ## Step 2: List Dependencies Specify the exact version (using ==) for each package to ensure consistency and reproducibility Manually list all the external packages and their versions that your project depends on in the `requirements.txt` file. For example: ```plaintext requirements.txt theme={null} discord.py ``` ## Step 3: Review and Edit Open the `requirements.txt` file with a text editor and review the list of packages. You may want to add or remove packages or update their versions as needed. ## Step 4: Share and Use With your `requirements.txt` file ready, you can share it with your team or other developers. They can then create a virtual environment and install the exact same packages and versions. Host your project on Square now to take advantage of our seamless development environment and collaboration tools. ## Bonus Tips: * Update the `requirements.txt` file regularly as you add or update dependencies in your project. * Be cautious with using `pip freeze` with the system-wide Python environment, as it may include packages that are not strictly required for your project. Creating a `requirements.txt` file is a valuable step in managing your Python project"s dependencies and ensuring a seamless development experience for you and your collaborators. # Brand Source: https://docs.squarecloud.app/en/company/brand Discover the origins, symbolism, and intrinsic connection of our logo at Square Cloud, a flexible cloud infrastructure designed from the ground up for adaptability. ## Origin of the Logo The logo of Square Cloud has been thoughtfully designed to reflect the values and objectives of our company. It consists of two squares positioned at a specific angle, resulting in an appearance that resembles a "Docker container." ### The Meaning Behind the Logo 1. **Two Squares**: The two squares in our logo represent the solid foundation on which we build our cloud infrastructure. Each square symbolizes the robustness and reliability of our services. 2. **Docker Container**: The positioning of the squares was carefully chosen to evoke the image of a Docker container, which is a widely used technology in the world of cloud computing. This visually represents our flexible and adaptable approach to providing efficient and scalable solutions to our clients. ### The Flexible Infrastructure Our company was born with the vision of creating a highly flexible cloud platform capable of meeting the ever-evolving needs of businesses of all sizes. The Square Cloud logo, with its angular squares, symbolizes this commitment to flexibility. #### Key Features of Our Infrastructure: 1. **Elasticity**: Our infrastructure is designed to scale vertically and horizontally, allowing you to increase or decrease resources according to your business demands. 2. **Portability**: Just like Docker containers can run in different environments, our services can be easily migrated between public and private clouds, providing greater freedom of choice. 3. **Agility**: With container-based technology as the foundation, we can deploy solutions quickly, ensuring minimal downtime for deployments and updates. 4. **Scalability**: The two squares in our logo also represent the scalability of our services. With automated and optimized resources, we can handle intense and growing workloads. ### Our Online Domains To complement our commitment to flexibility, we are proud to provide a range of online domains where you can access our services and resources. These domains are designed to ensure ease of access and use for our valued clients: * [squarecloud.app](https://squarecloud.app): Our main domain, where you can find detailed information about our services, solutions, and company updates. * [dash.squarecloud.app](https://squarecloud.app/dashboard): Aliases to our dashboard, where you can access your Square Cloud account and manage your cloud infrastructure with ease. * [api.squarecloud.app](https://api.squarecloud.app): Our API domain, where you can find detailed information about our API and its endpoints. * [squareweb.app](https://squarecloud.app): Our official domain that connects our clients' projects with the world. We also have the following domains: * squarecloud.org -> squarecloud.app * squarecloud.dev -> squarecloud.app * squarecloud.xyz -> squarecloud.app * squarecloud.email -> squarecloud.app * squarecloud.com.br -> squarecloud.app Curiosity, we use .org & .email to send emails, like noreply@ emails. ## Conclusion The Square Cloud logo is much more than a simple visual representation. It encapsulates our company's philosophy and commitment to providing a flexible and reliable cloud infrastructure. # Legal Source: https://docs.squarecloud.app/en/company/legal Square Cloud Legal Information, EULA, and Privacy Policy ## End-User License Agreement (EULA) Welcome to Square Cloud! Before you proceed to use our services, please carefully read and understand our End-User License Agreement (EULA). By accessing or using any part of our platform, you agree to be bound by the terms and conditions outlined in this agreement. You can access the full End-User License Agreement [here](https://squarecloud.app/legal). ## Privacy Policy Protecting your data and privacy is of utmost importance to us. Our Privacy Policy outlines how we collect, use, and disclose your personal information when you use our services. It also explains the measures we take to safeguard your data. To learn more about our Privacy Policy, please visit [https://squarecloud.app/legal/policy](https://squarecloud.app/legal/policy). If you have any questions or concerns regarding our legal documents or need assistance, please contact our support team. # Support Source: https://docs.squarecloud.app/en/company/support Get in touch with Square Cloud Support Team ## Contact Information * General Inquiries: [contact@squarecloud.app](mailto:contact@squarecloud.app) * Legal Matters: [legal@squarecloud.app](mailto:legal@squarecloud.app) Support Center - Customer Service. Text us on Whatsapp. Text us on Telegram. Join our Discord community server. ## Social Media Connect with us on social media, but please note that support response times may vary: Follow us on Instagram! Follow us on Twitter! Subscribe! 🥰 For the quickest and most efficient support, we recommend using our Discord server or contacting the appropriate email addresses mentioned above. # How to create your squarecloud.app configuration file Source: https://docs.squarecloud.app/en/getting-started/config-file Learn how to create your Square Cloud configuration file ## What is the configuration file? The configuration file is a file that contains your application's parameters, such as the main file, memory, version and other settings. This file is used to configure and deploy your application on the Square Cloud platform. ```systemd squarecloud.app theme={null} MAIN=main_file.js DISPLAY_NAME=I am the configuration file MEMORY=512 VERSION=recommended ``` ## Creating the configuration file Creating the configuration file is very simple: just create a file named `squarecloud.app` or `squarecloud.config` and add the configuration parameters inside it. The configuration file can have two extensions: **.app** or **.config**. You can use `squarecloud.app` or `squarecloud.config`, whichever you prefer. Tip: use **.app** to help promote Square Cloud. 🥰😂 On **macOS**, we recommend using the **.config** extension. Note: **.app** or **.config** refers to the **file extension**, not the file name. Create a file with the selected extension and add the configuration parameters inside it. ## Configuration parameters Below you can see all the configuration parameters available for your configuration file. | Parameter | Type | Editable | Limit | Usage | | --------------- | ------- | :------: | --------- | ------------------------------------------------------------------- | | `MAIN*` | String | ❌ | 32 chars | Defines the main application file. Ex.: `index.js`, `main.py`, etc. | | `VERSION*` | String | ❌ | - | Language version (Ex.: `recommended`). | | `MEMORY*` | Integer | ✅ | - | Amount of memory in megabytes. | | `DISPLAY_NAME*` | String | ✅ | 32 chars | Display name of the application. | | `RUNTIME` | String | ❌ | - | The runtime environment. Ex.: `typescript`, `nodejs`, `go`. | | `DESCRIPTION` | String | ✅ | 280 chars | Description/metadata of the application. | | `AUTORESTART` | Boolean | ✅ | - | Auto-restart (`true` or `false`). | | `START` | String | ✅ | 256 chars | Custom start command. | | `SUBDOMAIN` | String | ✅ | 63 chars | Website subdomain (if applicable). | Editable parameters (✅) can be modified in the dashboard after deployment. Non-editable (❌) parameters require a full reupload of the application to make changes. ## Detailing the configuration parameters Below you can see the configuration parameters you can use in your configuration file. **Type**: String | **Editable**: ❌ | **Limit**: 32 chars Defines the main application file. ```systemd theme={null} MAIN=index.js ``` ```systemd theme={null} MAIN=src/loaders/index.js ``` When this parameter is set, the runtime environment will be inferred based on the main file extension This setting is **IGNORED** if you use the START parameter. **Type**: Integer | **Editable**: ✅ | **Limit**: Minimum 256MB (bot), 512MB (site) Defines the amount of memory your application will use. ```systemd theme={null} MEMORY=256 ``` The value must be specified in megabytes (MB). **Type**: String | **Editable**: ❌ | **Values**: `recommended`, `latest` or specific version We recommend using `recommended` for optimal stability. Defines the language version for your application. ```systemd theme={null} VERSION=recommended ``` | Language | `recommended` | `latest` | | ------------------ | ------------- | -------- | | Node.js \[JS & TS] | 24.11.0 | 25.1.0 | | Python | 3.13.9 | 3.14.0 | | Java | JDK 25 | JDK 25 | | Elixir | 1.19.2 | 1.19.2 | | Rust | 1.91.0 | 1.91.0 | | Ruby | 3.4.7 | 3.4.7 | | PHP | 8.4.14 | 8.4.14 | | Go | 1.25.4 | 1.25.4 | | C# | 9.0.10 | 9.0.10 | **Type**: String | **Editable**: ✅ | **Limit**: 32 chars Defines the display name of your application. ```systemd theme={null} DISPLAY_NAME=Admin BOT ``` **Type**: String | **Editable**: ✅ | **Limit**: 280 chars Defines the description of your application. ```systemd theme={null} DESCRIPTION=This bot is designed to help you with your daily tasks. ``` **Type**: Boolean | **Editable**: ✅ | **Values**: `true`, `false` | **Default**: `false` Defines whether the application should automatically restart on failure. ```systemd theme={null} AUTORESTART=true ``` **Type**: String | **Editable**: ✅ | **Limit**: 63 chars | **Default**: `undefined` Defines the subdomain for your site (web applications only). ```systemd theme={null} SUBDOMAIN=mysite ``` The final URL will be: `mysite.squareweb.app` **Type**: String | **Editable**: ❌ Defines a runtime environment manually. ```systemd theme={null} RUNTIME=nodejs ``` Check the accepted values and environments below. | Environment | RUNTIME | | ----------- | ------------------------ | | Nodejs | `nodejs`, `javascript` | | TypeScript | `typescript` | | Python | `python` | | C#/Dotnet | `c#`, `dotnet`, `csharp` | | Elixir | `Elixir` | | Java | `java` | | Rust | `Rust` | | PHP | `php` | | Golang | `go`, `golang` | | HTML/CSS | `static`, `html` | If you set this parameter, you'll don't need to set the MAIN, instead, you'll need to set a custom START command. **Type**: String | **Editable**: ✅ | **Limit**: 256 chars | **Default**: `undefined` Defines a custom start command. ```systemd theme={null} START=npm run start ``` This parameter **overrides** the default MAIN behavior. ## Configuration examples for bots Here are some examples of configuration for bots: ```systemd theme={null} # Required parameters. MAIN=index.js MEMORY=512 VERSION=recommended DISPLAY_NAME=Robin bot ``` ```systemd theme={null} # Example with all parameters. MAIN=index.js MEMORY=512 VERSION=recommended DISPLAY_NAME=Robin bot DESCRIPTION=This bot was created to help with your daily tasks. START=npm run start AUTORESTART=true ``` ## Configuration examples for sites Here are some examples of configuration for websites: The site URL will be: `mysite.squareweb.app` ```systemd theme={null} # Example with all parameters. MAIN=index.js MEMORY=1024 VERSION=recommended DISPLAY_NAME=My site DESCRIPTION=My site is really cool! SUBDOMAIN=mysite START=npm run build && npm run start AUTORESTART=true ``` `next.config.js` as MAIN is only used to let the system recognize the project as a JavaScript or TypeScript project (another .ts/.tsx file) ```systemd theme={null} # Example for a Next.js site. MAIN=next.config.js MEMORY=2048 VERSION=recommended DISPLAY_NAME=Next.js site DESCRIPTION=This site was built with Next.js. SUBDOMAIN=nextjs START=npm run build && npm run start AUTORESTART=true ``` # Cloud Hosting for Developers | Deploy in Seconds | Square Cloud Source: https://docs.squarecloud.app/en/getting-started/overview High-performance cloud hosting platform for developers. Deploy bots, websites, APIs and databases (Redis, MongoDB, PostgreSQL) in seconds with automatic scalability. Robust and uncomplicated infrastructure. export const ServicesCard = ({ src, title, description, href }) => (
{title}

{title}

{description}

);

Instant deployment for modern developers

We handle the infrastructure so you can focus on what you do best: create and innovate. Deploy in seconds and scale with one click.

Enterprise-Grade Features, No Hidden Costs

A complete platform with everything you need to scale your projects. Built by developers, for developers.

Smart Deployment

Automate your deployments with native GitHub integrations and a powerful CLI.

Unlimited Scalability

Your application adapts to demand, ensuring performance and cost control.

Enterprise-Grade Security

DDoS protection, WAF and automatic SSL on all applications, at no additional cost.

High Performance

Global infrastructure with NVMe SSDs and integrated CDN for maximum speed.

Managed Databases

Provision Redis, MongoDB, PostgreSQL and MySQL databases with one click.

Unlimited Traffic

Focus on growth, not bandwidth limits. No surprises on your bill.

Start building in minutes

Choose the tool that best fits your workflow.

CLI for Developers

Manage your entire infrastructure directly from the terminal. Ideal for automation and advanced workflows.

npm install -g @squarecloud/cli

Dashboard

A complete visual interface to deploy, manage and monitor your applications with ease.

Upload via drag-and-drop.

Before you begin

To get started, create a Square Cloud account. Then you can select the right plan for you.

If you've never used Square before, sign up to get started. If you already have an account, sign in to get started.

Explore the Platform

Make your first deployment in less than 5 minutes. Learn with real projects and step-by-step examples. Automate and integrate with our complete REST API. Join over 80,000 developers and get your questions answered.
# Quickstart Source: https://docs.squarecloud.app/en/getting-started/quick-start Go from zero to hero in minutes with Square Cloud. This guide will help you get started with Square Cloud and understand the power of our platform. ## Square Cloud Services 🚀 Square Cloud has been designed from the ground up to be a developer-friendly platform. The platform is composed of various services that can be used to deploy applications quickly and securely. Deploy your bots to Square Cloud and receive the best solutions for bot hosting. Square offers a strategic location for the most famous platforms, ensuring low latency and high availability. Deploy your web applications to Square Cloud and receive the best solutions for web hosting. We provide premium Cloudflare integration, fast DNS, and a Web Application Firewall (WAF) to ensure the best performance and security. Store your data with Square Cloud and enjoy the benefits of serverless storage. Our storage service is designed to be simple, scalable, and cost-effective. ## Upload your project 😁 You can upload your project to Square Cloud in a few simple steps, as shown below: For this example, we will use the JavaScript (Node.js) language. After accessing the dashboard, you need to create a configuration file. You can create a [configuration file](https://docs.squarecloud.app/en/getting-started/config-file) reading this article [here](https://docs.squarecloud.app/en/getting-started/config-file). ```systemd Example of a config file for a bot theme={null} MAIN=index.js MEMORY=512 VERSION=recommended DISPLAY_NAME=Batman bot DESCRIPTION=This bot is the dark knight of the night. ``` ```systemd Example for website. (URL: "batman.squareweb.app") theme={null} MAIN=index.js MEMORY=512 VERSION=recommended SUBDOMAIN=batman START=npm run build && npm run start DISPLAY_NAME=Batman website DESCRIPTION=This website is the dark knight of the night. ``` After creating the configuration file, you need to zip your project. ```bash Windows theme={null} 1. Locate the file or folder that you want to zip. 2. Press and hold (or right-click) the file or folder, select (or point to) Send to, and then select Compressed (zipped) folder. 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. ``` ```bash Linux theme={null} 1. Locate the file or folder that you want to zip. 2. Right-click the file or folder, then choose Compress from the shortcut menu. 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. ``` ```bash macOS theme={null} 1. Locate the file or folder that you want to zip. 2. Control-click the file or folder, then choose Compress from the shortcut menu. 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. ``` After uploading your project, click on the "Add New" button to deploy your project. # Limits and Restrictions Source: https://docs.squarecloud.app/en/platform/limitations-and-restrictions Discover the constraints and boundaries of the Square Cloud Platform. ## Minimum Resource Requirements Every project hosted on the Square Cloud Platform has specific minimum resource requirements to ensure optimal performance: * **Bots:** Minimum 256MB RAM required. * **Websites:** Minimum 512MB RAM required. * **Cache Databases:** Minimum 512MB RAM required. * **General Databases:** Minimum 1GB RAM required. ## Why Minimum RAM Requirements? Square Cloud enforces minimum RAM requirements to ensure application stability and optimal performance. These requirements are based on the typical resource consumption patterns of different application types. Insufficient RAM can lead to application crashes, poor performance, and degraded user experience. By setting these minimums, we guarantee that your applications have adequate memory to handle their core operations, background processes, and unexpected traffic spikes without compromising functionality. Please note that while Square Cloud offers plans with up to **1TB of RAM**, the **maximum RAM allocation** for any **application is 32GB**. If you require more than 32GB, please reach out to our support team for assistance. ## CPU Optimization & Limitation The CPU limitation logic aims to optimize performance by dynamically adapting to the application's needs. The code divides the default CPU allocation by two, promoting an efficient resource utilization approach. However, specific conditions alter this behavior: If the **application's default CPU allocation** is 1vCPU, the **CPU is set to 1**. (full release) **Otherwise**, the CPU **allocation varies based** on the **application's RAM size**: * If **RAM is less than or equal to 1024**, the CPU is set to the **maximum of half** of CPU or 1. * If **RAM is 2048** or **more**, the **CPU remains unchanged**. (full release) * For **RAM sizes between 1024 and 2048**, the CPU is set to **half of CPU**. This strategy aims to balance CPU efficiency with variable system demands, ensuring adequate performance across different scenarios. This approach is crucial to promote a high-quality experience, ensuring fair and efficient CPU resource allocation, optimizing application responsiveness, and reducing unnecessary resource consumption. ## Network Limitations Network limitations are essential to ensure fair resource distribution and a high-quality experience for all users.\ The **network speed increases by 50 Mbps** for every **additional 256 MB** of RAM allocated. Here are the network limitations based on RAM allocation: * **256 MB RAM:** 50 Mbps network speed * **512 MB RAM:** 100 Mbps network speed * **1024 MB RAM:** 200 Mbps network speed * **2048 MB RAM:** 400 Mbps network speed * **4096 MB RAM:** 800 Mbps network speed * **8192 MB RAM:** 1600 Mbps network speed * **10240 MB RAM:** 2000 Mbps network speed For applications requiring network speeds exceeding 2000 Mbps, please contact our support team to discuss your specific needs. Square Cloud is committed to providing a balance between resource availability and performance, ensuring a seamless experience for all users. ## Storage Limitations Storage limitations are crucial to ensure equitable resource distribution and to provide a high-quality experience for all users. * **All projects:** Each project is allocated 10GB of storage. ## Service Limits Squarecloud implements service limits to ensure fair and efficient resource utilization for all users. These limits are categorized as: ### LACK\_OF\_RAM If an application exceeds the allocated RAM limit as specified in its [squarecloud.app config file](/en/getting-started/config-file), it will be flagged for violating LACK\_OF\_RAM and shut down to preserve its own and everyone else's safety. ### LACK\_OF\_CPU If an application exceeds and stresses its allocated processing limit, it will be flagged for violating LACK\_OF\_CPU and shut down to preserve its own and everyone else's safety. It is important to remember that Square does not allow the hosting of applications that mine cryptocurrencies, for example. Square Cloud is dedicated to providing a secure and balanced environment for all users while ensuring compliance with its policies. # Platform Overview Source: https://docs.squarecloud.app/en/platform/overview How to use the power of Square Cloud to create your own applications. ### Power, Flexibility and Security. Square Cloud is the foundation of an ecosystem of products and services designed to simplify the management of your applications, websites and projects. Operating as a centralized hub, our platform offers an intuitive and integrated experience so you can focus on what really matters: creating and innovating. #### Our Vision and Commitment We were born with the goal of creating an extremely flexible cloud platform, capable of adapting to the dynamic needs of businesses of all sizes. This vision is symbolized in our logo, where the angular squares represent our adaptability and commitment to continuous evolution. * The design directly references a Docker container, the technology that underpins our infrastructure. This choice reflects our dedication to offering efficient, scalable solutions aligned with the best practices in the cloud universe. Our commitment is to provide a platform that not only meets but exceeds the expectations of every developer who trusts in our infrastructure. Built by developers, for developers, Square Cloud offers an exceptional user experience that transforms ideas into tangible results. #### Robust and Secure Infrastructure To ensure maximum performance and protection, we operate with cutting-edge infrastructure located in a data center in New York, a highly secure and resilient environment. **High-Speed Network and Advanced Protection:** * **10 Gbps connectivity per server:** Ensures ultra-fast data transfer and minimal latency for your applications. * **Multi-layer DDoS protection:** A robust defense system that protects your projects against denial-of-service attacks, ensuring availability. * **24/7 monitoring:** Our network is continuously monitored by specialists to prevent failures and maintain performance at optimal levels. **Physical Security and Redundancy:** * **Controlled Access:** Strict biometric and access card controls ensure that only authorized personnel enter the facilities. * **Redundant Power Systems:** Multiple backup systems guarantee service continuity, even during main electrical grid failures. * **Fire Protection and Structural Resilience:** The data center features advanced fire suppression systems (pre-action sprinklers and FM200) and was built to withstand extreme weather conditions. **Additional features of our infrastructure:** * **Elasticity**: Our infrastructure is designed to scale vertically and horizontally, allowing you to increase or decrease resources according to your business demands. * **Agility**: Rapid deployment of solutions and updates, ensuring minimal downtime. We use our container orchestration technology, "Square Orchestrator," to optimize resource allocation and application deployment, resulting in greater efficiency and speed. * **Scalability**: Our services are designed to handle intensive and constantly growing workloads, ensuring your application remains responsive and efficient. #### Certifications and Compliance The security and integrity of your data are our priority. Therefore, our environment has internationally recognized certifications that attest to our commitment to the most rigorous security practices: * **SSAE-16 SOC 2 and SOC 2 Type II:** These certifications demonstrate that our security controls, availability, processing integrity, and data confidentiality have been rigorously audited and approved. * **ISO 27001:** Confirms that we follow global best practices for an Information Security Management System (ISMS), ensuring a systematic and continuous approach to data protection. The Square Cloud platform combines advanced features with cutting-edge infrastructure, ready to boost your projects in a scalable, secure, and high-performance environment. Learn about the limitations and rules of the Square Cloud platform. # Serverless Storage - Square Cloud Blob Storage Source: https://docs.squarecloud.app/en/services/blob Scalable serverless storage with global CDN, zero transfer fees, and 99.999999999% availability. Square Cloud Blob Storage is ideal for applications requiring reliable storage. ## Why choose Square Cloud Blob Storage? As the **largest bot hosting platform in Latin America**, trusted by **80 of the 100 largest Brazilian Discord servers**, we built Blob Storage to overcome the **limitations imposed by Discord’s CDN**. Our enterprise-grade solution ensures **stability and availability** for thousands of developers who need reliable asset storage. In short, **Blob Storage** is a **serverless storage service** by Square Cloud that is **fast and scalable**, with **generous quotas** included in every plan and a **flexible pay-as-you-go model** for overages. Blob Storage is currently in beta. If you have any feedback, please [contact us](https://docs.squarecloud.app/en/sac). ## Key Features **Zero ingress/egress fees** – free data transfer. **Automatic resource orchestration** with **dynamic provisioning**. **Optimized distribution** via Cloudflare’s global network with **edge caching**. **Up to 1PB of storage** and **1 billion free requests/day** available. ## Quotas and Pricing Blob Storage offers clear, transparent pricing so you can choose the plan that fits your needs. ### Included Quotas Each paid plan includes a **free storage quota** at no extra cost: | Plan | Free Storage Included | | ---------- | --------------------- | | Hobby | **15 GB** | | Standard-4 | **30 GB** | | Standard-6 | **50 GB** | | Standard-8 | **100 GB** | | Pro-12 | **200 GB** | | Pro-16 | **250 GB** | | Enterprise | **250 GB** | ### Pay-as-you-go Overage If your usage exceeds the included quota, you automatically switch to **pay-as-you-go**, paying **only for the extra space** you use. **R\$ 0.25 per additional GB** beyond your free quota. The Blob Storage service and pay-as-you-go feature are **only available** to subscribers of **paid plans**. ## Supported File Extensions Our platform enforces a **strict MIME type whitelist** to ensure service **security and integrity**. This extension restriction is a **critical security measure** that prevents malicious file uploads and maintains compliance with **corporate security policies**. | Category | Supported Extensions | | --------------- | --------------------------------------------------------------------------------------------------- | | **Video** | `.mp4`, `.mpeg`, `.webm`, `.flv`, `.m4v` | | **Image** | `.jpg`, `.png`, `.apng`, `.tiff`, `.gif`, `.webp`, `.bmp`, `.svg`, `.ico`, `.cur`, `.heic`, `.heif` | | **Audio** | `.wav`, `.ogg`, `.opus`, `.m4a`, `.mp3`, `.aac` | | **Text** | `.html`, `.css`, `.csv`, `.txt`, `.sql` | | **Application** | `.xml`, `.sql`, `.sqlite3`, `.p12`, `.pdf`, `.json`, `.js` | **MIME Type Validation**: All files undergo **binary signature verification** to prevent **extension spoofing** and **malicious uploads**. To request support for additional file types or discuss specific use cases, [contact our technical team](https://docs.squarecloud.app/en/sac). ## Performance & Benchmarks Our infrastructure has undergone **extensive benchmarks** to ensure Square Cloud provides a **robust, reliable serverless storage solution**. Here are some key findings: * **Latency**: Average file receive latency of **\~11ms**. * **Throughput**: Average transfer rates of **\~12.5–18.75 MB/s (100–150 Mbps)** on typical connections, reaching **up to \~500 Mbps** on >1–2 Gbps networks. * **Availability**: Average availability of **99.999999999% (11 nines)** (S3-based design). In our internal tests in New York, latency remains **negligibly low**, well **below average**. **Note**: Benchmark results are based on controlled tests and may vary significantly with **geographic location**, **file sizes**, **network quality**, and **peak usage**. For best performance, run tests in your production environment. **Regional Limitations**: Users in **Africa** and some **Asian regions** may experience higher latencies due to **physical distance from data centers** and **local network infrastructure**. ## How to host your files Upload your files to the [POST endpoint](/en/blob-reference/endpoint/post). Access your files using the URL provided in the upload response. The process is **simplified**: use your account API key for authentication and upload via a **single HTTPS request**. **No additional configuration** or complex infrastructure needed. Square Cloud **handles everything** for you. # Bot Hosting Source: https://docs.squarecloud.app/en/services/bots Host your Discord, WhatsApp and Telegram bots on the largest platform in Latin America. Enterprise performance, advanced security and development tools for your project. ## Why choose Square Cloud? We are the **largest bot hosting platform in Latin America**, trusted by **80 of the 100 largest Brazilian Discord servers**. Our platform was built with developers' needs in mind, offering an optimized environment and tools that simplify your project management. Cutting-edge hardware with **enterprise Samsung NVMe SSDs** and **10Gbps** networks ensuring **maximum performance** and **ultra-low latency** for your bots. We offer **CLI**, **SDKs**, **VSCode extension** and **GitHub Actions** to **optimize your workflow** and **accelerate development**. Integrated protection with **Square Shield** to keep your bot **secure** and **within API limits**, preventing **bans** and **instabilities**. **Exclusive** technology for **1-click** restore points, included **at no additional cost**, ensuring **complete security** for your data. **Proven trust:** Our reputation has been built through years of serving developers from Brazil and throughout Latin America, providing stability and quality you can trust for your most important projects. *** ## Supported environments We offer broad compatibility so you can develop with your preferred technology. ### Platforms ### Languages In addition to these, we support various other languages and libraries. Our infrastructure is flexible to adapt to your project's needs. *** ## Main Features ### Cutting-Edge Infrastructure Our network is built with enterprise-level **Samsung NVMe SSDs** and **10Gbps uplinks** per cluster, ensuring ultra-fast and stable connections. This translates to a bot with minimal response time and high availability. ### Security with Square Shield **Square Shield** is our intelligent protection layer. It monitors and protects your bot to ensure it doesn't exceed platform API request limits (like Discord), preventing bans and instabilities. ### Simplified Management We perform automatic backups of your application daily, allowing you to restore a previous version with just one click in case of problems. Access complete and real-time logs of your application to debug errors and efficiently monitor your bot's behavior. Monitor resource consumption (CPU, RAM, Network) and your bot's overall performance through an intuitive analytics panel. ### Development Tools To optimize your workflow, we offer a complete ecosystem of tools: Manage your applications directly from the terminal. Deploy, check logs, and much more, quickly and practically. ```bash theme={null} npm install -g @squarecloud/cli squarecloud auth login ``` Integrate hosting management into your favorite code editor, simplifying the development and deployment process. Automate continuous deployment (CI/CD) of your bot. With each `push` to your repository, your application is automatically updated on our platform. **Attention:** To use deployment via GitHub Actions, you need to configure an API `token` in your repository secrets. Check our specific documentation for the step-by-step guide. ## How to host my bot? The first step to host your bot on **Square Cloud** is creating a detailed configuration file. This file is not just a simple text document, but a comprehensive guide that defines the settings for the application on **Square Cloud**. It functions as an architectural blueprint for your project on the platform. Once you've acquired the plan, you need to create this file, detailing each configuration and filling it out correctly. Details on how to create this file are available [here](https://docs.squarecloud.app/getting-started/config-file), with a step-by-step guide. With the configuration file ready, the next step is preparing your application for upload. This involves placing the application files and the **Square Cloud** configuration file inside a .zip file. However, not all files need to be included in this .zip. Files like `node_modules`, `package-lock.json`, `pyproject.toml`, and `poetry.lock` are not necessary, as they can be automatically generated on the server side. A list of files that don't need to be sent is available [here](https://docs.squarecloud.app/en/faqs/automatic-deletion-files-when-deploying-an-application-to-squarecloud), helping ensure only necessary files are in the .zip, making the upload process faster and smoother. Another crucial aspect is including the dependencies file in the .zip. This file tells the **Square Cloud** platform which dependencies to install for your project. For a Node.js project, this file is `package.json`, and for a Python project, it's `requirements.txt`. These files list the libraries and packages necessary for the application to function correctly. Keeping these files updated is crucial to avoid installation errors. Additionally, it's important to note that native dependencies, like `node-fetch` in Node.js and `random` in Python, should not be included in these files, as they are native libraries. After following all the steps and configuring your project for **Square Cloud**, it's time to upload your bot. Access the upload page on the **Square Cloud** website and send your .zip file [here](https://squarecloud.app/en/upload). The process is simple: select your .zip file and click the upload button. The **Square Cloud** platform will start the deployment process, installing necessary dependencies and configuring the environment based on the configuration file. # Website Hosting Source: https://docs.squarecloud.app/en/services/sites Professional website hosting with enterprise performance, Cloudflare Premium WAF security, free global CDN and ultra-fast DNS. Automatic deployment, free SSL and support for all modern frameworks. ## Why choose Square Cloud? Our platform is built by a specialized cloud infrastructure team **for developers**, combining **cutting-edge hardware** with **tools that streamline your workflow** and ensure **application stability**. Protect your site with the most advanced security technology: **Cloudflare Premium WAF** integrated + **Square Shield Enterprise** included for free. Enterprise-grade security at no extra cost. **Next-gen hardware** with **Samsung enterprise NVMe SSDs** and **10Gbps networks** delivering **exceptional performance** and **ultra-low latency**. Includes **free global CDN** to ensure your site **loads instantly**. **Enterprise DNS with instant global propagation**. Automatically configure your domain with **40% faster resolution** than competitors. Your visitors access your site instantly, anywhere in the world. **Proprietary instant restore point technology** with **99.9% reliability tested by over 50,000 developers**. Recover your data with one click, no data loss, and **zero downtime**—included for free. ## Supported environments We offer broad compatibility so you can host your site using your preferred technology. ### Frameworks We provide native support for the most popular frameworks on the market, ensuring compatibility and performance. Beyond the frameworks shown above, our platform offers **universal support** for virtually any framework or library. Our flexible infrastructure automatically adapts to your project's specific needs, ensuring compatibility with your chosen technology. ### Languages ## Developer ecosystem Optimize your workflow with our development tools: * **Square Cloud CLI:** Manage your applications directly from the terminal. * **VSCode Extension:** Integrate hosting management into your editor. * **GitHub Webhooks:** Configure automatic deployments based on events. * **GitHub Actions:** Automate deployments via intelligent workflows. * **SDKs:** Interact with our API programmatically. In conclusion, Square Cloud offers a comprehensive set of features and support to ensure that your site is not only hosted efficiently but also fortified against the challenges of the digital landscape. Elevate your online presence with Square Cloud hosting and experience the innovation and robustness that define this advanced technology platform. ## Custom domain **Set up your professional domain in minutes** and join the thousands of companies that trust Square Cloud for their mission-critical projects. Simplified process with automatic SSL and instant global propagation. Thinking about a custom domain? Square Cloud makes it easy. ## How to host my website? The first step to host your site on **Square Cloud** is to create a detailed configuration file. This file is not just a simple text document but a comprehensive guide that defines your application's settings on **Square Cloud**. It serves as an architectural blueprint for your project on the platform. Once you have your plan, you need to create this file by detailing each setting and filling it out correctly. Details on how to create this file are available [here](https://docs.squarecloud.app/en/getting-started/config-file) with a step-by-step guide. Remember to include the following fields in your configuration file: * **SUBDOMAIN:** The subdomain for your site.
Example: `SUBDOMAIN=test` (test.squareweb.app) * **MEMORY:** The amount of RAM, with a **minimum of 512MB**.
With the configuration file ready, the next step is to prepare your application for upload. This involves placing the application files and the Square Cloud configuration file into a .zip archive. However, not all files need to be included in this .zip. Files like `node_modules`, `package-lock.json`, `pyproject.toml`, `poetry.lock`, and `__pycache__` are not required, as they can be generated automatically on the server side. A list of files that don’t need to be uploaded is available [here](https://docs.squarecloud.app/en/faqs/automatic-deletion-files-when-deploying-an-application-to-squarecloud), helping ensure that only the necessary files are in the .zip, making the upload process faster and smoother. Another crucial aspect is including the dependencies file in the .zip. This file tells the Square Cloud platform which dependencies to install for your project. For a Node.js project, this file is `package.json`, and for a Python project, it’s `requirements.txt`. These files list the libraries and packages required for your application to function correctly. Keeping these files up to date is crucial to avoid installation errors. Additionally, it’s important to note that native dependencies, such as `node-fetch` in Node.js and `random` in Python, should not be included in these files, as they are built-in libraries. If you can set a `port` in your code or the `START` parameter, always set it to `port 80`. The only exception is when hosting a Lavalink server—see more [here](https://docs.squarecloud.app/en/tutorials/how-to-create-your-lavalink-server). After following all the steps and configuring your project for Square Cloud, it’s time to upload your site. Go to the upload page on the Square Cloud website and upload your .zip file [here](https://squarecloud.app/en/dashboard/upload). The process is straightforward: select your .zip file and click the upload button. Square Cloud will begin the deployment process, installing the necessary dependencies and setting up the environment based on your configuration file.
# Professional Django Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/api/django Complete guide for developing and hosting professional Django applications on Square Cloud. ## Professional Django Project Development * Before starting, make sure you have Python and pip installed on your system. If you don't have them yet, you can download them from the [official Python website](https://www.python.org/) and [official Pip website](https://pypi.org/). * Next, you'll need to create an account on Square Cloud, which can be done through the [signup page](https://squarecloud.app/en/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). With Python and pip installed, you can create a new Django project. First, install Django using pip: ```bash theme={null} pip install django ``` Next, create a new Python file (e.g., `app.py`) and add the following code to create a basic Django application: ```python app.py theme={null} from django.conf import settings from django.http import HttpResponse from django.urls import path from django.core.wsgi import get_wsgi_application # Basic Django settings settings.configure( DEBUG=False, # Disable debug mode SECRET_KEY='mysecretkey', # Define your secret key ALLOWED_HOSTS=['*'], # Allow all hosts for simplicity ROOT_URLCONF=__name__, # Set the root URL configuration to this module MIDDLEWARE_CLASSES=(), # Use an empty tuple to disable middleware ) # Simple view def index(request): return HttpResponse("Hello world!") # Return a simple HTTP response # URL configuration urlpatterns = [ path('', index), # Map the root URL to the index view ] # WSGI application application = get_wsgi_application() # WSGI server if __name__ == "__main__": from wsgiref.simple_server import make_server httpd = make_server('', 80, application) # Serve the application using WSGI server on port 80 print("Django server running on port 80...") httpd.serve_forever() # Start the server ``` In the code above, we created a basic route that returns "Hello, World!" when accessed. The application is configured to run on port 80, which is the default port for HTTP traffic. ## Dependency Management with requirements.txt File The `requirements.txt` file is a file that lists all external libraries needed for your project. You should list all the libraries that your project will use, excluding native libraries like `random` and `datetime`. This file should be included when uploading your application to Square Cloud. ```txt requirements.txt theme={null} django ``` ## Creating the Square Cloud Configuration File The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Configuring the START Field In the Square Cloud configuration file, the **START** field is optional and only necessary if you are using a custom script to start the website. In the provided example, the **START** field is not necessary. ## Purchasing a Plan Before Uploading the Project Before uploading your project to Square Cloud, it is important to understand that you need to purchase a plan. The type of plan you choose will depend on the resources required by your application. You can view our plans [here](https://squarecloud.app/en/pricing). **Wondering how much RAM and CPU your plan needs to host a Django application?** Don't worry, we're here to help. Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It was built by experienced developers and takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. Our **[Standard](https://squarecloud.app/en/pricing)** plan offers **4GB** of RAM and **4vCPU**, which should be sufficient for most Django applications. However, if you are working on a larger project and seeking extra stability, we recommend considering our Pro plan. With additional resources, you can maintain stability even during demand spikes. To purchase, simply click [here](https://squarecloud.app/en/pay?plan=pro). ## Uploading the Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` ## Additional Resources For more information about Django and its tools, visit the [official Django documentation](https://docs.djangoproject.com/en/5.0/). There, you will find detailed guides, tutorials, and API documentation to help you make the most of Django. ## Troubleshooting icon: "python" # Professional Express Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/api/express Complete guide for developing and hosting robust Express applications on Square Cloud. ## Professional Express Application Development * Before starting, make sure you have Node.js and npm installed on your system. If you don't have them yet, you can download them from the [official Node.js website](https://nodejs.org/). * Next, you'll need to create an account on Square Cloud, which can be done through the [signup page](https://squarecloud.app/en/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ### Express Configuration To use Express, you need to install it on your system. Run the following command: ```bash theme={null} npm install express ``` This command installs the `express` package on your system, allowing you to use Express in your terminal. ### Creating an Express Project To create a new Express project, you can start by creating a new file and writing the following code: ```javascript app.js theme={null} // Importing the Express module const express = require('express'); // Creating a new Express application const app = express(); // Defining the port as 80 // Port 80 is the default port for HTTP traffic. const port = 80; // Defining a route handler for the '/' route // This route handler sends 'Hello World!' when accessed. app.get('/', (req, res) => { res.send('Hello World!'); }); // Making our Express application listen on port 80 app.listen(port, () => { // This code block will be executed once the server is listening on port 80 console.log(`Example app listening on port ${port}`); }); ``` ## Creating the Square Cloud Configuration File The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Configuring the START Field In the Square Cloud configuration file, the **START** field is optional and only necessary if you are using a custom script to start the website or API. In the provided example, the **START** field is not necessary. ## Purchasing a Plan Before Uploading the Project Before uploading your project to Square Cloud, it is important to understand that you need to purchase a plan. The type of plan you choose will depend on the resources required by your application. You can view our plans [here](https://squarecloud.app/en/pricing). **Wondering how much RAM and CPU your plan needs to host an Express application?** Don't worry, we're here to help. Express.js is a Node.js framework that provides minimal features for building web servers. It is easy to learn, highly flexible, and suitable for a wide range of applications, making it an excellent choice for web development. Our **[Standard](https://squarecloud.app/en/pricing)** plan offers **4GB** of RAM and **4vCPU**, which should be sufficient for most Express applications. However, if you are working on a larger project or need more stability, we recommend considering our Pro plan. With additional resources, you can ensure smooth performance even under high demand. To purchase, simply click [here](https://squarecloud.app/en/pay?plan=pro). ## Uploading the Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` ## Additional Resources For more information about Express and its tools, visit the [official Express documentation](https://expressjs.com/). There, you will find detailed guides, tutorials, and API documentation to help you make the most of Express. ## Troubleshooting # Professional High-Performance Fastify Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/api/fastify Complete guide for developing and hosting high-performance Fastify applications on Square Cloud. ## High-Performance Fastify Application Development * Before starting, make sure you have Node.js and npm installed on your system. If you don't have them yet, you can download them from the [official Node.js website](https://nodejs.org/). * Next, you'll need to create an account on Square Cloud, which can be done through the [signup page](https://squarecloud.app/en/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ### Fastify Configuration To use Fastify, you need to install it on your system. Run the following command: ```bash theme={null} npm install fastify ``` This command installs the `fastify` package on your system, allowing you to use Fastify in your terminal. ### Creating a Fastify Project To create a new Fastify project, you can start by creating a new file and writing the following code: ```javascript app.js theme={null} // Importing the Fastify module const fastify = require('fastify')({ logger: true }); // Defining a route handler for the '/' route // This route handler sends 'Hello, World!' when accessed. fastify.get('/', async (request, reply) => { return 'Hello World!'; }); // Making our Fastify application listen on port 80 fastify.listen({ port: 80 }) .then((address) => { // This code block will be executed once the server is listening on port 80 fastify.log.info(`Example app listening at ${address}`); }) .catch((err) => { // This code block will be executed if there's an error trying to listen on port 80 fastify.log.error(err); process.exit(1); }); ``` ## Creating the Square Cloud Configuration File The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Configuring the START Field In the Square Cloud configuration file, the **START** field is optional and only necessary if you are using a custom script to start the website or API. In the provided example, the **START** field is not necessary. ## Purchasing a Plan Before Uploading the Project Before uploading your project to Square Cloud, it is important to understand that you need to purchase a plan. The type of plan you choose will depend on the resources required by your application. You can view our plans [here](https://squarecloud.app/en/pricing). **Wondering how much RAM and CPU your plan needs to host a Fastify application?** Don't worry, we're here to help. Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture. It is easy to learn, highly flexible, and suitable for a wide range of applications, making it an excellent choice for web development. Fastify also has excellent production capabilities, making it a robust choice for building and deploying production-level applications. It is designed to be efficient, fast, and lightweight, ensuring that your applications run smoothly and reliably. Our **[Standard](https://squarecloud.app/en/pricing)** plan offers **4GB** of RAM and **4vCPU**, which should be sufficient for most Fastify applications. However, if you are working on a larger project or need more stability, we recommend considering our Pro plan. With additional resources, you can ensure smooth performance even under high demand. To purchase, simply click [here](https://squarecloud.app/en/pay?plan=pro). ## Uploading the Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` ## Additional Resources For more information about Fastify and its tools, visit the [official Fastify documentation](https://fastify.dev/). There, you will find detailed guides, tutorials, and API documentation to help you make the most of Fastify. ## Troubleshooting # How to Host a Flask Application on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/api/flask Complete guide to creating and hosting Flask applications on Square Cloud with professional configuration and production deployment. ## Professional Flask Project Development To deploy robust web applications using Flask on Square Cloud, it's essential to follow development best practices and production environment configuration. ### Essential Technical Prerequisites * **Python and pip**: Make sure Python and pip are installed on your system. If you don't have them, download from the [official Python website](https://www.python.org/) and [Pip](https://pypi.org/). * **Square Cloud account**: Create your account via the [signup page](https://squarecloud.app/pt-br/signup) using your email address. * **Active paid plan**: A paid plan is required to ensure adequate resources for Flask applications. Check our [available plans](https://squarecloud.app/pt-br/pricing) and choose the one that fits your needs. ### Flask Environment Setup With Python and pip installed, create your Flask project. First, install the required dependencies: ```bash Terminal theme={null} pip install flask pip install waitress ``` Next, create a Python file (for example, `app.py`) and add the following code to implement a basic Flask application: ```python app.py theme={null} # Import the Flask class from the flask module from flask import Flask # Create an instance of the Flask class app = Flask(__name__) # Define a route for the root URL (/) that returns 'Hello, World!' @app.route('/') def hello_world(): return 'Hello, World!' # Check if this script is being run directly (not imported as a module) if __name__ == '__main__': # Run the Flask application on host 0.0.0.0 (all available network interfaces) and port 80 app.run(host='0.0.0.0', port=80) ``` ## Production Environment Setup with Waitress For professional production deployment, it is recommended to use the Waitress WSGI server, which provides improved stability and performance for Flask applications. ```python app.py theme={null} from flask import Flask # Create an instance of the Flask application app = Flask(__name__) # Define a route for the root URL (/) that returns 'Hello, World!' @app.route('/') def hello_world(): return 'Hello, World!' # If this script is run directly (not imported as a module) if __name__ == '__main__': from waitress import serve # Import the serve function from Waitress # Serve the Flask application using Waitress on host 0.0.0.0 (all interfaces) and port 80 serve(app, host='0.0.0.0', port=80) # Print a message indicating the server started successfully on port 80 print("Server started successfully on port 80.") ``` In the code above, we implement a simple route that returns "Hello, World!" when accessed. The application is configured to run on port 80, which is the default HTTP port for production environments. ## Dependency Management with requirements.txt The `requirements.txt` file is an essential component that lists all external libraries required for your project. Make sure to include all used dependencies, excluding Python's built-in modules such as `random` and `datetime`. This file must be included when submitting your application to Square Cloud. ```txt requirements.txt theme={null} flask waitress ``` ## Square Cloud Configuration File The `squarecloud.app` file is an essential configuration file used to set up your application on Square Cloud. It defines the name, description, version, main file, and other fundamental settings. ## START Field Configuration In the Square Cloud configuration file, the **START** field is optional and only required if you are using a custom script to start the website or API. In the provided example, the **START** field is not necessary. ## Purchasing a Plan Before Uploading Your Project Before uploading your project to Square Cloud, it's important to understand that a plan purchase is required. The plan you choose will depend on the resources your application needs. See our [available plans](https://squarecloud.app/pt-br/pricing). **Wondering how much RAM and CPU your plan needs to host a Flask application?** Don't worry — we're here to help. Flask is known for being lightweight, especially for small projects or learning purposes. Our **[Standard](https://squarecloud.app/en/pricing)** plan offers **4GB** of RAM and **4vCPU**, which should be sufficient for most Flask applications. However, if you're working on a larger project and need extra stability, we recommend considering our Pro plan. With additional resources, you can maintain stability during traffic spikes. To purchase, just click [here](https://squarecloud.app/en/pay?plan=pro). ## Uploading Your Project to Square Cloud After preparing all project files, upload them to Square Cloud to host your application professionally. Go to the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed on your machine. If you don't have it yet, run the following command in the terminal: ```bash Terminal theme={null} npm install -g @squarecloud/cli ``` If you already have it installed, we recommend updating it. To do so, run the following command in the terminal: ```bash Terminal theme={null} squarecloud update ``` ```bash Terminal theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` To authenticate and use other CLI commands, find your authorization key [here](https://squarecloud.app/en/account/security) by clicking "Request API Key". After obtaining your key, run the following command: ```bash Terminal theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, run the following command, providing the path to your zip file: ```bash Terminal theme={null} squarecloud upload zip ``` ## Additional Resources and Documentation For more detailed information about Flask and its advanced tools, visit the [official Flask documentation](https://flask.palletsprojects.com/en/3.0.x/). There you will find in-depth technical guides, specialized tutorials, and full API documentation to make the most of Flask's features. ## Troubleshooting # Professional Laravel Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/api/laravel Complete guide for developing and hosting high-performance Laravel applications on Square Cloud. ## Professional Laravel Application Development * Before starting, make sure you have **PHP (>= 8.x)** and **Composer** installed on your system. If you don't have them yet, you can download them from the official websites, [PHP](https://www.php.net/) and [Composer](https://getcomposer.org/download/). * Next, you'll need to create an account on Square Cloud, which can be done through the [signup page](https://squarecloud.app/en/signup). * Finally, you need to have an active paid plan on your account. You can view and purchase a plan according to your needs [here](https://squarecloud.app/en/pricing). ### Laravel Installation To use Laravel, install it globally using Composer with the following command: ```bash theme={null} composer global require laravel/installer ``` After installation, you can create a new Laravel project with: ```bash theme={null} laravel new myapp ``` ### Creating a Laravel Project After creating the project, navigate to the folder and start the development server: ```bash theme={null} cd myapp php artisan serve ``` This will start a local server, usually on `http://localhost:8000`. ### Basic Route Example Here is a basic example of a route in `routes/web.php`: ```php theme={null} The squarecloud.app file is a configuration file used to define your application's name, description, version, main file, and other essential settings. ## Configuring the START Field In the Square Cloud configuration file, the **START** field is optional and only necessary if your application requires a custom command to start. We already have Swoole installed in the environment if you want to serve it with Swoole webserver. Check [here](https://docs.squarecloud.app/en/articles/getting-started-with-php#php-with-swoole) ## Purchasing a Plan Before Uploading the Project Before uploading your project to Square Cloud, make sure you have an active plan with enough resources. Laravel applications typically run well on the **Standard** plan (4GB RAM, 4vCPU), but more complex projects may benefit from the **Pro** plan. **Not sure how much RAM and CPU you need for Laravel?** Laravel is a full-featured backend framework that may require more resources depending on the size of your application. Our Standard plan is suitable for most projects. To purchase a plan, click the appropriate link in the pricing page. ## Additional Resources For more information about Laravel, visit the official documentation available [here](https://laravel.com/docs/12.x). It provides detailed guides, examples, and API references to help you build powerful applications. ## Troubleshooting # Professional NestJS Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/api/nestjs Complete guide for developing and hosting robust NestJS applications on Square Cloud. ## Professional NestJS Application Development * Before starting, make sure you have Node.js and npm installed on your system. If you don't have them yet, you can download them from the [official Node.js website](https://nodejs.org/). * Next, you'll need to create an account on Square Cloud, which can be done through the [signup page](https://squarecloud.app/en/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ### NestJS CLI Configuration To use the NestJS command line interface (CLI), you need to install it globally on your system. Run the following command: ```bash theme={null} npm install -g @nestjs/cli ``` This command installs the `@nestjs/cli` package globally on your system, allowing you to use the `nest` command from anywhere in your terminal. ### Creating a NestJS Project To create a new NestJS project, run the following command: ```bash theme={null} nest new my-app ``` In this command, `nest new my-app` is used to create a new NestJS project. The `nest new` command is a tool that comes with `nest`, the NestJS CLI (Command Line Interface). It is used to initialize a new NestJS application. `my-app` is the name of the new application. This command creates a new directory called `my-app` and sets up the necessary files and dependencies for a basic NestJS application. ## Configuring Port 80 After generating the NestJS project with the `nest new my-app` command, the file you need to modify to change the port is `main.ts`. This file is located at the root of your project directory, inside the `src` folder. ```typescript theme={null} import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); await app.listen(80); // Change the port number here to 80 } bootstrap(); ``` Port 80 is the default port for HTTP traffic. ## Application Compilation NestJS uses TypeScript, so you must compile your TypeScript code to JavaScript before running your application. You can compile your application by running the following command: ```bash theme={null} npm run build ``` This command executes the `build` script defined in your `package.json` file, which in turn runs the `nest build` command. This command compiles your TypeScript code to JavaScript. ## Creating the Square Cloud Configuration File The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Configuring the MAIN Field You need to specify the main file of your application in the `MAIN` field of squarecloud.app. For a NestJS application, the main file is the compiled JavaScript file from your `main.ts` file, which is `dist/main.js`. Here's how you can configure it: ```app squarecloud.app theme={null} MAIN=dist/main.js ``` ## Configuring the START Field In the Square Cloud configuration file, the **START** field is optional and only necessary if you are using a custom script to start the website or API. In the provided example, the **START** field is not necessary. ## Purchasing a Plan Before Uploading the Project Before uploading your project to Square Cloud, it is important to understand that you need to purchase a plan. The type of plan you choose will depend on the resources required by your application. You can view our plans [here](https://squarecloud.app/en/pricing). **Wondering how much RAM and CPU your plan needs to host a NestJS application?** Don't worry, we're here to help. NestJS is a progressive Node.js framework for building efficient and scalable server-side applications. It is modular, testable, and strongly typed with TypeScript, making it an excellent choice for complex back-end development. Our **[Standard](https://squarecloud.app/en/pricing\&tier=4\&duration=monthly)** plan offers **4GB** of RAM and **4vCPU**, which should be sufficient for most NestJS applications. However, if you are working on a larger project or need more stability, we recommend considering our Pro plan. With additional resources, you can ensure smooth performance even under high demand. To purchase, simply click [here](https://squarecloud.app/en/pay?plan=pro\&tier=12\&duration=monthly). ## Uploading the Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` ## Additional Resources For more information about NestJS and its tools, visit the [official NestJS documentation](https://docs.nestjs.com/). There, you will find detailed guides, tutorials, and API documentation to help you make the most of NestJS. ## Troubleshooting # How to host your Springboot Application Source: https://docs.squarecloud.app/en/tutorials/api/spring-boot Learn how to deploy your Spring Boot application on Square Cloud ## Introduction * This article guides you through creating and hosting a Spring Boot application on Square Cloud. * Before getting started, make sure you have an account on Square Cloud, which can be done through the sign up page. You can use your email to create an account. * Finally, you need to have an active paid plan with on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## Creating Your Project * First you'll need to install a [JDK](https://www.oracle.com/br/java/technologies/downloads) and a package manager to help you manage the project like `maven`. * You can create a base project on [Spring Initializr](https://start.spring.io/). * You need to configure the application.properties to open the webserver on host 0.0.0.0 and port 80. Look the example below: ```txt server.properties theme={null} server.port=80 server.address=0.0.0.0 ``` * After this configuration and when the project is ready, build it into a jar file with the command of your build tool. ```bash theme={null} mvn clean package ``` ## Uploading the Project to Square Cloud * You need to find your project jar file and create a zip containing it. * After preparing your project files, you can now upload them to Square Cloud and host your project. * Remember to check "Publish on the Web" when you do the upload. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` # How to Host a Discord Bot on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/bots/discord Learn to create and host Discord bots on Square Cloud. Complete tutorial with configuration, deployment, and practical examples in Node.js and Python. ## Introduction To develop and host a Discord bot on Square Cloud, it's essential to follow a structured sequence of configurations and prerequisites. This technical guide will cover the entire process, from initial setup to production deployment. ### Essential Prerequisites * **Active Discord Account**: Fundamental for creating and managing bots on the platform. If you don't have one, visit the [official Discord website](https://discord.com/) to create your account. * **Square Cloud Account**: Hosting platform for your application. Register through the [signup page](https://squarecloud.app/en/signup) using your email. * **Active Paid Plan**: Ensures dedicated resources and optimized performance for your bot. Check our [available plans](https://squarecloud.app/en/pricing) and choose the most suitable for your needs. ## Initial Discord Bot Configuration Access the [Developer Portal](https://discord.com/developers/applications) and click "New Application". Define a name for your bot and click "Create" to create the application. After creating the application, navigate to the "Bot" tab and click "Reset Token" to generate the authentication token. Copy the generated token for later use in code implementation. With the token configured, activate the necessary intents. Stay in the "Bot" tab, scroll down and locate "Privileged Gateway Intents". Activate the intents as shown in the image: **Critical Security**: Keep your bot token in absolute secrecy. This token grants total control over the bot and should be treated as confidential information. ## Bot Development ### Recommended Libraries and Frameworks **Node.js Environment Setup** 1. Verify that Node.js is installed on your system. If not, download it from the [official Node.js website](https://nodejs.org/). 2. Initialize a new Node.js project: ```bash Terminal theme={null} npm init -y ``` 3. Install the Discord.js library: ```bash Terminal theme={null} npm install discord.js ``` 4. Create a JavaScript file (e.g., `index.js`) and add the following code to create a basic Discord bot: ```javascript index.js theme={null} const { Client, GatewayIntentBits } = require("discord.js"); const client = new Client({ intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, ], }); client.on("ready", () => { console.log(`${client.user.tag}!`); }); client.on("messageCreate", (message) => { if (message.content === "!hello") { message.reply("Hello!"); } }); client.login("your token here"); ``` **Python Environment Setup** 1. Verify that Python is installed on your system. If not, download it from the [official Python website](https://www.python.org/). 2. Install the discord.py library using pip: ```bash Terminal theme={null} pip install discord.py ``` 3. Create a Python file (e.g., `main.py`) and add the following code to create a basic Discord bot: ```python main.py theme={null} import discord from discord.ext import commands intents = discord.Intents.default() intents.message_content = True client = commands.Bot(command_prefix='!', intents=intents) @client.event async def on_ready(): print(f'{client.user}') @client.command() async def hello(ctx): await ctx.reply('Hello!') client.run('your token here') ``` 4. Create a `requirements.txt` file to list all external libraries needed for your project: ```txt requirements.txt theme={null} discord.py ``` ## Square Cloud Configuration File The squarecloud.app file is a configuration file that will be used to configure your application on Square Cloud. It defines name, description, version, main file, among other essential configurations. ## START Field Configuration Only use this field if you are absolutely sure about what you are doing. In the Square Cloud configuration file, the **START** field is optional and only necessary if you are using a custom script to start the bot. In the provided example, the **START** field is not necessary. ## Uploading Your Project to Square Cloud After following all the steps, package your application files into a zip file where the configuration file is located and upload the bot at [Upload](https://squarecloud.app/en/upload). Remember to include the `requirements.txt` or `package.json` file, but do not include files like `__pycache__` or `node_modules`. You can get more information about unnecessary files during hosting at [automatic file deletion](https://docs.squarecloud.app/en/faqs/automatic-deletion-files-when-deploying-an-application-to-squarecloud). ## Testing the Bot If you followed all the steps correctly, the next step is to invite your bot for testing. To do this, follow these steps: 1. Access the [Developer Portal](https://discord.com/developers/applications). 2. Select your bot. 3. Navigate to the "OAuth2" tab. 4. Go to "OAuth2 URL Generator". 5. Check the "bot" option. 6. Choose the permissions your bot will have when invited using this invite. 7. Below the permissions, an invite link for your bot will be generated. It should look like this: ```txt theme={null} https://discord.com/oauth2/authorize?client_id=00000000000000&permissions=8&scope=bot ``` Remember that the `client_id` in the URL should be replaced with your bot's actual ID. The `permissions` value may also need to be adjusted based on the permissions you want your bot to have. Now, to test if everything is working, execute the following command on your server: `!hello`. ## Additional Resources For more information on creating bots with discord.py and discord.js, visit the [official discord.py documentation](https://discordpy.readthedocs.io/en/latest/) and the [official discord.js guide](https://discordjs.guide/). There, you'll find detailed guides, tutorials, and API documentation to help you make the most of these libraries. # How to Host a Slack Bot on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/bots/slack Complete tutorial to create and host a Slack bot on Square Cloud — configuration, deployment and examples in Node.js and Python. ## Introduction This guide explains step by step how to develop, configure and host a Slack bot on Square Cloud. We'll follow security best practices and show examples in Node.js (Bolt) and Python (Bolt for Python). ### Essential Prerequisites * **Slack account**: You will need an account and permissions to create apps on Slack. Create or access your account at [https://slack.com/](https://slack.com/). * **Square Cloud account**: Sign up via [https://squarecloud.app/pt-br/signup](https://squarecloud.app/pt-br/signup) to host your bot. * **Active paid plan**: Bots that require continuous resources typically need a paid plan. Check our [plans](https://squarecloud.app/pt-br/pricing). ## Creating the Slack App 1. Go to the [Slack API - Your Apps](https://api.slack.com/apps) and click "Create New App". 2. Choose "From scratch", give the app a name and select the workspace where you will install it. 3. Note the *Signing Secret* (under "Basic Information") and create a *Bot Token* in the "OAuth & Permissions" section, adding the appropriate scopes for your bot (e.g. `chat:write`, `channels:read`, `commands`, `app_mentions:read`). **Security:** Never expose the Signing Secret or the Bot Token publicly. Treat them as sensitive credentials. ## Implementation Examples Use the sections below depending on the language you choose. Both examples demonstrate a bot that responds to mentions or simple commands. **Node.js Environment Setup** 1. Make sure Node.js is installed. 2. Initialize a project and install dependencies: ```bash Terminal theme={null} npm init -y npm install @slack/bolt ``` 3. Create an `index.js` file with the following content: ```javascript index.js theme={null} const { App } = require('@slack/bolt'); const app = new App({ signingSecret: process.env.SLACK_SIGNING_SECRET, token: process.env.SLACK_BOT_TOKEN, }); // Responds when mentioned app.event('app_mention', async ({ event, say }) => { await say(`<@${event.user}> Thanks for mentioning me!`); }); // Example slash command app.command('/hello', async ({ ack, respond }) => { await ack(); await respond('Hello from Square Cloud!'); }); (async () => { await app.start(process.env.PORT || 3000); console.log('⚡️ Slack Bolt app is running!'); })(); ``` Note: on Square Cloud, set the environment variables `SLACK_SIGNING_SECRET` and `SLACK_BOT_TOKEN` in the application panel. **Python Environment Setup** 1. Make sure Python and pip are installed. 2. Install the Bolt for Python library: ```bash Terminal theme={null} pip install slack_bolt ``` 3. Create an `app.py` file with the following content: ```python app.py theme={null} from slack_bolt import App import os app = App( signing_secret=os.environ.get('SLACK_SIGNING_SECRET'), token=os.environ.get('SLACK_BOT_TOKEN') ) @app.event('app_mention') def handle_mention(event, say): user = event.get('user') say(f'<@{user}> Thanks for mention!') @app.command('/hello') def hello_command(ack, respond): ack() respond('Hello from Square Cloud!') if __name__ == '__main__': app.start(port=int(os.environ.get('PORT', 3000))) ``` 4. For Python projects, include a `requirements.txt` with: ```txt requirements.txt theme={null} slack_bolt ``` ## Square Cloud Configuration File The `squarecloud.app` file is used to define the name, version, main file and environment variables for your application. Include `SLACK_SIGNING_SECRET` and `SLACK_BOT_TOKEN` in the panel or configuration file as needed. ## START Field In general the **START** field is not required if your app starts from the default file (`index.js` or `app.py`) and uses environment variables. Use **START** only for custom startup scripts. ## Uploading the Project to Square Cloud After preparing the files, compress the project (including `package.json` or `requirements.txt` and `squarecloud.app`) and upload via the Dashboard or CLI. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and send the ZIP containing the project files. ```bash Terminal theme={null} npm install -g @squarecloud/cli ``` ```bash Terminal theme={null} squarecloud auth login ``` ```bash Terminal theme={null} squarecloud upload zip ``` ## Testing the Bot 1. In the Slack App panel, under "OAuth & Permissions", install the app to the workspace. 2. If the bot exposes endpoints (for events or commands), configure the Request URL in "Event Subscriptions" and "Slash Commands" to point to your application's public URL (Square Cloud provides the domain after deployment). 3. Test mentions in a channel or the `/hello` command to validate responses. Example install link (replace the client\_id): ```txt theme={null} https://slack.com/oauth/v2/authorize?client_id=000000000000.000000000000&scope=commands,chat:write,app_mentions:read ``` ## Additional Resources For further reading, check the official Slack documentation: * Bolt for JavaScript: [https://docs.slack.dev/tools/bolt-js/](https://docs.slack.dev/tools/bolt-js/) * Bolt for Python: [https://docs.slack.dev/tools/bolt-python/](https://docs.slack.dev/tools/bolt-python/) # How to Host a Telegram Bot on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/bots/telegram Step-by-step tutorial: How to create and host a Telegram bot on Square Cloud. Learn configuration, deployment, Node.js, Python and complete optimization. ## Introduction To develop and host a Telegram bot on Square Cloud, you need to follow some essential prerequisites. This guide will present the complete process, from initial setup to final deployment. ### Prerequisites * **Active Telegram account**: Essential for testing and interacting with your bot. If you don't have one, visit the [official Telegram website](https://telegram.org/) to create your account for free. * **Square Cloud account**: Required to host your application. Sign up through the [registration page](https://squarecloud.app/en/signup) in just a few minutes. * **Active paid plan**: Ensures dedicated resources and optimized performance for your bot. Check our [available plans](https://squarecloud.app/en/pricing) and choose the one that best fits your needs. ## Initial Bot Configuration Access [Telegram Web](https://web.telegram.org/a/) and search for the official **BotFather** bot, responsible for creating and managing bots on the platform. Start a conversation with BotFather and type `/start`. Then, select the `/newbot` option to create a new bot. The system will ask for a name for your bot and, after confirmation, will automatically generate the necessary authentication token. **Critical Security**: Keep your bot token absolutely secret. This token grants full control over the bot and should be treated as confidential information. ## Bot Development The choice of library or framework depends on the programming language you intend to use. Below are some of the most popular options: ### Recommended Libraries and Frameworks **Environment Setup** 1. Verify that Node.js is installed on your system. Otherwise, download it from the [official Node.js website](https://nodejs.org/). 2. Initialize a new Node.js project: ```bash Terminal theme={null} npm init -y ``` 3. Install the official library: ```bash Terminal theme={null} npm install node-telegram-bot-api ``` **Basic Implementation** 4. Create the main file (`index.js`) with the following structure: ```javascript index.js theme={null} // Import the node-telegram-bot-api library const TelegramBot = require("node-telegram-bot-api"); // Authentication token configuration const token = "YOUR_TOKEN_HERE"; // Bot initialization with polling enabled const bot = new TelegramBot(token, { polling: true }); // Get bot information bot.getMe().then((botInfo) => { // Extract bot name const botName = botInfo.username; // Define handler for non-command messages bot.on("message", (msg) => { // Extract chat ID const chatId = msg.chat.id; // Capture user message const userMsg = msg.text; // Format response const responseMsg = `${botName} responds: ${userMsg}`; // Send response message bot.sendMessage(chatId, responseMsg); }); // Initialization confirmation log console.log(`Bot ${botName} started successfully!`); }); ``` **Environment Setup** 1. Verify that Python and pip are installed. Otherwise, download them from the [official Python website](https://www.python.org/). 2. Install the telebot library: ```bash Terminal theme={null} pip install telebot ``` **Basic Implementation** 3. Create the main file (`main.py`): ```python main.py theme={null} # Import the telebot_router library from telebot_router import TeleBot # Application initialization app = TeleBot(__name__) # Define route for non-command messages @app.route('(?!/).+') def echo_handler(message): # Extract destination chat ID chat_dest = message['chat']['id'] # Capture user message user_msg = message['text'] # Get bot information bot_info = app.get_me()['result'] # Extract bot name bot_name = bot_info['username'] # Format response message response_msg = f"{bot_name} responds: {user_msg}" # Send message app.send_message(chat_dest, response_msg) # Main execution function if __name__ == '__main__': # API key configuration app.config['api_key'] = 'YOUR_TOKEN_HERE' # Get bot information bot_info = app.get_me()['result'] # Extract bot name bot_name = bot_info['username'] # Confirmation log print(f"Bot {bot_name} started successfully!") # Start polling app.poll(debug=True) ``` 4. Create the `requirements.txt` file to manage dependencies: ```txt requirements.txt theme={null} telebot ``` ## Square Cloud Configuration File The `squarecloud.app` file is the central configuration component of your application, defining essential parameters such as main file, system resources, versions, and project metadata. ## Advanced START Field Configuration **Warning**: Use the START field only if you have advanced technical knowledge about custom initialization scripts. The **START** field in the Square Cloud configuration file is optional and should be used exclusively when custom initialization scripts need to be executed. For the examples presented in this tutorial, this field is not necessary. ## Deployment to Square Cloud After completely preparing your project files, proceed with the upload to Square Cloud following one of the methodologies below: Access the [Square Cloud Dashboard](https://squarecloud.app/en/dashboard/upload) and upload your project files. Install the Square Cloud CLI globally: ```bash Terminal theme={null} npm install -g @squarecloud/cli ``` To update an existing installation: ```bash Terminal theme={null} squarecloud update ``` ```bash Terminal theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Get your authorization key from the [account page](https://squarecloud.app/en/account) by clicking "Request API Key". Then execute: ```bash Terminal theme={null} squarecloud auth login ``` Execute the deployment command specifying the ZIP file path: ```bash Terminal theme={null} squarecloud upload zip ``` ## Testing and Validation After successful deployment, locate your bot on Telegram and send a test message. The bot should respond by echoing your message, confirming the correct implementation functionality. ## Additional Resources To deepen your knowledge about Telegram bot development, consult the [official telebot documentation](https://pypi.org/project/telebot/). The documentation offers detailed guides, advanced tutorials, and complete API reference. # How to Host a WhatsApp Bot on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/bots/whatsapp Complete tutorial: How to create and host a WhatsApp bot on Square Cloud. Learn configuration, Node.js implementation, deployment, and professional automation. ## Introduction To develop and host a WhatsApp bot on Square Cloud, it's essential to follow a specific sequence of configurations and prerequisites. This technical guide will cover the entire process, from initial setup to production deployment. ### Essential Prerequisites * **WhatsApp installed and configured**: Required for bot authentication and linking. If you don't have the app, visit the [official WhatsApp website](https://www.whatsapp.com/coronavirus/get-started?lang=en) for download and setup. * **Active Square Cloud account**: Hosting platform for your application. Register through the [signup page](https://squarecloud.app/en/signup) using your email. * **Active paid plan**: Ensures dedicated resources and optimized performance. Check our [available plans](https://squarecloud.app/en/pricing) and choose the most suitable for your needs. If your implementation needs to access the remote path for the WhatsApp Web version, follow this technical procedure: 1. Access the [wa-version](https://github.com/wppconnect-team/wa-version/tree/main/html) repository 2. Select the desired version (always recommended to use the latest) 3. Click "Raw" to view the file 4. Copy the generated URL for later use **Example configured URL:** ``` https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2412.54.html ``` ## Development Environment Setup ### Node.js Installation and Configuration 1. **Node.js verification**: Confirm that Node.js is installed on your system. Otherwise, download it from the [official Node.js website](https://nodejs.org/). 2. **Project initialization**: Set up a new Node.js project by running the initialization command: ```bash Terminal theme={null} npm init -y ``` 3. **Dependencies installation**: Install the essential libraries for bot functionality: ```bash Terminal theme={null} npm install whatsapp-web.js qrcode ``` ### WhatsApp Bot Implementation 4. **Main file creation**: Develop the `index.js` file with the bot's base structure: ```javascript index.js theme={null} // Import necessary modules const { Client } = require("whatsapp-web.js"); const qrcode = require("qrcode"); // Create a new WhatsApp client instance const client = new Client({ puppeteer: { // Run Chrome in headless mode (without graphical interface) headless: true, args: [ // Disable Chrome sandboxing features // Required for execution in containerized environments "--no-sandbox", // Additional sandboxing flag to disable setuid sandbox "--disable-setuid-sandbox", ], }, // Web version cache configuration webVersionCache: { // Type "remote" indicates WhatsApp Web version will be fetched from remote URL type: "remote", // Remote path for WhatsApp Web version remotePath: "INSERT_YOUR_URL_HERE", }, }); // Event listener for QR Code generation client.on("qr", async (qr) => { // Use qrcode library to generate and save QR Code try { await qrcode.toFile("./qrcode.png", qr); console.log("QR Code generated and saved as qrcode.png"); } catch (err) { console.error("Error generating QR Code:", err); } }); // Event listener for client ready client.on("ready", () => { // Confirmation log when WhatsApp Web session is established console.log("WhatsApp client successfully initialized!"); }); // Event listener for created messages client.on("message_create", (msg) => { // Log message content to console console.log("Message received:", msg.body); // Test command implementation if (msg.body === "!ping") { // Automatic response for ping command msg.reply("pong - Bot working correctly!"); } }); // Initialize WhatsApp client client.initialize(); ``` ## Square Cloud Configuration File The `squarecloud.app` file constitutes the application's configuration core, defining critical parameters such as main file, resource allocation, runtime versions, and essential project metadata. ## Advanced START Field Configuration **Technical Warning**: Use the START field exclusively if you have specialized knowledge about custom initialization scripts and their implications. The **START** field in the Square Cloud configuration file is an optional parameter, required only when custom initialization scripts are needed. For the standard implementation presented in this tutorial, this field is not necessary. ## Deployment and Hosting on Square Cloud After completing the project file preparation, proceed with the upload process following one of the available technical methodologies: Access the [Square Cloud Dashboard](https://squarecloud.app/en/dashboard/upload) and upload your project files through the web interface. Install the Square Cloud CLI globally in your development environment: ```bash Terminal theme={null} npm install -g @squarecloud/cli ``` To update an existing installation, run: ```bash Terminal theme={null} squarecloud update ``` ```bash Terminal theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Get your authorization key from the [account security page](https://squarecloud.app/en/account/security) by clicking "Request API Key". After obtaining the key, run the authentication command: ```bash Terminal theme={null} squarecloud auth login ``` To complete the application deployment process on Square Cloud via CLI, run the command specifying the ZIP file path: ```bash Terminal theme={null} squarecloud upload zip ``` ## Complementary Technical Resources To deepen your knowledge about WhatsApp bot development using whatsapp-web.js, consult the [official whatsapp-web.js library documentation](https://wwebjs.dev/). The documentation offers detailed technical guides, advanced tutorials, and complete API reference to maximize implementation potential. # How to Host an X (Twitter) Bot on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/bots/x Complete tutorial: how to create and host an X bot on Square Cloud. Learn configuration, Node.js implementation, deployment and advanced automation. ## Introduction To develop and host an X (Twitter) bot on Square Cloud, you should follow a specific sequence of configurations and prerequisites. This technical guide covers the entire process, from initial setup to production deployment. ### Essential Prerequisites * **Active X (Twitter) account**: Required for authentication and bot operation. If you don't have an account, sign up at the [official X website](https://x.com/). * **X Developer account**: Required to access the APIs. Request access through the [X Developer Portal](https://developer.x.com/en). * **Active Square Cloud account**: Hosting platform for your application. Sign up via the [signup page](https://squarecloud.app/pt-br/signup) using your email. * **Active paid plan**: Ensures dedicated resources and optimized performance. Check our [available plans](https://squarecloud.app/pt-br/pricing) and choose the one that suits your needs. 1. Go to the [X Developer Portal](https://developer.x.com/en/portal/dashboard). 2. Log in with your X (Twitter) account. 3. If this is your first time, complete the developer access request process. 1. In the dashboard, click "Create Project". 2. Choose a name for your project (e.g. "Square Cloud Bot"). 3. Select the most appropriate use case (e.g. "Making a bot"). 4. Provide a detailed description of your bot. 5. Confirm project creation. 1. Within the created project, click "Create App". 2. Define a unique name for your application. 3. Confirm application creation. 4. Note down the generated **App ID** for future reference. 1. Navigate to the "Keys and tokens" section of your application. 2. In the "Consumer Keys" section, click "Regenerate" to generate: * **API Key** (Consumer Key) * **API Secret Key** (Consumer Secret) 3. **Important**: Copy and save these keys immediately, as you won't be able to view them again. 1. Go to the "App permissions" section. 2. Click "Edit" to modify permissions. 3. Select "Read and write" to allow your bot to post tweets. 4. If necessary, select "Read and write and Direct message" for DM functionality. 5. Save the changes. 1. Return to the "Keys and tokens" section. 2. In the "Access Token and Secret" section, click "Generate". 3. Confirm token generation. 4. Copy and save: * **Access Token** * **Access Token Secret** 5. **Warning**: These tokens cannot be viewed again after closing the page. 1. Confirm that you have all 4 required credentials: * API Key (Consumer Key) * API Secret Key (Consumer Secret) * Access Token * Access Token Secret 2. Store these credentials in a secure location 3. **Important**: Never share or expose these credentials publicly ## Development Environment Setup ### Node.js Installation and Setup 1. **Node.js check**: Verify that Node.js is installed on your system. If not, download it from the [official Node.js website](https://nodejs.org/). 2. **Project initialization**: Create a new Node.js project by running: ```bash Terminal theme={null} npm init -y ``` 3. **Install dependencies**: Install the libraries required for the bot: ```bash Terminal theme={null} npm install twitter-api-v2 ``` ### X (Twitter) Bot Implementation 4. **Environment variables setup**: Create a `.env` file to store your credentials securely: ```env .env theme={null} API_KEY=your_api_key_here API_SECRET_KEY=your_api_secret_key_here ACCESS_TOKEN=your_access_token_here ACCESS_TOKEN_SECRET=your_access_token_secret_here ``` 5. **Create the main file**: Develop the `index.js` file with the bot's base structure: ```javascript index.js theme={null} // Import necessary modules const { TwitterApi } = require('twitter-api-v2'); // Configure Twitter client with authentication const client = new TwitterApi({ appKey: process.env.API_KEY, appSecret: process.env.API_SECRET_KEY, accessToken: process.env.ACCESS_TOKEN, accessSecret: process.env.ACCESS_TOKEN_SECRET, }); // Client with read and write permissions const rwClient = client.readWrite; // Function to check if the bot is working async function verifyBot() { try { // Get authenticated user information const user = await rwClient.currentUser(); console.log(`Bot successfully initialized! User: @${user.screen_name}`); return true; } catch (error) { console.error('Error verifying bot:', error); return false; } } // Function to post a tweet async function postTweet(text) { try { const tweet = await rwClient.tweet(text); console.log(`Tweet posted successfully! ID: ${tweet.data.id}`); return tweet; } catch (error) { console.error('Error posting tweet:', error); throw error; } } // Function to respond to mentions async function respondToMentions() { try { // Fetch recent mentions const mentions = await rwClient.userMentionTimeline({ count: 10, result_type: 'recent' }); for (const tweet of mentions.data) { // Check if it's a new mention (implement control logic) if (tweet.text.includes('!ping')) { // Reply to the mention await rwClient.reply( 'Pong! 🤖 X Bot working correctly!', tweet.id ); console.log(`Replied to mention from @${tweet.user.screen_name}`); } } } catch (error) { console.error('Error processing mentions:', error); } } // Function to search and interact with specific tweets async function searchAndInteract(query) { try { // Search tweets with a specific query const tweets = await rwClient.search(query, { count: 5, result_type: 'recent' }); for (const tweet of tweets.statuses) { // Like the tweet await rwClient.like(tweet.id_str); console.log(`Liked tweet from @${tweet.user.screen_name}`); // Wait a bit between actions to avoid rate limiting await new Promise(resolve => setTimeout(resolve, 2000)); } } catch (error) { console.error('Error searching and interacting:', error); } } // Main bot function async function runBot() { console.log('Starting X bot...'); // Check if the bot is configured correctly const botOk = await verifyBot(); if (!botOk) { console.error('Bot initialization failed'); return; } // Example: Post an initialization tweet try { await postTweet('🤖 X Bot initialized and running on Square Cloud!'); } catch (error) { console.log('Initialization tweet failed, but bot continues running'); } // Main bot loop setInterval(async () => { try { // Check and respond to mentions every 5 minutes await respondToMentions(); // Example: Search and interact with tweets about a specific topic // await searchAndInteract('#SquareCloud'); } catch (error) { console.error('Error in main loop:', error); } }, 5 * 60 * 1000); // 5 minutes console.log('Bot running. Press Ctrl+C to stop.'); } // Signal handling for graceful shutdown process.on('SIGINT', () => { console.log('\nShutting down X bot...'); process.exit(0); }); process.on('SIGTERM', () => { console.log('\nShutting down X bot...'); process.exit(0); }); // Initialize the bot runBot(); ``` ## Square Cloud Configuration File The `squarecloud.app` file is the core configuration of the application, defining key parameters such as the main file, resource allocation, runtime versions and important project metadata. ### Configuration Example Create the `squarecloud.app` file in your project root: ```app squarecloud.app theme={null} MAIN=index.js MEMORY=512 VERSION=recommended DISPLAY_NAME=X Bot DESCRIPTION=Automated bot for X (Twitter) interactions ``` ## Advanced START Field Configuration **Technical warning**: Use the START field only if you have advanced knowledge about custom startup scripts and their implications. The **START** field in the Square Cloud configuration file is optional and should be used only when custom startup scripts are required. For the standard implementation shown in this tutorial, this field is not necessary. ## Environment Variables Configuration on Square Cloud **Security**: Never include your API credentials directly in code. Always use environment variables on Square Cloud. On Square Cloud, configure the following environment variables via the control panel: * `API_KEY`: Your X API key * `API_SECRET_KEY`: Your X API secret key * `ACCESS_TOKEN`: Your access token * `ACCESS_TOKEN_SECRET`: Your access token secret ## Deploy and Hosting on Square Cloud After preparing your project files, proceed with the upload using one of the available methods: Go to the [Square Cloud Dashboard](https://squarecloud.app/pt-br/dashboard/upload) and upload your project files through the web interface. Install the Square Cloud CLI globally in your development environment: ```bash Terminal theme={null} npm install -g @squarecloud/cli ``` To update an existing installation, run: ```bash Terminal theme={null} squarecloud update ``` ```bash Terminal theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Get your authorization key from the [account security page](https://squarecloud.app/pt-br/account/security) by clicking "Request API Key". After getting the key, run the authentication command: ```bash Terminal theme={null} squarecloud auth login ``` To complete the application deployment process on Square Cloud via CLI, run the command specifying the ZIP file path: ```bash Terminal theme={null} squarecloud upload zip ``` ## Advanced Bot Features ### Hashtag Monitoring ```javascript theme={null} // Function to monitor specific hashtags async function monitorHashtags(hashtags) { for (const hashtag of hashtags) { try { const tweets = await rwClient.search(`#${hashtag}`, { count: 5, result_type: 'recent' }); // Process found tweets for (const tweet of tweets.statuses) { console.log(`Tweet found with #${hashtag}: ${tweet.text}`); // Implement interaction logic } } catch (error) { console.error(`Error monitoring #${hashtag}:`, error); } } } ``` ### Scheduled Posts ```javascript theme={null} // Function to schedule posts function schedulePost(text, delay) { setTimeout(async () => { try { await postTweet(text); console.log('Scheduled post published successfully!'); } catch (error) { console.error('Error publishing scheduled post:', error); } }, delay); } // Example: Schedule a post for 1 hour schedulePost('🤖 Scheduled post by the bot!', 60 * 60 * 1000); ``` ## Best Practices and Considerations ### Rate Limiting X (Twitter) has strict rate limits. Implement controls to avoid exceeding these limits: ```javascript theme={null} // Rate limiting control const rateLimiter = { lastRequest: 0, minInterval: 1000, // 1 second between requests async wait() { const now = Date.now(); const timeSinceLastRequest = now - this.lastRequest; if (timeSinceLastRequest < this.minInterval) { const waitTime = this.minInterval - timeSinceLastRequest; await new Promise(resolve => setTimeout(resolve, waitTime)); } this.lastRequest = Date.now(); } }; ``` ### Error Handling ```javascript theme={null} // Helper function to retry an operation on failure async function retryOperation(operation, maxRetries = 3) { for (let i = 0; i < maxRetries; i++) { try { return await operation(); } catch (error) { console.error(`Attempt ${i + 1} failed:`, error.message); if (i === maxRetries - 1) { throw error; } // Wait before retrying await new Promise(resolve => setTimeout(resolve, 2000 * (i + 1))); } } } ``` ## Additional Technical Resources To deepen your knowledge about developing X bots using twitter-api-v2, check the [official twitter-api-v2 library documentation](https://github.com/PLhery/node-twitter-api-v2). The documentation provides detailed guides, advanced tutorials and full API references to maximize your implementation. Also see: * [Official X API documentation](https://docs.x.com/overview) * [X API usage policies](https://developer.x.com/en/developer-terms/policy) * [Bot best practices guide](https://docs.x.com/x-api/getting-started/about-x-api) # How to connect your prisma in PostgreSQL hosted in Square Cloud Source: https://docs.squarecloud.app/en/tutorials/how-to-connect-prisma-with-postgres Learn how to connect your Prisma application to a PostgreSQL database hosted on Square Cloud. ## Introduction * This tutorial will guide you through the steps to connect your Prisma with your PostgreSQL database hosted on Square Cloud. * First, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). * Next, you'll need a PostgreSQL database hosted on Square Cloud. If you haven't created one yet, you can create it [here](https://squarecloud.app/dashboard/databases). ## Prerequisites * Before you begin, ensure you have created database in Square Cloud and connect on some manager client like dbeaver or any other to create a database. * You will also need to have Prisma set up in your project. If you haven't done this yet, you can follow the official Prisma documentation [here](https://www.prisma.io/docs/getting-started). ## Steps to connect Prisma with PostgreSQL Get your PostgreSQL connection details To connect your Prisma application to your PostgreSQL database, you need the following connection details: * **Connection String**: The connection string to connect to your PostgreSQL database. * **Certificate**: The SSL certificate for secure connections, use the `.pem` certificate. You can find these details in the Square Cloud dashboard under the "Databases" section. Click on your PostgreSQL database to view its connection details, then go to its "Configuration" tab to find the connection string. If you didn't copied when created, you will need to regenerate the password and paste it in the URL. Prisma requires the SSL certificate to be in a specific format, a `.p12` file. You can create this file using OpenSSL. Before running the command, copy the downloaded `certificate.pem` and in one of them, open and removes the key part, leaving only the certificate part, in the other, remove the certificate. Remember to rename them to `cert.pem` and `key.pem` to identify which is which. To convert the `.pem` files to `.p12`, you can use the following OpenSSL command: ```bash theme={null} openssl pkcs12 -export -out path/to/create/client-identity.p12 -inkey path/to/key.pem -in path/to/cert.pem ``` Replace `path/to/key.pem` and `path/to/cert.pem` with the actual paths to your key and certificate files. You will be prompted to set an export password. Remember this password, as you will need it later. Save the `client-identity.p12` file in a folder within your prisma folder, for example, in a folder named `certs`. Update your `.env` file to include the connection string and SSL configuration. In your Prisma project, locate the `.env` file and update the `DATABASE_URL` variable with your PostgreSQL connection string. Make sure to include the SSL configuration in the connection string. It should look something like this: ```env theme={null} DATABASE_URL="postgresql://username:password@host:port/database?sslidentity=./certs/client-identity.p12&sslpassword=your_export_password" ``` # How to create your Lavalink server Source: https://docs.squarecloud.app/en/tutorials/how-to-create-your-lavalink-server Learn how to create and host your own Lavalink server for Discord - Complete setup tutorial with optimized performance for music bots ## Introduction 🚀 * Follow the tutorial below and host your Lavalink server today, it's super simple! If you need any assistance, feel free to contact us through our official support channels. * Next, you'll need to create an account on Square Cloud, which can be done through the [signup page](https://squarecloud.app/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## Choosing the Version Choose your desired version of `Lavalink` by clicking [here](https://github.com/freyacodes/Lavalink/releases/). We recommend selecting the latest version for the best experience. ## Creating the Square Cloud configuration file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Creating the application.yml Create a configuration file for your Lavalink server. You can access an example file [here](https://github.com/freyacodes/Lavalink/blob/master/LavalinkServer/application.yml.example). Set the `port` field in your `application.yml` file to: `80`. ## Enhancing Security It is highly recommended to configure a secure password in the `password` field of your configuration file (application.yml). We recommend using a password with at least 32 characters. It's important to remember that you should use port 443 (SSL) and the `secure` option as `true` to connect to your lavalink. ## How to host my Lavalink? Create a compressed file (.zip) containing the `Lavalink.jar` and `application.yml`. Then, upload your configuration file to Square Cloud. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do so, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you'll find your authorization key [here](https://squarecloud.app/en/account/security) by clicking "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application on Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload server.zip ``` # How to deploy EvolutionAPI on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/how-to-deploy-evolution-api This tutorial will guide you to create and deploy your EvolutionAPI application on Square Cloud. ## Introduction * This article guides you through creating and hosting a EvolutionAPI application on Square Cloud. * Before getting started, make sure you have an account on Square Cloud, which can be done through the sign up page. You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## Creating EvolutionAPI * First, we need to download the files of EvolutionAPI from GitHub. We already have all files prepared [here](https://github.com/squarecloud-education/evolutionapi-web/release), just download `project.zip`. You can also see their official repository [here](https://github.com/EvolutionAPI/evolution-api). * Now we need to set some configs on the `.env` file. You need to set a database, Redis if you want to cache some data and configure server port and the URL. * The server port needs to bem set to `80`, set the desired `squareweb.app` subdomain url and the database URL. Learn how to connect a PostGreSQL hosted on Square Cloud with Prisma. * Check the envs examples available in the repositories to configure your application. You can go directly [here](https://github.com/squarecloud-education/evolutionapi-web/blob/main/.env.example) ## Building and preparing * You need to run the following command to execute the migrations needed. ```bash theme={null} npm run db:deploy:win ``` ```bash theme={null} npm run db:deploy ``` * After, you can deploy on Square with the commands needed to generate prisma, build and start. ```bash theme={null} npx prisma generate --schema prisma/postgresql-schema.prisma && npm run build && npm run start:prod ``` ## Uploading the Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. You need to load the environment through code. The code in our repository already do this. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` # How to deploy n8n on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/how-to-deploy-n8n This tutorial will guide you to create and deploy your n8n application on Square Cloud. ## Introduction * This article guides you through creating and hosting a n8n application on Square Cloud. * Before getting started, make sure you have an account on Square Cloud, which can be done through the sign up page. You can use your email to create an account. * Finally, you need to have an active paid plan with at least 4GB RAM on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## Creating the Project * First of all we need an javascript environment. To do this, we need a package.json. * The package.json must contain on dependencies field the n8n and must have the scripts to start it. Here's the example: ```json package.json theme={null} { "name": "squarecloud-n8n", "version": "1.0.0", "main": "index.js", "type": "module", "scripts": { "start": "n8n" }, "author": "Square Cloud Education ", "license": "ISC", "dependencies": { "n8n": "latest" } } ``` We already have everything ready for deploy on our repository [here](https://github.com/squarecloud-education/n8n-web/releases). You just need to download the `project.zip` and upload it. ## 📁 Necessary Files The following files are necessary in your zip: * package.json * .env (optional) ## ⚙️ Configuration File * You need to configure runtime environment to `Detect manually` and set it to `NodeJS`. In a squarecloud.config or squarecloud.app will look like this: ```systemd squarecloud theme={null} DISPLAY_NAME=App name RUNTIME=nodejs START=npm run start MEMORY=3072 VERSION=recommended SUBDOMAIN=my-n8n-subdomain ``` * Next, we need to set 2 environment variables, `N8N_HOST` and `N8N_PORT` in a `.env` file or in the Square Cloud environment on the upload menu. Their values must be `0.0.0.0` and `80`. ```systemd .env theme={null} N8N_HOST=0.0.0.0 N8N_PORT=80 ``` ## Uploading the Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` # How to deploy your PG Admin Source: https://docs.squarecloud.app/en/tutorials/how-to-deploy-pgadmin Learn how to host your pgadmin to access your PostGreSQL database anywhere ## Introduction * This article guides you through creating and hosting a PG Admin application on Square Cloud. * Before getting started, make sure you have an account on Square Cloud, which can be done through the sign up page. You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## Creating the Project * First of all we need an Python environment. To do this, we need a `requirements.txt` or a `pyproject.toml`. You can see how to create a requirements.txt [here](https://docs.squarecloud.app/en/articles/how-to-create-your-requirements). * Your `requirements.txt` must have `pgadmin4` and a webserver to serve it. In this tutorial, we will use `gunicorn`. ```txt requirements.txt theme={null} pgadmin4 gunicorn ``` * Next, you will need a config file `config_local.py` to set some paths. These paths will define where to save some infos about your pgadmin. ```py config_local.py theme={null} SERVER_MODE = True MAX_LOGIN_ATTEMPTS = 3 """ CRITICAL 50 ERROR 40 WARNING 30 SQL 25 INFO 20 DEBUG 10 NOTSET 0 """ CONSOLE_LOG_LEVEL = 10 DATA_DIR = "/application/.pgadmin/" LOG_FILE = "/application/.pgadmin/logfile" SQLITE_PATH = '/application/.pgadmin/pgadmin4.db' ``` We already have everything ready for deploy on our repository [here](https://github.com/squarecloud-education/pgadmin4-web/releases). You just need to download the `project.zip` and upload it. ## 📁 Necessary Files The following files are necessary in your zip: * requirements.txt or pyproject.toml * .env (optional) ## ⚙️ Configuration File * You need to configure runtime environment to `Detect manually` and set it to `Python`. In a squarecloud.config or squarecloud.app will look like this: ```systemd squarecloud theme={null} DISPLAY_NAME=App name RUNTIME=python MEMORY=1024 START=python -m gunicorn --bind 0.0.0.0:80 --workers=1 --threads=4 pgadmin4.pgAdmin4:app VERSION=recommended SUBDOMAIN=my-pgadmin-subdomain ``` * Next, we need to set 2 environment variables, `PGADMIN_SETUP_EMAIL` and `PGADMIN_SETUP_PASSWORD` in a `.env` file or in the Square Cloud environment on the upload menu. ```systemd .env theme={null} PGADMIN_SETUP_EMAIL=accessemail@example.com PGADMIN_SETUP_PASSWORD=yourSecurePassword ``` ## Uploading the Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` # How to host your Uptime Kuma Source: https://docs.squarecloud.app/en/tutorials/how-to-deploy-uptime-kuma This tutorial will guide you to create and deploy your Uptime Kuma application on Square Cloud. ## Introduction * This article guides you through creating and hosting an Uptime Kuma application on Square Cloud. * Before getting started, make sure you have an account on Square Cloud, which can be done through the sign up page. You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## Choosing a version * First, we need to choose a version available [here](https://github.com/squarecloud-education/uptimekuma-web/releases). * Download the `project.zip` of the choosed version. ## Config file * If you want a custom subdomain instead of a random hash, you can modify your squarecloud.config to set the desired subdomain. ```systemd squarecloud.config theme={null} DISPLAY_NAME=Uptime Kuma MEMORY=1024 VERSION=recommended AUTORESTART=true MAIN=server/server.js SUBDOMAIN=my-uptime-kuma ``` You can also set this through the upload menu. ## Uploading the Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` # How to Host a Selenium Application on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/how-to-deploy-your-selenium-application Complete guide for automating web navigation using Selenium and Chromium on Square Cloud with professional implementation and advanced configurations. ## Professional Selenium Script Development To implement efficient web automation on Square Cloud, it's essential to establish a proper development environment and follow configuration best practices. ### Essential Technical Prerequisites * **Python and pip**: Make sure you have **Python** and **pip** installed on your system. If you don't have them, download from the [official Python website](https://www.python.org/) and the [official Pip website](https://pypi.org/). * **Square Cloud Account**: Create your account through the [signup page](https://squarecloud.app/en/signup), using your email address for registration. * **Active Paid Plan**: A paid plan is necessary to ensure adequate resources for running Selenium applications. Check our [available plans](https://squarecloud.app/en/pricing) and choose the most suitable for your needs. ### Selenium Environment Configuration With Python and pip installed, proceed with creating the Selenium script. First, install the Selenium library: ```bash Terminal theme={null} pip install selenium ``` Next, create a Python file (for example, `main.py`) and add the following code to implement a basic Selenium script: ```python main.py theme={null} import time from selenium import webdriver from selenium.webdriver.chrome.service import Service # Configuration options for Chromium options = Options() options.add_argument("--headless") # Runs in background without graphical interface options.add_argument("--no-sandbox") # Required for execution as root in containerized environments options.add_argument("--disable-dev-shm-usage") # Overcomes shared memory limitations on large pages # Driver initialization service = Service('/usr/bin/chromedriver') # Default ChromeDriver path on Square Cloud driver = webdriver.Chrome(service=service, options=options) # Browser window dimensions configuration driver.set_window_size(1920, 1080) # Adjust as needed for your application # Navigate to web page driver.get('https://www.google.com') # Loop for screenshot capture every minute while True: driver.save_screenshot('page.png') print("Page screenshot saved successfully.") time.sleep(60) # 60-second pause between captures ``` ## Dependency Management with requirements.txt The `requirements.txt` file is an essential component that lists all external libraries needed for your project. It's crucial to include all dependencies used, excluding native Python libraries like `random` and `datetime`. This file should be included when submitting your application to Square Cloud. ```txt requirements.txt theme={null} selenium ``` ## Chromium Path Configuration In the implementation presented above, it's not necessary to explicitly define the Chromium path, as the Selenium WebDriver can automatically locate the browser when installed in a standard system location. The ChromeDriver, specified with `Service('/usr/bin/chromedriver')`, has knowledge about where to locate the Chromium/Chrome executable. ### Square Cloud Architecture On Square Cloud, Chromium is installed at `/usr/bin/chromium`, which is the standard system location. Therefore, the Selenium WebDriver can locate it automatically through the specified ChromeDriver. Thus, there's no need to explicitly specify the Chromium path in the code, unless there are specific reasons to do so, such as custom installations or different environment configurations. ## Square Cloud Configuration File The squarecloud.app file is an essential configuration file that will be used to configure your application on Square Cloud. It defines name, description, version, main file, among other fundamental configurations. ## Project Upload to Square Cloud After preparing all project files, proceed with uploading to Square Cloud and host your application professionally. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in the terminal: ```bash Terminal theme={null} npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in the terminal: ```bash Terminal theme={null} squarecloud update ``` To authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking "Request API Key". After obtaining your authorization key, run the following command: ```bash Terminal theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, execute the following command, providing the path to your zip file: ```bash Terminal theme={null} squarecloud upload zip ``` ## Additional Resources and Documentation For more detailed information about Selenium and its advanced tools, visit the [official Selenium documentation](https://www.selenium.dev/documentation/webdriver/getting_started/). There you'll find detailed technical guides, specialized tutorials, and complete API documentation to maximize the use of Selenium functionalities. # How to Host your Website/API on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/how-to-deploy-your-website Complete guide for hosting websites and APIs on Square Cloud using the squarecloud.app configuration file with professional implementation. ## Introduction To host websites and APIs on Square Cloud, it's essential to follow proper configuration procedures and meet the necessary technical prerequisites. This comprehensive guide will present the entire professional implementation process. ### Technical Prerequisites * **Square Cloud Account**: Create your account through the [signup page](https://squarecloud.app/en/signup), using your email address for registration. * **Active Paid Plan**: It's necessary to have a paid plan to ensure adequate resources and optimized performance. Check our [available plans](https://squarecloud.app/en/pricing) and choose the most suitable for your needs. ## Square Cloud Configuration File The squarecloud.app file is an essential configuration file that will be used to configure your application on Square Cloud. It defines name, description, version, main file, among other fundamental configurations. ### Essential Parameters for Websites The **website port** must be configured as **80**. For static websites, it's not necessary to define the `START` parameter. **Main parameters of the squarecloud.app configuration file:** * `SUBDOMAIN`: For website hosting, define this parameter with your desired subdomain. * `START`: Custom startup command (when necessary). The website URL will be: `my-subdomain-parameter`.squareweb.app ### Configuration Examples **Example 1: Static website without custom startup command** ```systemd theme={null} MAIN=index.html MEMORY=512 VERSION=recommended DISPLAY_NAME=My simple static website! SUBDOMAIN=mysite-simple-website ``` **Example 2: Website with all parameters and custom startup command** ```systemd theme={null} MAIN=index.js MEMORY=512 VERSION=recommended DISPLAY_NAME=My simple Next.js website! SUBDOMAIN=mysite-nextjs-website START=npm run build && npm run start ``` ## Support for Multiple Technologies Square Cloud offers comprehensive support for various web development technologies, providing flexibility in choosing the most suitable tech stack for your project. Learn how to host your React website on Square Cloud. Learn how to host your Next.js website on Square Cloud. Learn how to host your NestJs application on Square Cloud. Learn how to host your Vite website on Square Cloud. Learn how to host your Vue website on Square Cloud. Learn how to host your Flask application on Square Cloud. Learn how to host your Django application on Square Cloud. Learn how to host your Lavalink server and stream high-quality music to your Discord bot. ## Final Considerations Following these technical guidelines, you'll have your website or API running optimally on Square Cloud. The platform offers robust and reliable infrastructure to ensure your application operates with maximum performance. # 😁 Welcome to Square Cloud Tutorials Source: https://docs.squarecloud.app/en/tutorials/introduction Explore Square Cloud tutorials and immerse yourself in a world of simplified enterprise hosting education. Start learning today! # 🤔 What are Square Cloud "tutorials"? * Our tutorials are essential resources designed to guide you from basic tools like hosting Discord bots to more advanced ones like using Selenium and hosting on Square Cloud. Get ready to master all the tools available in the largest enterprise hosting in Latin America. ## 📚 What Are the Tutorials About? * The tutorials consist of tools available for use on Square Cloud, such as applications for platforms like Discord, Telegram, APIs built in Flask, and others. * Each article teaches how to create, configure, and host your application on Square Cloud in the best possible way for developers. * We are constantly updating and creating new tutorials based on user demand and tool evolution. If you want to suggest an article for us to add, you can do so in our [Discord community](https://go.squarecloud.app/discord), where a team member will respond to your request, or by opening a pull request in our [documentation repository](https://github.com/squarecloudofc/docs). # 📑 What articles are currently available? This article teaches how to create and configure your custom domain on Square Cloud. This article teaches how to create and host a Lavalink server on Square Cloud. This article teaches how to configure and host websites & APIs on Square Cloud. This article teaches how to set up and use Square Cloud's Git integration. This article teaches how to change the timezone of your application on Square Cloud. This article teaches how to set up a Top.gg webhook on Square Cloud. This article teaches how to use Selenium on Square Cloud. This article teaches how to create and host a Flask application on Square Cloud. This article teaches how to create and host a Django application on Square Cloud. This article teaches how to create and host a NestJS application on Square Cloud. This article teaches how to create and host an Express application on Square Cloud. This article teaches how to create and host a Fastify application on Square Cloud. This article teaches how to create and host a Vue website on Square Cloud. This article teaches how to create and host a Vite website on Square Cloud. This article teaches how to create and host a React website on Square Cloud. This article teaches how to create and host a Next.js website on Square Cloud. This article teaches how to create and host a Discord bot on Square Cloud. This article teaches how to create and host a WhatsApp bot on Square Cloud. This article teaches how to create and host a Telegram bot on Square Cloud. # ⭐ Additional Information Follow all updates to Square Cloud services and their documentation! Official changelog of the Square Cloud Platform. Join our community on [Discord](https://go.squarecloud.app/discord) to get help from other developers and share your experiences. Join our community on Discord. We're here to help you! Check out some of our projects to assist you in interacting with our Square Cloud API. Learn how to use the Square Cloud JavaScript SDK to interact with the Square Cloud API. Learn how to use the Square Cloud Python SDK to interact with the Square Cloud API. Learn how to use the Square Cloud CLI to interact with the Square Cloud API. Learn how to use the Square Cloud SDK Blob to interact with the Square Cloud Blob. # How to Set Up Your Custom Domain Source: https://docs.squarecloud.app/en/tutorials/platform/custom-domain Learn how to configure your domain on Square Cloud ## Introduction To configure your custom domain on Square Cloud, you need to have the **Standard** plan or higher. Since Square Cloud uses CNAME records for domain functionality, some registrars may not offer complete support for this configuration. **Therefore, we strongly recommend using Cloudflare** as a DNS proxy, which offers full compatibility and advanced features for your domain. ## Registering a Domain To use a custom domain on Square Cloud, you need to be the domain owner. This means you must register or already own a domain through a trusted domain registrar. Choose the platform that best meets your needs and register your domain. ## Setting Up DNS on Cloudflare * Access the website where you registered your domain. * Then, go to [Cloudflare](https://cloudflare.com/), navigate to **Sites** and click **Add a site**. After entering your domain, copy the provided nameservers and paste them in the panel of the platform where you registered the domain, in the **DNS/Nameservers** section. ## Configuring Your Domain on Square Cloud * In the [dashboard](https://squarecloud.app/en/dashboard), choose the site for which you want to configure the domain. Then, access **Settings** and replace "example.com" with your domain. * Now that the domain is registered on Square Cloud, return to Cloudflare, select your domain and access the **DNS** tab. * Finally, create a **CNAME** record pointing to `cname.squareweb.app`, replacing the name with your subdomain, and another **TXT** record with the value displayed in **DNS Configuration** after saving. ## Important Tips ### Redirecting www to Your Domain * To redirect `www` to your domain, create a new record with the name **www** and type **A**, pointing to `192.0.2.1` (Cloudflare's internal IP). * Then, in Cloudflare, access **Page Rules** and create a new rule with the settings shown below: ### Troubleshooting * If you receive the error **"Could not find this site."**, try clearing your browser cache and access the site again in 60 seconds. * If you receive the **Cloudflare 1015** error, it means your domain is not configured correctly. Check the configuration and make sure it is correctly pointed to Square Cloud. If you continue having problems, [contact our team](/en/company/support). # How to Set Up Git Integration in Your Application Source: https://docs.squarecloud.app/en/tutorials/platform/github-integration Complete guide for configuring Git integration on Square Cloud with automated deployment and professional repository management. GitHub integration allows you to connect your repository to Square Cloud for automated deployment. Follow this step-by-step guide to configure the complete integration. First, you need to create a personal access token on GitHub to authenticate the connection. * Visit the [Personal access tokens](https://github.com/settings/tokens) page * Click **"Generate new token"** and choose the **"classic"** option * **Select only** the **"repos"** option in permissions * **Do not set an expiration time** to avoid interruptions * Give your token an identifying name * Click **"Generate token"** and **copy the generated token** (you won't be able to see it again) Now configure the token on the Square Cloud platform to establish the connection. * Access the [dashboard](https://squarecloud.app/dashboard) * Select your application * Navigate to the **Deploy** section * **Paste your token** in the corresponding field * Click **"Save"** After saving, a **webhook URL** will be displayed. **Copy this URL** - you'll need it in the next step. Configure the webhook in your GitHub repository so it can communicate with Square Cloud. * Access your application's repository on GitHub * Go to **"Settings"** → **"Webhooks"** * Click **"Add Webhook"** * Paste the webhook URL in the **Payload URL** field * Set the **Content Type** to **application/json** * Click **"Add Webhook"** If you want the webhook to monitor only a specific branch, configure an additional parameter. * In the webhook's **Payload URL** field on GitHub * Add to the end of the URL: `?branch=branch_name` Example: To monitor only the `main` branch, add `?branch=main` to the end of the URL Now test if the integration is working correctly. * Make any changes to your code * Commit and push to the GitHub repository * Your application on Square Cloud will be updated automatically * Check the deployment logs in the control panel to confirm success ## Next Steps With the integration configured, you can: * Automatically deploy with every push * Monitor deployment status in the dashboard * Configure different branches for different environments * Leverage Square Cloud's continuous integration system # How to Change Timezone Source: https://docs.squarecloud.app/en/tutorials/platform/timezone-change Learn how to change the timezone to suit your application's needs. ## Introduction The Square Cloud servers are located in New York, USA. By default, the timezone is set according to this location. However, in this article, we will teach you how you can customize the timezone of your application to whichever you desire. ## Getting Started The following sections provide code examples for both Javascript and Python: ```javascript index.js theme={null} // Create a Date object const date = new Date(); // Convert the date to a string using a specific timezone const dateString = date.toLocaleString("pt-BR", { timeZone: "America/Sao_Paulo", }); console.log(dateString); // Outputs the date and time in the "America/Sao_Paulo" timezone ``` ```javascript index.js theme={null} const moment = require('moment'); require('moment-timezone'); // Create a Moment.js object with the current date and time const date = moment(); // Change the timezone to "America/Sao_Paulo" const time = date.tz('America/Sao_Paulo'); // Define the format string for date and time representation // YYYY: Represents the year with four digits (e.g., 2022) // MM: Represents the month as a zero-padded decimal number (e.g., 01 for January, 02 for February, ..., 12 for December) // DD: Represents the day of the month as a zero-padded decimal number (e.g., 01, 02, ..., 31) // HH: Represents the hour as a zero-padded decimal number in 24-hour clock format (e.g., 00 for midnight, 13 for 1 PM, ..., 23 for 11 PM) // mm: Represents the minute as a zero-padded decimal number (e.g., 00, 01, ..., 59) // ss: Represents the second as a zero-padded decimal number (e.g., 00, 01, ..., 59) const formattedTime = time.format('YYYY-DD-MM HH:mm:ss'); console.log(formattedTime); // Outputs the date and time in the "America/Sao_Paulo" timezone ``` ```python main.py theme={null} from datetime import datetime, timedelta # Create a datetime object now = datetime.now() # Create a timedelta object to represent the timezone difference time_difference = timedelta(hours=-3) # The timezone difference between UTC and "America/Sao_Paulo" is -3 hours # Change the timezone time = now + time_difference # Define the format string for date and time representation # %Y: Represents the year with four digits (e.g., 2022) # %d: Represents the day of the month as a zero-padded decimal number (e.g., 01, 02, ..., 31) # %m: Represents the month as a zero-padded decimal number (e.g., 01 for January, 02 for February, ..., 12 for December) # %H: Represents the hour as a zero-padded decimal number in 24-hour clock format (e.g., 00 for midnight, 13 for 1 PM, ..., 23 for 11 PM) # %M: Represents the minute as a zero-padded decimal number (e.g., 00, 01, ..., 59) # %S: Represents the second as a zero-padded decimal number (e.g., 00, 01, ..., 59) formatted_time = time.strftime('%Y-%d-%m %H:%M:%S') print(formatted_time) # Outputs the formatted date and time in the "America/Sao_Paulo" timezone ``` ```python main.py theme={null} from datetime import datetime import pytz # Create a datetime object with the current time in UTC now = datetime.now(pytz.utc) # Define the timezone for "America/Sao_Paulo" tz = pytz.timezone('America/Sao_Paulo') # Convert the UTC datetime to "America/Sao_Paulo" timezone time = now.astimezone(tz) # Define the format string for date and time representation # %Y: Represents the year with four digits (e.g., 2022) # %d: Represents the day of the month as a zero-padded decimal number (e.g., 01, 02, ..., 31) # %m: Represents the month as a zero-padded decimal number (e.g., 01 for January, 02 for February, ..., 12 for December) # %H: Represents the hour as a zero-padded decimal number in 24-hour clock format (e.g., 00 for midnight, 13 for 1 PM, ..., 23 for 11 PM) # %M: Represents the minute as a zero-padded decimal number (e.g., 00, 01, ..., 59) # %S: Represents the second as a zero-padded decimal number (e.g., 00, 01, ..., 59) formattedTime = time.strftime('%Y-%d-%m %H:%M:%S') print(formattedTime) # Outputs the date and time in the "America/Sao_Paulo" timezone ``` # How to change PTB httpx to aiohttp Source: https://docs.squarecloud.app/en/tutorials/python/how-to-change-ptb-connection This tutorial guides you on how to change httpx python-telegram-bot to aiohttp. ## Introduction * This article guides you through changing `python-telegram-bot` `httpx` to `aiohttp`. `httpx` and `aiohttp` are libraries used to make http requests. * Before we get start, make sure you have Python and python-telegram-bot library installed on your environment. Check the python-telegram-bot instalation command below. ```bash theme={null} pip install python-telegram-bot ``` ## Changing libraries ### Installing * First, you will need to install a library that offers an class to handle the requests maded to Telegram. Let's install `ptbcontrib`, use the command below: ```bash theme={null} pip install git+https://github.com/python-telegram-bot/ptbcontrib.git@main ``` ### Changing httpx to aiohttp * Next, we need to import `AiohttpRequest` in the file where we will instantiate our bot client. ```python theme={null} from ptbcontrib.aiohttp_request import AiohttpRequest ``` * This class will handle all requests to telegram instead of default `httpx`. * `AiohttpRequest` will be used in the PTB client instance like in the example below: ```python Bot theme={null} import asyncio import telegram from ptbcontrib.aiohttp_request import AiohttpRequest async def main(): bot = telegram.Bot("TOKEN", request=AiohttpRequest(), get_updates_request=AiohttpRequest()) async with bot: print(await bot.get_me()) if __name__ == '__main__': asyncio.run(main()) ``` ```python ApplicationBuilder theme={null} import logging from telegram import Update from telegram.ext import ApplicationBuilder, ContextTypes, CommandHandler from ptbcontrib.aiohttp_request import AiohttpRequest logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO ) async def start(update: Update, context: ContextTypes.DEFAULT_TYPE): await context.bot.send_message(chat_id=update.effective_chat.id, text="I'm a bot, please talk to me!") if __name__ == '__main__': application = ApplicationBuilder().request(AiohttpRequest(connection_pool_size=256)).get_updates_request(AiohttpRequest()).token('TOKEN').build() start_handler = CommandHandler('start', start) application.add_handler(start_handler) application.run_polling() ``` ## Why do this change? * Changing the library httpx to aiohttp brings some benefits with it. 1. **Performance**: aiohttp is faster than httpx. 2. **Mitigating Errors**: The httpx will raise too much network errors like ReadError and other NetworkErrors due to it's configurations and performance. # How to validate data with pydantic Source: https://docs.squarecloud.app/en/tutorials/python/how-to-validate-data-with-pydantic Learn how to validate data with pydantic. ## Introduction * This article guides you through data validation with pydantic. Pydantic is a Python library built in Rust. * Before we get start, make sure you have Python and Pydantic library installed on your environment. Check the pydantic instalation command below. ```bash theme={null} pip install pydantic ``` ## Creating a model * First, we will need to import and make our class inherit from `pydantic.BaseModel` to start validating. In our example we will create a class named `Person` and it will have name, age and an e-mail. ```python theme={null} from pydantic import BaseModel class Person(BaseModel): name: str age: int email: str ``` * With this class, when we instatiate it, pydantic will validate if the parameters `name` and `email` are strings and `age` is integer. ### Using the model * Now we have it created, we will instantiate the class. We will create a dict containing the data and unpack it to our class. ```python theme={null} data = { "name": "John", "age": 19, "email": "john@gmail.com" } person = Person(**data) ``` * The above example will not raise any error since all **parameters** are on correct type. Now we will make a wrong data to confirm if our validation work. ```python theme={null} data = { "name": "John", "age": "19", "email": "john@gmail.com" } person = Person(**data) ``` * In the above example it will raise the error `ValidationError` because `age` needs to be an **integer** and cannot be provided as a **string**. ## Creating dataclass * You can also create **dataclasses** with pydantic which will be similar to standard Python **dataclasses** but will have validations like BaseModel. ```python theme={null} from pydantic import dataclass @dataclass class Person: name: str age: int email: str ``` * If we send a `string` to `age`, it will convert to `int`. Pydantic supports recursive validation, meaning that when validating nested models, it also validates the internal models. If some class has a list of `Person`, `people: list[Person]`, it will check each item on the list and converts it into a `Person`. ## Extras * Pydantic has some extras like **e-mail** validations and a fallback **timezone** package. To install them, you need to run the following commands: ```bash theme={null} pip install pydantic[email] ``` ```bash theme={null} pip install pydantic[timezone] ``` * You can install both together by running the following command. ```bash theme={null} pip install pydantic[email,timezone] ``` * Pydantic\[email] brings a class to handle emails, normalizing it and validanting the format `user@domain.tld`. For this, pydantic brings the class `EmailStr` to do this validation. ```python theme={null} from pydantic import dataclass, EmailStr @dataclass class Person: name: str age: int email: EmailStr ``` # Configure Top.gg Webhook on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/topgg-webhook-config A detailed guide to setting up the Top.gg webhook on Square Cloud. ## Introduction * This guide assumes you have an approved bot on [top.gg](https://top.gg/) and are using either Node.js or Python for your project. * Next, you will need to create an account on Square Cloud, which can be done through the [sign up page](https://squarecloud.app/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ## Setting Up the Environment 1. Before you begin, make sure you have Node.js and npm installed on your system. If you don't have them yet, you can download them from the [official Node.js website](https://nodejs.org/). 2. Start a new Node.js project with the following command: ```bash Terminal theme={null} npm init -y ``` This command creates a package.json file in the current directory. 2. Install the necessary libraries: ```bash Terminal theme={null} npm install @top-gg/sdk express ``` 1. Ensure you have Python and Pip (a package manager for Python) installed on your system. If not, you can download them from the [official Python website](https://www.python.org/) and the [official Pip website](https://pypi.org/). 2. Install the `flask` and `waitress` libraries using pip: ```bash theme={null} pip install flask pip install waitress ``` ## Setting Up the Project **1. Get your webhook authentication:** * Go to your Top.gg profile [here](https://top.gg/user/me). * Click "edit" on the bot you want to receive notifications for votes. * Under "GENERAL", choose the "webhook" option. * Set the webhook authentication in "Authorization". In this example, we used "myappsquare". **2. Implement the webhook listener:** The following sections provide code examples for both Javascript and Python: We will use the example provided by the top.gg documentation [here](https://docs.top.gg/docs/Libraries/javascript), with some modifications. ```javascript index.js theme={null} // Import libraries const Topgg = require("@top-gg/sdk"); const express = require("express"); // Create Express app and Top.gg webhook instances const app = express(); const webhook = new Topgg.Webhook("YOUR_AUTHORIZATION_TOKEN"); // Define route for '/topgg' endpoint (POST requests) app.post("/topgg", webhook.listener((vote) => { // Log vote received message with user ID console.log(`Vote received successfully! User ID: ${vote.user}`); })); // Start server on port 80 (default HTTP) app.listen(80); ``` For Python, you can use the following code: ```python app.py theme={null} # Import the necessary libraries import logging import json from waitress import serve from flask import Flask, request, abort # Create an instance of the Flask app app = Flask(__name__) # Define your authorization token AUTH_TOKEN = 'YOUR_AUTHORIZATION' # Define a route for the '/topgg' endpoint that accepts POST requests @app.route("/topgg", methods=["POST"]) def hook(): # Check the authorization header auth = request.headers.get('Authorization') if auth != AUTH_TOKEN: logging.error('Access denied') abort(401) # Unauthorized # Convert the request data from bytes to a JSON dictionary data = json.loads(request.data) # Print the ID of the user who voted print(f'Vote received successfully! User ID: {data["user"]}') # Return a response with the string "Data received" and status 200 to indicate that the request was processed successfully return "Data received" # Check if this script is being run directly and not imported as a module if __name__ == "__main__": # Set the log message format to exclude the log level logging.basicConfig(format='%(message)s', level=logging.INFO) # Serve our Flask app on port 80 and listen on all network interfaces serve(app, host="0.0.0.0", port=80) ``` ## Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Uploading Your Application to Square Cloud After following all the steps, put your application files into a `.zip` file, including the configuration file. If your application is a Node.js project, take a look at our article on [Node.js]("https://docs.squarecloud.app/articles/getting-started-with-nodejs"). If your application is a Python project, take a look at our article on [Python]("https://docs.squarecloud.app/articles/getting-started-with-python"). Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` ## Starting Tests If you have done everything correctly, try accessing your site using the subdomain defined in the configuration file. If you defined it as "mysite", to access it will be `https://mysite.squareweb.app/`. After you access and only "Cannot GET /" or "Method Not Allowed" appears, everything is okay. Now, you need to go back to the previous page where the authorization was defined. In the Webhook URL field, you should put the URL of your site with the route that will receive the votes. * For the JavaScript code we created with `app.post("/topgg", webhook.listener((vote) => {...})`, the route that will receive the votes is "/topgg". So, if your website is "[https://mysite.squareweb.app](https://mysite.squareweb.app)", you should put "[https://mysite.squareweb.app/topgg](https://mysite.squareweb.app/topgg)" as the Webhook URL. * For the Python code we created with `@app.route("/topgg", methods=["POST"])`, the route that will receive the votes is also "/topgg". So, the Webhook URL would be the same "[https://mysite.squareweb.app/topgg](https://mysite.squareweb.app/topgg)". Finally, click on the "Send Test" button. After that, check the terminal. If everything went well, the message you defined in `console.log` or `print` should appear in the terminal. And with that, if everything has been configured correctly, your webhook will be ready to send notifications when your bot receives a vote on top.gg. ## Troubleshooting # Professional Angular Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/angular Complete guide for developing and hosting high-performance Angular applications on Square Cloud. ## Professional Angular Application Development * Before starting, make sure you have **Node.js and npm** installed on your system. If you don't have them yet, you can download them from the official [Node.js](https://nodejs.org/) website. * Next, create an account on Square Cloud through the [signup](https://squarecloud.app/en/signup) page. You can use your email to register quickly. * Finally, ensure you have an active paid plan on your account. You can view and purchase a plan according to your needs [here](https://squarecloud.app/en/pricing). ## Angular Configuration To create an Angular project, you need to install the Angular CLI. Run the following command: ```bash theme={null} npm install -g @angular/cli ``` Now create a new Angular project: ```bash theme={null} ng new my-angular-app ``` Then install the project dependencies: ```bash theme={null} cd my-angular-app npm install ``` ## Creating an Angular Project To start your local development server, run: ```bash theme={null} ng serve --port 4200 ``` Angular will start a development server, usually available at `http://localhost:4200`. To generate a simple component, use: ```bash theme={null} ng generate component hello ``` You can edit the generated template in: ``` src/app/hello/hello.component.html ``` ## Creating the Square Cloud Configuration File The squarecloud.app file defines your application's name, description, version, build settings, main file, and more. ## Purchasing a Plan Before Uploading the Project Before deploying your project to Square Cloud, ensure you have an active plan that meets your application's resource needs. **Unsure how much RAM and CPU an Angular application needs?** Angular is a full-featured compiled framework that generates optimized static files for production. For most Angular projects, the **Standard** plan with **4GB RAM** and **4vCPU** is more than enough. For larger enterprise applications, consider upgrading to the Pro plan. ## Building Angular for Production Before uploading your project to Square Cloud, build the production bundle: ```bash theme={null} ng build --configuration production ``` Angular will generate the optimized static files inside the `dist/{PROJECT_NAME}` folder. ### Express library ### Serve library ## Additional Resources For more information about Angular, visit the official documentation [here](https://angular.dev). ## Troubleshooting # Professional Astro Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/astrojs Complete guide for developing and hosting fast, content-focused Astro applications on Square Cloud. ## Professional Astro Application Development * Before starting, make sure you have **Node.js (>=16.x)** and **npm** installed on your system. If you don't have them yet, you can download them from the official [Node.js](https://nodejs.org/) website. * Next, create an account on Square Cloud through the [signup](https://squarecloud.app/en/signup) page. You can use your email to register quickly. * Finally, ensure you have an active paid plan on your account. You can view and purchase a plan according to your needs [here](https://squarecloud.app/en/pricing). ## Astro Configuration To create an Astro project, run the official initializer: ```bash theme={null} npm create astro@latest ``` Follow the prompts to select a template and project options. After the project is created, enter the project directory and install dependencies: ```bash theme={null} cd my-astro-site npm install ``` ## Creating an Astro Project Start the development server with: ```bash theme={null} npm run dev ``` Astro typically starts the dev server at `http://localhost:3000`. To create a simple page, add `src/pages/index.astro` with the following content: ```astro theme={null} --- ---

Hello from Astro!

``` You can add components under `src/components/` and import them into your pages. ## Creating the Square Cloud Configuration File The `squarecloud.app` file defines your application's name, description, version, entry point, and other essential settings. ## Purchasing a Plan Before Uploading the Project Before deploying your project to Square Cloud, ensure you have an active plan that meets your application's resource needs. Astro sites are often static and very resource-efficient, so the **Basic** or **Standard** plan is sufficient for many projects. If your site uses server adapters, dynamic rendering, or heavy backend logic, consider the **Pro** plan. **Unsure how much RAM and CPU an Astro site needs?** Static Astro sites are lightweight and usually require minimal resources. If you use server-side rendering or adapters, resource needs will depend on your runtime; the **Standard** plan is a good starting point for most use cases. ## Building Astro for Production Build the production output before uploading: ```bash theme={null} npm run build ``` Astro will generate the optimized output inside the `dist/` folder by default. To serve a static Astro site on Square Cloud, make sure your server or configuration points to the `dist/` folder. If you are using a Node server, set the **START** field accordingly. ### Express library ### Serve library ## Additional Resources For more information about Astro, visit the official documentation [here](https://astro.build/docs). ## Troubleshooting # Professional Gatsby Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/gatsby Complete guide for developing and hosting high-performance Gatsby sites on Square Cloud. ## Professional Gatsby Application Development * Before starting, make sure you have **Node.js (>=16.x)** and **npm** installed on your system. If you don't have them yet, download them from the official [Node.js](https://nodejs.org/) website. * Gatsby is a React-based static site generator with support for dynamic rendering (SSR) and incremental builds. Choose a starter template when initializing your project. * Create an account on Square Cloud at the [signup](https://squarecloud.app/en/signup) page and ensure you have an active paid plan if required [here](https://squarecloud.app/en/pricing). ## Gatsby Configuration Initialize a new Gatsby project using the official initializer: ```bash theme={null} npm create gatsby@latest ``` Follow the prompts to choose a starter and options (TypeScript, Tailwind, etc.). After creation, enter the project directory and install dependencies: ```bash theme={null} cd my-gatsby-site npm install ``` ## Creating a Gatsby Project Start the development server: ```bash theme={null} npm run develop ``` Gatsby's development server typically runs at `http://localhost:8000`. To generate a simple page add `src/pages/index.js` with: ```jsx theme={null} import * as React from 'react' export default function Index() { return

Hello from Gatsby!

} ``` ## Creating the Square Cloud Configuration File The `squarecloud.app` file defines your application's name, description, version, entry point, and other essential settings. ## Purchasing a Plan Before Uploading the Project Before deploying your Gatsby site to Square Cloud, ensure you have an active plan that meets your application's resource needs. Static Gatsby sites are resource-efficient and usually work well on **Basic** or **Standard** plans. If you use server-side rendering, preview servers, or heavy build-time processing, consider **Standard** or **Pro**. **Not sure how much RAM and CPU a Gatsby site needs?** For static sites resource needs are small; SSR or build-heavy sites depend on content size and concurrency. Start with Standard for dynamic use cases. ## Building Gatsby for Production Build the production output before uploading: ```bash theme={null} npm run build ``` Gatsby will generate the static output inside the `public/` folder by default. ### Express library ### Serve library ### SSR For SSR builds that emit a server bundle just configure main file to `server.js` ## Additional Resources For more information about Gatsby, visit the official documentation [here](https://www.gatsbyjs.com/docs/). ## Troubleshooting # Hosting a Next.js Website on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/next This article provides a complete guide to create and host a Next.js website on Square Cloud. ## Introduction * Before you begin, make sure you have Node.js and npm installed on your system. If you don't have them yet, you can download them from the [official Node.js website](https://nodejs.org/). * Next, you will need to create an account on Square Cloud, which can be done through the [sign up page](https://squarecloud.app/en/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ### Creating a Next.js Project To create a new Next.js project, run the following command: ```bash theme={null} npx create-next-app@latest my-app ``` In this command, `my-app` is the name of your new project. You can replace `my-app` with any name you want for your project. The `npx` command is a tool that comes with `npm`, the Node.js package manager. It is used to run Node.js packages that are installed locally in your project or are available remotely on the npm registry. `create-next-app` is a package available on the npm registry that sets up a new Next.js project automatically. It takes care of all the initial setup, such as creating the project directory, installing necessary dependencies, and configuring basic files. `@latest` is a tag specifying that you want to use the latest version of the `create-next-app` package. This ensures you're always using the most updated version and, consequently, have access to the latest features. ## Configuring Port 80 Port 80 is the default port for HTTP traffic. To host a Next.js website on Square Cloud, it's crucial to configure the use of port 80. In Next.js, you can set the `-p 80` parameter in the startup script to ensure your website runs correctly on this port. ## Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Configuring the START Field In the Square Cloud configuration file, the `START` field is essential for customizing the startup command. If you want to build and start your website on Square Cloud, configure the `START` field as follows: ```app squarecloud.app theme={null} START=npm run build && npm run start ``` This command will execute the "build" and "start" scripts defined in your `package.json`: ```json package.json theme={null} { "name": "my-app", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start -p 80", "lint": "next lint" }, "dependencies": { "react": "^18", "react-dom": "^18", "next": "14.1.0" }, "devDependencies": { "autoprefixer": "^10.0.1", "postcss": "^8", "tailwindcss": "^3.3.0", "eslint": "^8", "eslint-config-next": "14.1.0" } } ``` ## Purchasing a Plan Before Uploading Your Project Before uploading your project to Square Cloud, it is important to understand that you need to purchase a plan. The type of plan chosen will depend on the resources required by your application. You can view our plans [here](https://squarecloud.app/en/pricing). **Wondering how much RAM and CPU your plan needs to host a Next.js website?** Don't worry, we're here to help. Next.js is a React framework widely recognized for its server-side rendering capabilities and static site generation. It is designed to provide an optimized development experience through features like zero configuration, automatic TypeScript support, file system-based routing, and built-in CSS support. Our **[Standard](https://squarecloud.app/en/pricing)** plan offers **4GB** of RAM and **4vCPU**, which should be sufficient for most Next.js websites. However, if you are working on a larger project or need more stability, we recommend considering our Pro plan. With additional resources, you can ensure smooth performance even under high demand. To purchase, simply click [here](https://squarecloud.app/en/pay?plan=pro). ## Uploading the Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to run the following command, passing the path to your zip file: ```bash theme={null} squarecloud upload zip ``` ## Additional Resources For more information about Next.js and its tools, visit the [official Next.js documentation](https://nextjs.org/docs). There, you will find detailed guides, tutorials, and API documentation to help you make the most of Next.js. ## Troubleshooting # Professional Nuxt Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/nuxt Complete guide for developing and hosting high-performance Nuxt applications on Square Cloud. ## Professional Nuxt Application Development * Before starting, make sure you have **Node.js and npm** installed on your system. If you don't have them yet, you can download them from the official [Node.js](https://nodejs.org/) website. * Next, create an account on Square Cloud through the [signup](https://squarecloud.app/en/signup) page. You can use your email to register quickly. * Finally, ensure you have an active paid plan on your account. You can view and purchase a plan according to your needs [here](https://squarecloud.app/en/pricing). ## Nuxt Configuration To create a Nuxt project, you need to install the Nuxt CLI. Run the following command: ```bash theme={null} npx nuxi init my-nuxt-app ``` This command initializes a new Nuxt project in the **my-nuxt-app** folder. Then install the project dependencies: ```bash theme={null} cd my-nuxt-app npm install ``` ## Creating a Nuxt Project After installing the dependencies, you can start your local development server with: ```bash theme={null} npm run dev ``` Nuxt will start a local development server, usually at `http://localhost:3000`. To create a simple page, edit the `pages/index.vue` file: ```vue index.vue theme={null} ``` ## Creating the Square Cloud Configuration File The squarecloud.app file is a configuration file that defines your application's name, description, version, main file, among other settings. ## Purchasing a Plan Before Uploading the Project Before deploying your project to Square Cloud, ensure you have an active plan that meets your resource needs. **Unsure about how much RAM and CPU a Nuxt application needs?** Nuxt is a powerful framework that supports SSR, ISR, and static rendering. For most Nuxt projects, the **Standard** plan with **4GB RAM** and **4vCPU** is sufficient. However, if your project uses heavy SSR rendering or high traffic, consider upgrading to the Pro plan. ## Building Nuxt for Production Before uploading to Square Cloud, generate the production build: ```bash theme={null} npm run build ``` This creates the `.output` folder required for running the Nuxt server. Which will contains the MAIN file on this path `.output/server/index.mjs` ## Additional Resources For more information about Nuxt, visit the official Nuxt documentation [here](https://nuxt.com/docs/4.x/getting-started/introduction). ## Troubleshooting # Professional Phoenix (Elixir) Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/phoenix Complete guide for developing and hosting scalable Phoenix (Elixir) applications on Square Cloud. ## Professional Phoenix Application Development * Before starting, make sure you have **Erlang/OTP** and **Elixir** installed on your system. If you don't have them yet, download them from the official [Elixir](https://elixir-lang.org/install.html) installation guides. * Phoenix is built on top of Elixir and the Erlang VM (BEAM). Ensure your environment matches the Phoenix version requirements in the Phoenix docs. * Next, create an account on Square Cloud through the [signup](https://squarecloud.app/en/signup) page and ensure you have an active paid plan appropriate for your application's needs [here](https://squarecloud.app/en/pricing). ## Phoenix Configuration Install the Phoenix project generator if you don't already have it: ```bash theme={null} mix archive.install hex phx_new ``` Create a new Phoenix project (choose options according to your needs): ```bash theme={null} mix phx.new my_app ``` Follow the prompts to include Ecto, dashboard, and asset tooling (esbuild, tailwind, etc.) as needed. After project creation, fetch dependencies: ```bash theme={null} cd my_app mix deps.get ``` To create the database (if using Ecto): ```bash theme={null} mix ecto.create ``` Start the development server: ```bash theme={null} mix phx.server ``` By default Phoenix runs on `http://localhost:4000`. ## Creating the Square Cloud Configuration File The `squarecloud.app` file defines your application's name, description, version, entry point, and other essential settings. ## Configuring the START Field Phoenix applications typically run as releases in production. A common start command after building a release is: ```bash theme={null} _build/prod/rel/my_app/bin/my_app start ``` A full build + start sequence (used locally or in build scripts) looks like: ```bash theme={null} MIX_ENV=prod mix deps.get --only prod MIX_ENV=prod mix assets.deploy MIX_ENV=prod mix release _build/prod/rel/my_app/bin/my_app start ``` Set the `START` field in `squarecloud.app` to the command you use to run the release (for example the full sequence or a script that performs the release and starts the app). ## Purchasing a Plan Before Uploading the Project Before deploying your Phoenix project to Square Cloud, ensure you have an active plan that meets your application's CPU and memory needs. Phoenix is highly concurrent and benefits from CPU and memory. For most apps the **Standard** plan is a good starting point; high-traffic or CPU-intensive applications should use **Pro**. **Not sure how much RAM and CPU a Phoenix app needs?** It depends on concurrency, pooled connections and background jobs. Start with Standard for typical web apps and scale up if you observe resource limits. ## Building Phoenix for Production Example production build steps (adjust for your project and asset toolchain): ```bash theme={null} # install production deps MIX_ENV=prod mix deps.get --only prod # compile and build release MIX_ENV=prod mix compile MIX_ENV=prod mix assets.deploy MIX_ENV=prod mix release # start the release _build/prod/rel/my_app/bin/my_app start ``` If your app does not use releases, you can also run via `MIX_ENV=prod mix phx.server`, but releases are recommended for production stability. When using `squarecloud.app`, point the `START` command to the final start step (release binary) or to a deployment script that runs the above steps. ## Additional Resources Official docs and references: * Phoenix: [https://hexdocs.pm/phoenix](https://hexdocs.pm/phoenix) * Elixir: [https://elixir-lang.org](https://elixir-lang.org) * Releases: [https://hexdocs.pm/mix/1.14.0/Mix.Tasks.Release.html](https://hexdocs.pm/mix/1.14.0/Mix.Tasks.Release.html) ## Troubleshooting # Professional Preact Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/preact Complete guide for developing and hosting fast and lightweight Preact applications on Square Cloud. ## Professional Preact Application Development * Before starting, make sure you have **Node.js and npm** installed on your system. If you don't have them yet, download them from the official [Node.js](https://nodejs.org/) website. * Next, create an account on Square Cloud through the [signup](https://squarecloud.app/en/signup) page. You can register quickly using your email. * Finally, ensure you have an active paid plan on your Square Cloud account. You can view and purchase a plan based on your needs [here](https://squarecloud.app/en/pricing). ### Preact Configuration To create a new Preact project, use **Preact CLI**. Install it globally: ```bash theme={null} npm install -g preact-cli ``` Create a new Preact project: ```bash theme={null} preact create default my-preact-app ``` Then install dependencies: ```bash theme={null} cd my-preact-app npm install ``` ### Creating a Preact Project Start the local development server with: ```bash theme={null} npm run dev ``` Your Preact app will start at `http://localhost:8080` (or another available port). To edit a simple component, modify: ``` src/components/app.js ``` Example: ```javascript app.js theme={null} export default function App() { return (

Hello from Preact!

); } ``` ## Creating the Square Cloud Configuration File The squarecloud.app file defines your application's name, description, version, build configuration, main entry file, and more. ## Purchasing a Plan Before Uploading the Project Before deploying your project to Square Cloud, make sure you have an active plan that fits your application's resource usage. **Unsure how much RAM or CPU a Preact application needs?** Preact is extremely lightweight and optimized for performance, meaning most applications will run smoothly on the **Standard** plan (4GB RAM, 4vCPU). For larger workloads or more traffic, consider the Pro plan. ## Building Preact for Production Before uploading, generate the production build: ```bash theme={null} npm run build ``` Preact will output the optimized static files inside the `build/` directory. ### Express library ### Serve library ## Additional Resources For more information about Preact, visit the official documentation [here](https://preactjs.com/guide/v10) ## Troubleshooting # Professional Qwik Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/qwik Complete guide for developing and hosting fast, resumable Qwik applications on Square Cloud. ## Professional Qwik Application Development * Before starting, make sure you have **Node.js (>=16.x)** and **npm** installed on your system. If you don't have them yet, download them from the official [Node.js](https://nodejs.org/) website. * Qwik focuses on resumability and minimal hydration. Choose a starter (Qwik City recommended for full web apps) when initializing your project. * Create an account on Square Cloud via the [signup](https://squarecloud.app/en/signup) page and ensure you have an active paid plan if needed [here](https://squarecloud.app/en/pricing). ## Qwik Configuration Initialize a new Qwik project using the official initializer: ```bash theme={null} npm create qwik@latest ``` Follow the prompts to choose `Qwik City` (full application) or `Qwik App` (static) and any integrations you need. After creation, go into the project and install dependencies: ```bash theme={null} cd my-qwik-app npm install ``` If you selected Qwik City, your project will include server entry points and adapters for Node, Cloudflare, etc. ## Creating a Qwik Project Start the development server: ```bash theme={null} npm run dev ``` The dev server typically runs at `http://localhost:5173` (Vite default) or as displayed in the initializer output. Create a simple page in `src/routes/index.tsx` (Qwik City) or `src/components/` for components: ```tsx theme={null} export default function Index() { return

Hello from Qwik!

; } ``` ## Creating the Square Cloud Configuration File The `squarecloud.app` file defines your application's name, description, version, entry point, and other essential settings. ## Purchasing a Plan Before Uploading the Project Before deploying your Qwik project to Square Cloud, ensure you have an active plan that meets your application's resource needs. Static Qwik sites are very efficient and often work well on **Basic** or **Standard** plans. If you use a server adapter or expect high concurrency, choose **Standard** or **Pro** depending on traffic. **Not sure how much RAM and CPU a Qwik app needs?** Static/resumable Qwik sites require minimal resources; server‑rendered Qwik City apps depend on your server-side logic and concurrency. Start with Standard for dynamic apps. ## Building Qwik for Production Build your production output before uploading: ```bash theme={null} npm run build ``` If you use Qwik City with an adapter (for example `@builder.io/qwik-city/middleware/node`), your production start command will point to the built server entry, commonly something like: ```bash theme={null} node build/index.mjs ``` For purely static sites, you can use a server. ### Express libraary ### Serve library ## Additional Resources For more information about Qwik, visit the official documentation [here](https://qwik.builder.io/docs/). ## Troubleshooting # Hosting a React Application on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/react This article provides a complete guide to create and host a React application on Square Cloud. ## Introduction * Before you begin, make sure you have Node.js and npm installed on your system. If you don't have them yet, you can download them from the [official Node.js website](https://nodejs.org/). * Next, you will need to create an account on Square Cloud, which can be done through the [sign up page](https://squarecloud.app/en/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ### Creating a React Project To create a new React project, run the following command: ```bash theme={null} npx create-react-app my-react-app ``` In the above command, `my-react-app` is the name of your new project. You can replace `my-react-app` with any desired name for your project. `create-react-app` is a package available in the npm registry that sets up a new React project automatically. It takes care of all the initial setup, such as creating the project directory, installing necessary dependencies, and configuring basic files. ## Configuring the Production Environment with Serve After having your React project created and configured, it's time to prepare it for production. For this, we will use a library called `serve`. This library is a static server that can serve your React project after it has been built. ### Installing the Serve Library To install the `serve` library, navigate to your project directory in the terminal and run the following command: ```bash theme={null} npm install serve@14.2.3 ``` This command installs version `14.2.3` of the `serve` library. If you want to install the latest version, you can omit the `@14.2.3`. ### Configuring the Startup Script After installing the `serve` library, you need to configure your project's startup script to use `serve`. To do this, open your project's `package.json` file and add a new script called `start:prod`: ```json theme={null} "scripts": { "start": "react-scripts start", "start:prod": "serve -s build -l 80", ... } ``` In the `start:prod` script, `serve -s build -l 80` does the following: * `serve`: This is the command to start the `serve` server. * `-s build`: The `-s` option serves the `build` directory in single-page application mode. This means all not-found requests will be redirected to `index.html`. The `build` directory is created when you run `npm run build`. * `-l 80`: The `-l` option followed by `80` tells `serve` to listen on port 80. Port 80 is the default port for HTTP traffic. Now, when you want to start your project in production mode, you can run the `npm run start:prod` command. This command first builds your React project and then serves the built files using `serve` on port 80. ## Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Configuring the START Field In the Square Cloud configuration file, the `START` field is essential to customize the startup command. If you want to build and start your application on Square Cloud, configure the `START` field as follows: ```app squarecloud.app theme={null} START=npm run build && npm run start:prod ``` This command will execute the "build" and "start:prod" scripts defined in your `package.json`: ```json package.json theme={null} { "name": "my-react-app", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-scripts": "5.0.1", "serve": "^14.2.3", "web-vitals": "^2.1.4" }, "scripts": { "start": "react-scripts start", "start:prod": "serve -s build -l 80", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } } ``` ## Purchasing a Plan Before Uploading Your Project Before you can upload your project to Square Cloud, it's important to understand that you need to purchase a plan. The type of plan you choose will depend on the resources required by your application. You can view our plans [here](https://squarecloud.app/en/pricing). **Are you wondering how much RAM and CPU your plan needs to host a React website?** Don't worry, we're here to help. React is a JavaScript framework known for its speed and flexibility. It allows developers to build large web applications that can update and render efficiently in response to data changes. It's also relatively easy to learn, making it accessible for beginners. Our **[Standard](https://squarecloud.app/en/pricing)** plan offers **4GB** of RAM and **4vCPU**, which should be sufficient for most React websites. However, if you're working on a larger project or need more stability, we recommend considering our Pro plan. With additional resources, you can ensure smooth performance even under high demand. To purchase, simply click [here](https://squarecloud.app/en/pay?plan=pro). ## Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` ## Additional Resources For more information about React and its tools, visit the [official React documentation](https://react.dev/learn). There, you'll find detailed guides, tutorials, and API documentation to help you make the most of React. ## Troubleshooting # Professional Remix Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/remix Complete guide for developing and hosting fast and scalable Remix applications on Square Cloud. ## Professional Remix Application Development * Before starting, make sure you have **Node.js (>= 18.x)** and **npm** installed on your system. If you don't have them yet, download them from the [official Node.js website](https://nodejs.org/). * Next, you'll need to create an account on Square Cloud through the [sign up page](https://squarecloud.app/en/signup). * Finally, ensure your account has an active paid plan. You can view available plans and choose one that fits your project [here](https://squarecloud.app/en/pricing). ## Installing the Remix CLI To create and manage Remix applications, install the Remix CLI globally: ```bash theme={null} npm install -g create-remix ``` ## Creating a Remix Project Now create a new Remix project with: ```bash theme={null} create-remix myapp ``` Select the preferred deployment target.\ For Square Cloud, the **Node.js server** option is recommended. After creation, navigate into your project: ```bash theme={null} cd myapp ``` Install dependencies: ```bash theme={null} npm install ``` Start the development server: ```bash theme={null} npm run dev ``` This usually starts your application at `http://localhost:5173/`. ## Basic Route Example Remix routes are file-based.\ Here is a simple example of a route in: app/routes/\_index.tsx ```tsx theme={null} export default function Index() { return

Hello World from Remix!

; } ``` ## Configuring the START Field In the Square Cloud configuration file, the **START** field is optional and required only if your application demands a custom start command. For Remix applications, the typical start command is: ```bash theme={null} npm run start ``` Make sure your `package.json` contains: ```json theme={null} "scripts": { "start": "remix-serve build", "build": "remix build", "dev": "remix dev" } ``` ## Purchasing a Plan Before Uploading the Project Before uploading your project, ensure you have an active plan with enough CPU and RAM. Remix applications are lightweight and typically run well on the **Basic** or **Standard** plan, but heavier applications or APIs may benefit from the **Pro** plan. **Not sure how much RAM and CPU you need for Remix?** Remix is highly optimized and efficient, but resource usage depends on your backend logic and integration with databases or APIs. Standard plan is recommended for most real-world applications. ## Additional Resources For more information about Remix, check the official documentation [here](https://remix.run/docs). It includes comprehensive guides, tutorials, API references, and best practices. ## Troubleshooting # Professional Ruby on Rails Application Hosting on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/ruby-on-rails Complete guide for developing and hosting high-performance Ruby on Rails applications on Square Cloud. ## Professional Ruby on Rails Application Development * Before starting, make sure you have **Ruby (>= 3.x)**, **Bundler**, and **Rails** installed on your system.\ If you don’t have them yet, you can download Ruby from the [official Ruby website](https://www.ruby-lang.org/) and install Rails using Bundler. * Next, you'll need to create an account on Square Cloud, which can be done through the [signup page](https://squarecloud.app/en/signup).\ You can use your email to create an account. * Finally, you need to have an active paid plan on your account.\ You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ### Ruby on Rails Configuration To install Rails, run the following command: ```bash theme={null} gem install rails ``` This command installs the `rails` gem globally, allowing you to create and manage Rails applications. ### Creating a Ruby on Rails Project To create a new Rails project, run: ```bash theme={null} rails new myapp ``` This command generates a complete Ruby on Rails application structure.\ After creating your project, you can start the development server with: ```bash theme={null} cd myapp rails server -p 80 ``` Rails will start an HTTP server on port **80**, serving your application at the root route. ## Configuring the START Field In the Square Cloud, the **START** field is optional and only necessary if you are using a custom script to start the website or API. In this case, the command will be: ```bash theme={null} rails server -p 80 ``` ## Purchasing a Plan Before Uploading the Project Before uploading your project to Square Cloud, it is important to understand that you need to purchase a plan.\ The type of plan you choose will depend on the resources required by your application. You can view our plans [here](https://squarecloud.app/en/pricing). **Wondering how much RAM and CPU your plan needs to host a Ruby on Rails application?**\ Ruby on Rails is a full-featured MVC framework known for its productivity, conventions, and built-in tools. Because Rails is heavier than minimalist frameworks, we recommend the **[Standard](https://squarecloud.app/en/pay?plan=standard)** plan with **4GB RAM** and **4vCPU** for most applications.\ For larger or resource-intensive projects, consider upgrading to the **Pro** plan.\ To purchase, simply click [here](https://squarecloud.app/en/pay?plan=pro). ## Additional Resources For more information about Ruby on Rails and its tools, visit the [official Rails documentation](https://rubyonrails.org/).\ There, you will find guides, tutorials, and API references to help you deepen your knowledge. ## Troubleshooting # Hosting a Vite Application on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/vite This article guides you on creating and hosting a Vite application on Square Cloud. ## Introduction * Before you begin, make sure you have Node.js and npm installed on your system. If you don't have them yet, you can download them from the [official Node.js website](https://nodejs.org/). * Next, you will need to create an account on Square Cloud, which can be done through the [sign up page](https://squarecloud.app/en/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ### Creating a Vite Project To create a new Vite project, run the following command: ```bash theme={null} npm create vite@latest my-vite-app ``` In the above command, `my-vite-app` is the name of your new project. Replace it with any desired name for your project. By default, this command sets up a Vite project with JavaScript. ### Choosing a Specific Template Vite allows choosing different templates for your project. When creating a new project, you can specify the desired template using the `--template` option. Here are some examples: Select a template by: `react`, `vue` & `lit`. ```bash theme={null} # npm 7+, extra double-dash is needed: npm create vite@latest my-vite-app -- --template [template] ``` Choose the template that best suits your needs and adjust the project name as needed. ### Understanding the Difference Between JavaScript and TypeScript When you choose JavaScript, Vite configures the project with default JavaScript settings. On the other hand, when choosing TypeScript, Vite configures the project with TypeScript settings, including generating a `tsconfig.json` file. ## Configuring Port 80 Port 80 is the default port for HTTP traffic. To host a Vite application on Square Cloud, configure the use of port 80. In Vite, you can set the `--port 80` parameter in the startup script to ensure your application runs correctly on this port. ## Configuring Host 0.0.0.0 The `--host 0.0.0.0` option is used to bind the Vite server to all available network interfaces. This makes your application accessible not only on `localhost`, but also on external devices within the same network, such as other computers or mobile devices. By default, Vite binds to `localhost`, which restricts access to the machine where it's running. Setting the host to `0.0.0.0` allows the server to listen for incoming requests from any IP address. ## Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Configuring the START Field In the Square Cloud configuration file, the `START` field is essential to customize the startup command. If you want to build and start your Vite application on Square Cloud, configure the `START` field as follows: ```app squarecloud.app theme={null} START=npm run build && npm run preview ``` This command will execute the "build" and "preview" scripts defined in your `package.json`: ```json package.json theme={null} { "name": "my-vite-app", "private": true, "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview --host 0.0.0.0 --port 80" }, "devDependencies": { "vite": "^5.1.4" } } ``` ## Purchasing a Plan Before Uploading Your Project Before you can upload your project to Square Cloud, it's important to understand that you need to purchase a plan. The type of plan you choose will depend on the resources required by your application. You can view our plans [here](https://squarecloud.app/en/pricing). **Are you wondering how much RAM and CPU your plan needs to host a Vite website?** Don't worry, we're here to help. Vite is a modern front-end build tool that provides a faster and leaner development experience for modern web projects. It's designed to provide out-of-the-box support for ES modules, enabling instant server start-up and hot module replacement. Our **[Standard](https://squarecloud.app/en/pay?plan=standard)** plan offers **4GB** of RAM and **4vCPU**, which should be sufficient for most Vite websites. However, if you're working on a larger project or need more stability, we recommend considering our Pro plan. With additional resources, you can ensure smooth performance even under high demand. To purchase, simply click [here](https://squarecloud.app/en/pay?plan=pro). ## Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` ## Additional Resources For more information about Vite and its tools, visit the [official Vite documentation](https://vitejs.dev/guide/). There, you'll find detailed guides, tutorials, and API documentation to help you make the most of Vite. ## Troubleshooting # Hosting a Vue Application on Square Cloud Source: https://docs.squarecloud.app/en/tutorials/website/vue This article guides you on creating and hosting a Vue app on Square Cloud ## Introduction * Before you begin, make sure you have Node.js and npm installed on your system. If you don't have them yet, you can download them from the [official Node.js website](https://nodejs.org/). * Next, you will need to create an account on Square Cloud, which can be done through the [sign up page](https://squarecloud.app/en/signup). You can use your email to create an account. * Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs [here](https://squarecloud.app/en/pricing). ### Creating a Vue Project To create a new Vue project, run the following command: ```bash theme={null} npm create vue@latest ``` In this command, `npm create vue@latest` is used to create a new Vue project with the latest version of Vue. The `npm create` command is a tool that comes with `npm`, the Node.js package manager. It is used to initialize a new or existing npm package. `vue@latest` is a package available on the npm registry that sets up a new Vue project for you. It takes care of all the initial setup, such as creating the project directory, installing necessary dependencies, and configuring basic files. `@latest` is a tag specifying that you want to use the latest version of the `vue` package. This ensures you're always using the most updated version and, consequently, have access to the latest features. ## Configuring Port 80 Port 80 is the default port for HTTP traffic. To host a Vite app on Square Cloud, configure the use of port 80. In Vite, you can set the `--port 80` parameter in the startup script to ensure your app runs correctly on this port. ## Creating the squarecloud config file The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. ## Configuring the START Field In the Square Cloud configuration file, the `START` field is essential to customize the startup command. If you want to build and start your Vite app on Square Cloud, configure the `START` field as follows: ```app squarecloud.app theme={null} START=npm run build && npm run serve ``` This command will execute the "build" and "serve" scripts defined in your `package.json`: ```json package.json theme={null} { "name": "vue-project", "version": "0.0.0", "private": true, "type": "module", "scripts": { "dev": "vite", "build": "vite build", "serve": "vite preview --port 80" }, "dependencies": { "vue": "^3.4.21" }, "devDependencies": { "@vitejs/plugin-vue": "^5.0.4", "vite": "^5.2.8" } } ``` ## Purchasing a Plan Before Uploading Your Project Before you can upload your project to Square Cloud, it's important to understand that you need to purchase a plan. The type of plan you choose will depend on the resources required by your application. You can view our plans [here](https://squarecloud.app/en/pricing). **Are you wondering how much RAM and CPU your plan needs to host a Vue.js website?** Don't worry, we're here to help. Vue.js is a progressive JavaScript framework known for its adaptability and simplicity. It's designed to be incrementally adoptable, making it easy for developers to start small and scale up as needed. Vue.js also emphasizes a declarative rendering and component-oriented approach, making it intuitive to build modern web interfaces. Our **[Standard](https://squarecloud.app/en/pay?plan=standard)** plan offers **4GB** of RAM and **4vCPU**, which should be sufficient for most Vue.js websites. However, if you're working on a larger project or need more stability, we recommend considering our Pro plan. With additional resources, you can ensure smooth performance even under high demand. To purchase, simply click [here](https://squarecloud.app/en/pay?plan=pro). ## Uploading Project to Square Cloud After preparing your project files, you can now upload them to Square Cloud and host your project. Access the [Square Cloud Dashboard](https://squarecloud.app/en/upload) and upload your project files. First, you need to have the CLI installed in your environment. If you don't have it yet, run the following command in your terminal: ``` npm install -g @squarecloud/cli ``` If you already have it, we recommend updating it. To do this, run the following command in your terminal: ```bash theme={null} squarecloud update ``` ```bash theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` Now, to authenticate and use other CLI commands, you will find your authorization key [here](https://squarecloud.app/en/account/security) by clicking on "Request API Key". After obtaining your authorization key, run the following command: ```bash theme={null} squarecloud auth login ``` Finally, to deploy your application to Square Cloud using the CLI, you need to execute the following command, passing the path of your zip file: ```bash theme={null} squarecloud upload zip ``` ## Additional Resources For more information about Vue and its tools, visit the [official Vue documentation](https://vuejs.org/). There, you'll find detailed guides, tutorials, and API documentation to help you make the most of Vue. ## Troubleshooting # Get Current Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/deploy/info GET https:/api.squarecloud.app/v2/apps/{app_id}/deployments/current Get the current deployment information for an application. The ID of the application. You can find this in the URL of your application's dashboard. ### Response The contents of the response. The webhook URL for the application. ```json Webhook theme={null} { "status": "success", "response": { "webhook": "https://api.squarecloud.app/v2/git/webhook/69ce71f11974f2cc21d47cd0a8bcbafdaacbc3c9924b23ca40e0e2032705f6391eb89b40983338e0f2415e9331d602ccc" } } ``` ```json Integration theme={null} { "status": "success", "response": { "app": { "id": "00000000", "name": "Your-GitHub/Repository", "branch": "main" } } } ``` # List Deployments Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/deploy/list GET https:/api.squarecloud.app/v2/apps/{app_id}/deployments Get the last 10 deployments of an application from the last 24 hours. The ID of the application. You can find this in the URL of your application's dashboard. ### Response The contents of the response. The ID of the deploy. The state of the deploy. Can be `pending`, `clone`, `success`, or `error`. The date the deploy was created. ```json theme={null} { "status": "success", "response": [ [ { "id": "git-393caedd68f5e5b771f6a027", "state": "pending", "date": "2023-10-16T20:27:20.513Z" }, { "id": "git-393caedd68f5e5b771f6a027", "state": "clone", "date": "2023-10-16T20:27:20.536Z" }, { "id": "git-393caedd68f5e5b771f6a027", "state": "success", "date": "2023-10-16T20:27:21.422Z" } ] ], } ``` # Set GitHub Webhook Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/deploy/webhooks POST https:/api.squarecloud.app/v2/apps/{app_id}/deploy/webhook Integrate Square Cloud with GitHub webhooks. The ID of the application. You can find this in the URL of your application's dashboard. The access token for your GitHub repository. You can find this in your [GitHub Tokens Classic](https://github.com/settings/tokens/new) ### Response A message indicating the status of the commit. The contents of the response. The URL of the webhook. ```json theme={null} { "status": "success", "response": { "webhook": "https://api.squarecloud.app/v2/git/webhook/" }, } ``` # Delete File Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/delete DELETE https://api.squarecloud.app/v2/apps/{app_id}/files Delete a file from your application. The ID of the application. You can find this in the URL of your application's dashboard. The path of the file to delete. ### Response ```json theme={null} { "status": "success" } ``` # Move File Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/patch PATCH https://api.squarecloud.app/v2/apps/{app_id}/files Move a file in your application. The ID of the application. You can find this in the URL of your application's dashboard. The path of the file to move. The path to move the file to. ### Response ```json theme={null} { "status": "success" } ``` # Create/Modify File Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/filemanager/put PUT https://api.squarecloud.app/v2/apps/{app_id}/files Create files in your application. The ID of the application. You can find this in the URL of your application's dashboard. The path where the file should be created. Example: /test.txt The content of the file to be created. ### Response ```json theme={null} { "status": "success" } ``` # Website Analytics Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/network/analytics GET https://api.squarecloud.app/v2/apps/{app_id}/network/analytics Get analytics for a website hosted on Square Cloud. There is a rate limit of 1 uncached request every 10 seconds. The ID of the application. You can find this in the URL of your application's dashboard. Time range for the analytics data. It can be `daily` or `weekly`. Default is `daily`. ### Response This route can send a response in a compressed format, optimizing data transmission. Check the Response Example in right side to see the full response. ```json theme={null} { "status": "success", "response": { "visits": [ { "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ], "countries": [ { "type": "BR", "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ], "devices": [ { "type": "desktop", "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ], "os": [ { "type": "Windows", "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ], "browsers": [ { "type": "Chrome", "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ], "protocols": [ { "type": "https", "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ], "methods": [ { "type": "GET", "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ], "paths": [ { "type": "/", "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ], "referers": [ { "type": "https://google.com", "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ], "providers": [ { "type": "Cloudflare", "visits": 1, "requests": 4, "bytes": 9677, "date": "2025-05-31T18:45:00Z" } ] } } ``` # Set Custom Domain Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/network/custom POST https://api.squarecloud.app/v2/apps/{app_id}/network/custom Integrate your website with a custom domain. It has a rate limit of 1 request every 60 seconds. **Is necessary to have at least the [Standard plan](https://squarecloud.app/en/pricing) to use this route.** The ID of the application. You can find this in the URL of your application's dashboard. The custom domain you want to use. ### Response ```json theme={null} { "status": "success" } ``` # Get DNS Records Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/network/dns GET https://api.squarecloud.app/v2/apps/{app_id}/network/dns Get the DNS records for your custom domain. **Is necessary to have at least the [Standard plan](https://squarecloud.app/en/pricing) to use this route.** The ID of the application. You can find this in the URL of your application's dashboard. ### Response The contents of the response. The type of the DNS record. The name of the DNS record. The value of the DNS record. The status of the DNS record. It can be `pending_validation`, `pending` or `active`. ```json theme={null} { "status": "success", "response": [ { "type": "txt", "name": "_acme-challenge.joaootavios.dev", "value": "hmo-jMx_KCWQU5CWG6xmrkI4AOZOJXlQtjEtc7zI1PA", "status": "pending_validation" }, { "type": "cname", "name": "joaootavios.dev", "value": "custom.squarecloud.app", "status": "pending" } ] } ``` # Purge Cache Source: https://docs.squarecloud.app/en/api-reference/endpoint/apps/network/purge_cache POST https://api.squarecloud.app/v2/apps/{app_id}/network/purge_cache Purge the global cache of the application on the Edge. Has a rate limit of 1 request every 60 seconds. The ID of the application. You can find this in the URL of your application's dashboard. ### Response ```json theme={null} { "status": "success" } ``` # Add Application Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/apps/add POST https://api.squarecloud.app/v2/workspaces/applications Add an application into the workspace. The ID of the workspace. The ID of the application. You can find this in the URL of your application's dashboard. ### Response ```json theme={null} { "status": "success" } ``` # Remove Application Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/apps/remove DELETE https://api.squarecloud.app/v2/workspaces/applications Removes an application from the workspace. The ID of the workspace. The ID of the application. You can find this in the URL of your application's dashboard. ### Response ```json theme={null} { "status": "success" } ``` # Create Workspace Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/create POST https://api.squarecloud.app/v2/workspaces Create a new workspace into your Square Cloud account. A string representing the name of the workspace. (without extension)
Must adhere to the a to z, A to Z, 0 to 9, and \_ pattern. (3 to 32 characters)
### Response The contents of the response. The ID of the Workspace. The Workspace owner id. The name of the Workspace. The creation timestamp in UTC-0. ```json theme={null} { "status": "success", "response": { "id": "dcedcd13d7e272a7b32a70f6a1d180f23c12d759", "owner": "5354d9742d889d49b20134ba0be09ccc0033be68", "name": "Test", "createdAt": "2025-06-04T20:44:55.934Z" } } ``` # Delete Workspace Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/delete DELETE https://api.squarecloud.app/v2/workspaces Delete the workspace. The ID of the workspace. ### Response ```json theme={null} { "status": "success" } ``` # Get Workspace Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/get GET https://api.squarecloud.app/v2/workspaces/{workspaceId} Get workspace info. ### Response The contents of the response. The ID of the Workspace. The Workspace owner id. The name of the Workspace. The workspace member list. The user's ID. The user's name. The member permissions on the workspace applications. The join timestamp in UTC-0. The workspace applications list. The ID of the uploaded application. The name of the uploaded application. The RAM usage of the uploaded application in MB. The programming language of the uploaded application. The creation timestamp in UTC-0. ```json theme={null} { "status": "success", "response": { "id": "dcedcd13d7e272a7b32a70f6a1d180f23c12d759", "name": "Test", "owner": "5354d9742d889d49b20134ba0be09ccc0033be68", "members": [ { "name": "Example", "id": "5354d9742d889d49b20134ba0be09ccc0033be68", "group": "owner", "joinedAt": "2025-06-04T20:44:55.934Z" } ], "applications": [], "createdAt": "2025-06-04T20:44:55.934Z" } } ``` # Leave Workspace Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/leave DELETE https://api.squarecloud.app/v2/workspaces/leave Leave from workspace. The ID of the workspace. ### Response ```json theme={null} { "status": "success" } ``` # List Workspaces Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/list GET https://api.squarecloud.app/v2/workspaces Gets a list of your workspaces info. ### Response The contents of the response. The ID of the Workspace. The Workspace owner id. The name of the Workspace. The workspace member list. The user's ID. The user's name. The member permissions on the workspace applications. The join timestamp in UTC-0. The workspace applications list. The ID of the uploaded application. The name of the uploaded application. The RAM usage of the uploaded application in MB. The programming language of the uploaded application. The creation timestamp in UTC-0. ```json theme={null} { "status": "success", "response": [ { "id": "dcedcd13d7e272a7b32a70f6a1d180f23c12d759", "name": "Test", "owner": "5354d9742d889d49b20134ba0be09ccc0033be68", "members": [ { "name": "Example", "id": "5354d9742d889d49b20134ba0be09ccc0033be68", "group": "owner", "joinedAt": "2025-06-04T20:44:55.934Z" } ], "applications": [], "createdAt": "2025-06-04T20:44:55.934Z" } ] } ``` # Get Invite Code Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/members/code GET https://api.squarecloud.app/v2/workspaces/members/code Get your invite code to add you into an workspace. ### Response Your team invite code. ```json theme={null} { "status": "success", "code": "9c1a499e623d2410226f1ecdc7e6daaec2fc6704" } ``` # Invite Member Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/members/invite POST https://api.squarecloud.app/v2/workspaces/members Invites someone to an workspace. The ID of the workspace. A string with the member invite code. The member permissions on the workspace applications ### Response ```json theme={null} { "status": "success" } ``` # Remove Member Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/members/kick DELETE https://api.squarecloud.app/v2/workspaces/members Removes a workspace member from the workspace. The ID of the workspace. The member ID. ### Response ```json theme={null} { "status": "success" } ``` # Change Permissions Source: https://docs.squarecloud.app/en/api-reference/endpoint/workspace/members/perms PATCH https://api.squarecloud.app/v2/workspaces/members Changes workspace member permissions. The ID of the workspace. The member ID. The member permissions on the workspace applications. ### Response ```json theme={null} { "status": "success" } ``` # Authentication Source: https://docs.squarecloud.app/en/blob-reference/authentication Learn what it takes to authenticate to the Square Cloud API. First you need to get an API key from the [Developer Dashboard](https://squarecloud.app/en/account/security). You can use this API key to authenticate to the Square Cloud API. ```bash theme={null} 'Authorization': '' ``` ## API Usage You can use the API key to authenticate to the Square Cloud API. You can use the API key in the `Authorization` header. Remembering that the use of the API is subject to the [Terms of Service](https://squarecloud.app/legal) and the [Acceptable Use Policy](https://squarecloud.app/legal/policy). Learn about the limits and restrictions of the Square Cloud API. # Blob Delete Objects Source: https://docs.squarecloud.app/en/blob-reference/endpoint/delete DELETE https://blob.squarecloud.app/v1/objects This documentation provides a comprehensive overview of the DELETE /v1/objects endpoint of the SquareCloud Blob API. The name of the object to delete. The object name must adhere to the following pattern: `a to z, A to Z, 0 to 9, and _`. ```json theme={null} { "object": "ID/prefix/name1_ltq7b2sw-de6241.jpeg" } ``` ### Response Indicates whether the call was successful. "success" if successful, "error" if not. ```json theme={null} { "status": "success", } ``` ### Troubleshooting ### Object-Related ```json INVALID_OBJECT theme={null} // The provided object name is invalid. { "status": "error", "code": "INVALID_OBJECT" } ``` ```json FAILED_DELETE theme={null} // The request to delete the objects failed. Please try again. { "status": "error", "code": "FAILED_DELETE" } ``` ### Unauthorized ```json ACCESS_DENIED theme={null} // Just set the correct API key in the Authorization header. { "status": "error", "code": "ACCESS_DENIED" } ``` ### Unauthorized ```json OBJECT_NOT_FOUND theme={null} // The object you are trying to delete does not exist. { "status": "error", "code": "OBJECT_NOT_FOUND" } ``` # Blob Object List Source: https://docs.squarecloud.app/en/blob-reference/endpoint/list GET https://blob.squarecloud.app/v1/objects This documentation provides a comprehensive overview of the GET /v1/objects endpoint of the SquareCloud Blob API. A string representing the prefix for the file.
Must adhere to the a to z, A to Z, 0 to 9, and \_ pattern. (3 to 32 characters)
A string representing the continuation token for the file list. (1000 objects per page) ### Response Indicates whether the call was successful. "success" if successful, "error" if not. The id of the object. The size of the object in bytes. The date and time the object was created. The date and time the object will expire. ```json Response - [30s cache] theme={null} { "status": "success", "response": { "objects": [ { "id": "ID/name1_ltq7b2sw-de6241.jpeg", "size": 78266, "created_at": "2024-03-13T19:31:28.776Z" }, { "id": "ID/name_ltq7b2sw-de6243-ex1.jpeg", "size": 90466, "created_at": "2024-03-13T19:35:28.776Z", "expires_at": "2024-03-14T19:35:28.776Z" }, ] } } ``` ### Troubleshooting ### Object-Related ```json INVALID_PREFIX theme={null} // The provided object prefix is invalid. // Must adhere to the a to z, A to Z, 0 to 9, and _ pattern. { "status": "error", "code": "INVALID_OBJECT_PREFIX" } ``` ### Unauthorized ```json ACCESS_DENIED theme={null} // Just set the correct API key in the Authorization header. { "status": "error", "code": "ACCESS_DENIED" } ``` # Blob Object Post Source: https://docs.squarecloud.app/en/blob-reference/endpoint/post POST https://blob.squarecloud.app/v1/objects This documentation provides a comprehensive overview of the POST /v1/objects endpoint of the SquareCloud Blob API. Use FormData. (multipart/form-data) A string representing the name of the file. (without extension)
Must adhere to the a to z, A to Z, 0 to 9, and \_ pattern. (3 to 32 characters)
A string representing the prefix for the file.
Must adhere to the a to z, A to Z, 0 to 9, and \_ pattern. (3 to 32 characters)
A number indicating the expiration period of the file, ranging from 1 to 365 days. Set to true if a security hash is required. Set to true if the file should be set for automatic download. ### Response Indicates whether the call was successful. "success" if successful, "error" if not. The ID of the uploaded file. The name of the uploaded file. The size of the uploaded file, in bytes. The URL of the uploaded file. (File distributed in Square Cloud CDN) ```json theme={null} { "status": "success", "response": { "id": "3155597145698959364/test_lxch4k7y-07ee.png", "name": "test", "size": 416230, "url": "https://public-blob.squarecloud.dev/3155597145698959364/test_lxch4k7y-07ee.png" } } ``` ### Troubleshooting ### Object-Related ```json NAME theme={null} // The provided object name is invalid. // Must adhere to the a to z, A to Z, 0 to 9, and _ pattern. { "status": "error", "code": "INVALID_OBJECT_NAME" } ``` ```json PREFIX theme={null} // The provided object prefix is invalid. // Must adhere to the a to z, A to Z, 0 to 9, and _ pattern. { "status": "error", "code": "INVALID_OBJECT_NAME" } ``` ```json EXPIRE theme={null} // The provided expiration value for the object is invalid. // Must be a number ranging from 1 to 365. (value in days). { "status": "error", "code": "INVALID_OBJECT_EXPIRE" } ``` ```json SECURITY_HASH theme={null} // The provided security hash boolean is invalid. // Just set to true or false. 😅 { "status": "error", "code": "INVALID_OBJECT_SECURITY_HASH" } ``` ```json AUTO_DOWNLOAD theme={null} // The provided auto-download boolean is invalid. // Just set to true or false. 😅 { "status": "error", "code": "INVALID_OBJECT_AUTO_DOWNLOAD" } ``` ### File-Related The current maximum file size is 100MB. In the future, we plan to increase it to 10GB. For now, the limit is 100MB due to technical and load-balancing constraints. ```json INVALID_FILE theme={null} // The provided file is invalid. { "status": "error", "code": "INVALID_FILE" } ``` ```json FILETYPE theme={null} // The provided file type is invalid. { "status": "error", "code": "INVALID_FILETYPE" } ``` ```json FILE_TOO_SMALL theme={null} // The file size is too small (< 1kb). { "status": "error", "code": "FILE_TOO_SMALL" } ``` ```json FILE_TOO_LARGE theme={null} // The file size is too large (> 100mb). { "status": "error", "code": "FILE_TOO_LARGE" } ``` ### Unauthorized ```json ACCESS_DENIED theme={null} // Just set the correct API key in the Authorization header. { "status": "error", "code": "ACCESS_DENIED" } ``` # Blob Account Stats Source: https://docs.squarecloud.app/en/blob-reference/endpoint/stats GET https://blob.squarecloud.app/v1/account/stats This documentation provides a comprehensive overview of the GET /v1/stats endpoint of the SquareCloud Blob API. Status updates every 1 minute. ### Response Indicates whether the call was successful. "success" if successful, "error" if not. The total number of objects in your account. The total size of all objects in your account, in bytes. The total storage size included on the plan, in bytes. The extra space used, in bytes. The total price of storage for all objects in your account, in BRL. The total price of all objects in your account, in BRL. The total price of all objects in your account, in BRL. ```json Response - [1m cache] theme={null} { "status": "success", "response": { "usage": { "objects": 0, "storage": 0 }, "plan": { "included": 0 }, "billing": { "extraStorage": 0, "storagePrice": 0, "objectsPrice": 0, "totalEstimate": 0 } } } ``` ### Troubleshooting ### Unauthorized ```json ACCESS_DENIED theme={null} // Just set the correct API key in the Authorization header. { "status": "error", "code": "ACCESS_DENIED" } ``` # Changelog Source: https://docs.squarecloud.app/en/changelog Discover the latest news and improvements in Square Cloud. Follow product releases, performance optimizations, and much more. ## 🚀 Black Friday, MySQL, Articles and Globalization! Today we're launching an update focused on tooling improvements, globalization of several areas, and enhanced overall platform usability. And there's more: the **only promotion of the year** is now live! ### 🎉 Black Friday — THE ONLY 2025 PROMOTION **Annual discount DOUBLED: 30% OFF** on any renewal, upgrade, or first purchase on the annual plan. Discounted pricing examples: (values in BRL) * **Standard T1:** from **34,90** to **24,43** month * **Pro T1:** from **100** to **70** month Take advantage of this exclusive opportunity to save and scale your projects on Square Cloud! ### ✨ Dashboard styling overhaul and bug fixes We completely redesigned the platform navigation, making several areas more accessible and modern: * Redesigned navigation to facilitate access to important features. * Optimizations to improve the experience for developers who rely on screen readers. * New rendering logic across much of the website, making everything more dynamic and faster. * Improved visualization of what gets removed when downgrading a plan. * Semiannual option removed — we now offer only two clearer and easier-to-understand options (monthly and annual). * Fixed several bugs that impacted navigation. * Improved compatibility with legacy browsers. ### 🛠️ Deploy experience improvements + new Database We expanded database support and optimized the deployment process: * **MySQL v9:** Now available and optimized for production. * **Elixir:** Runtime issues fixed + updated to version **1.19.2**. * Implemented more aggressive limits on file viewing via File Manager API (no more trying to view a 1GB file 😊). * Fixed a Git integration issue that caused higher-than-expected latency: * Listing reduced to the last 5 deploys. * Improved error notifications in responses. * **\~14ms global reduction** in deploys with the new architecture. * Fixed error that prevented viewing the Snapshots tab in some workspaces. * Fixed bug that imported empty environment variable when deploying with a partially invalid file. ### 📚 New articles and tutorials We added comprehensive guides to facilitate deployment of different frameworks and technologies: * **Angular:** [How to deploy an Angular project](https://docs.squarecloud.app/en/tutorials/website/angular) * **AstroJS:** [How to deploy an AstroJS project](https://docs.squarecloud.app/en/tutorials/website/astrojs) * **Nuxt:** [How to deploy a Nuxt project](https://docs.squarecloud.app/en/tutorials/website/nuxt) * **Gatsby:** [How to deploy a Gatsby project](https://docs.squarecloud.app/en/tutorials/website/gatsby) * **Laravel:** [How to deploy a Laravel API](https://docs.squarecloud.app/en/tutorials/api/laravel) * **Spring Boot:** [How to deploy a Spring Boot API](https://docs.squarecloud.app/en/tutorials/api/spring-boot) These tutorials cover everything from initial configuration to complete deployment, helping you get your projects live quickly. ### 🌍 Globalization and general improvements We continue expanding and improving the platform's international experience, with focus on accessibility, performance, and communication clarity. These are just some of the new features! We continue listening to the community and working daily to make Square Cloud even better. ## What's new and improvements (11/06/2025) We shipped an important set of usability, media-preview and runtime infrastructure improvements — all designed to speed up your workflows and make the platform friendlier for everyone, from trial users to high-traffic teams. ### Improved dashboard for users without an active plan The dashboard now offers a warmer, more informative experience for users who don't have an active plan. The UI highlights recommended actions (start a deploy, connect a repository, redeem credits), with clearer navigation and panels focused on what new users need most. ### Enhanced Blob previews The Blob page now lets you preview images and videos directly in the browser without downloading them. This makes content inspection faster, speeds up validations and reduces the time spent debugging multimedia assets. ### Dynamic application listing Application lists now adapt automatically to the user's screen height, making better use of vertical space on large monitors and providing a consistent experience across devices. ### Better empty states Sections such as "Applications" and "Databases" received redesigned empty states: clearer messaging, suggested next steps and helpful CTAs that make the first-time experience more guided and actionable. ### Plan downgrade now available You can now downgrade your plan directly from the **My Account** tab — fully automated, secure and transparent, with confirmation steps and an audit history. ### Export environment variables We added a one-click export button in the **Environment Variables** panel. Download all your variables in common formats (dotenv / JSON) for backups or fast migration between projects. ### GitHub upload with automatic configuration When uploading from GitHub the platform will attempt to auto-detect and configure the repository (package manager, start command, build scripts), reducing configuration errors and accelerating the first deploy. ### Search button in the file editor We implemented a native search button in the file editor optimized for mobile devices — making it easier to find code snippets directly from your phone. ### Global rate limit display fixed > We fixed an issue that in some scenarios caused a client-side exception when displaying the global rate limit. The UI is now stable and resilient. ### Website now uses the React Compiler We migrated the site to the React Compiler, improving rendering performance, reducing TTFB and making navigation smoother on pages with dynamic content. ### Snapshot filename format standardized Snapshot download filenames are now standardized to include app name, timestamp and app id for easier organization and traceability. New pattern: ``` _2025-12-31_12-59-59_.zip ``` ### Detailed plan comparison The **Pricing** page has been redesigned with a visual comparison of tiers. It's now easier to understand limits, benefits and pick the plan that fits your needs. ## Environment updates We updated and expanded runtime and language support: * **Ruby \[New runtime]** * Available for production workloads. * `recommended`/`latest`: **3.4.7**. * **Java \[Gradle & Maven support]** * `recommended`/`latest`: **JDK 25**. * **Node.js** * `recommended`: **v24.11.0** (LTS) — now adopted as default. * `latest`: **v25.1.0** — supported; in tests we observed up to **\~40% web-performance gains** in specific scenarios. * *Note: Node 25 is recommended for performance-focused workloads — test before migrating production.* * **Python** * `recommended`: **3.13.9**. * `latest`: **3.14.0**. * **C# (ASP.NET)** — `recommended`/`latest`: **9.0.10**. * **Elixir** * `recommended`/`latest`: **1.91.1**. * **Rust** * `recommended`/`latest`: **1.91.0**. * **PHP** * `recommended` & `latest`: **8.4.14**. * **Go** * `recommended` & `latest`: **1.25.4**. Notes: Ruby support was implemented in this release; Java now supports Gradle and Maven projects. Node 24 LTS is the default runtime; Node 25 is available for users who need extra performance. ## Fixes & minor adjustments * UX refinements across panels and modals (multiple friction points reduced). * Snapshot filename normalization and download improvements. * Small fixes in GitHub upload flow and repository auto-validation. * Blob now validates available capacity faster for large uploads. These updates are rolling out gradually. We're listening to the community and prioritizing changes that directly boost your productivity. ## Upload and GitHub Integration Redesign We have focused our efforts on revolutionizing the deployment and GitHub integration experience, bringing significant improvements that make the workflow simpler, more modern, and efficient. Check out the main new features that are now available: ### New Upload Experience We've created a completely rethought upload experience for modern developers. * **New upload page:** We now have a page dedicated exclusively to uploads, completely redesigned to offer a simpler, more modern, and intuitive experience. * The upload page is now available at `/upload` instead of `/dashboard/upload`. In addition to convenience, this change contributes to the site's SEO, making the upload page public and improving its indexing in search engines. ### Revolutionized GitHub Integration We have drastically simplified the process of integrating with GitHub repositories. * **Upload via GitHub (without an access token):** We've made the repository integration process even easier. You can now upload directly from GitHub without needing to manually enter an access token. * **Full integration with GitHub repositories:** You can connect your GitHub repository directly to your application, simplifying the deployment flow and making automation even more practical and secure. * **Direct connection with your GitHub account:** Connecting to GitHub is now even easier: just authenticate with your account to enjoy all integration features in a centralized and transparent way. * **Login via GitHub:** In addition to connecting for integrations, you can now use your own GitHub account to log in or create an account on our platform, making the authentication process fast, secure, and hassle-free. ### UI and SEO Improvements We have enhanced the platform's visual experience and online presence. * **Complete redesign of the "My Account" tab:** The profile and settings section has undergone a complete redesign, featuring a cleaner, more modern, and organized interface, allowing you to manage your information more simply. * **Website SEO improvement:** In addition to the new route, the site has undergone technical and content adjustments aimed at search engine optimization, ensuring better indexing performance and greater visibility on Google. ### Enhanced VSCode Extension We have improved the development experience directly from your favorite editor. * **Improved extension loading:** We have optimized the loading process of the VSCode extension, making initialization faster and more efficient for a smoother development experience. ### Modernized Snapshot System We have completely replaced the previous system with a more advanced solution. * **Complete migration from backups to snapshots:** The old backups have been replaced by the snapshot system, offering greater efficiency, faster restoration speeds, and better management of your application's version history. ### Modernized Tax Invoice System We have updated our fiscal infrastructure for greater compatibility and efficiency. * **Migration to the new ISSNet from the Goiânia City Hall:** Our electronic service tax invoice (NFSe) system has been completely migrated to use the new ISSNet from the Goiânia City Hall, ensuring greater stability, compliance, and agility in issuing service tax invoices. ### PHP + Swoole Improved Swoole support has been launched in conjunction with PHP version 8.4.12. ### Critical Fixes We have resolved important issues that affected file integrity. * **Fix in the file upload and compression process:** We identified and corrected a bug that affected the recompression of files uploaded through the platform. In some specific cases, this flaw resulted in the generation of corrupted binary files after the upload. The process has now been fully adjusted and validated to ensure that all files are stored and distributed with integrity and reliability, eliminating the risk of inconsistencies. These improvements represent a significant milestone in the evolution of Square Cloud, solidifying our position as **the most modern and intuitive platform for the new generation of developers.** ## EVEN MORE affordable plan and + DISCOUNTS! We continue our mission to listen to you and optimize every detail of the platform. We have gathered a series of **performance improvements, new features, and quality of life adjustments** that are already available and will boost your development experience. Check out what we have prepared: ## New Hobby plan and discounts = Square Cloud listening to you. Following the philosophy of going **against the market**, we brought more advantages for your pocket. * **Real-Time Downgrade:** We launched the new **instant downgrade** system. No waiting, no bureaucracy, you have full control of your plan. * **New Affordable Hobby Plan:** We introduced the Hobby plan with two tiers, with prices starting at **R\$ 8.49/month** on the annual cycle. * **MORE DISCOUNTS, BECAUSE YOU DESERVE IT:** We increased the discounts! Now it's **10% for the semiannual plan** and **15% for the annual plan**. ### Performance and speed optimizations We made everything even faster so you can focus on what matters: your code. * **Instant sync:** When updating RAM, the CPU is now adjusted in real time, with no delay. * **Ultra-fast realtime:** We reduced latency in primary loads, with an average improvement of 45ms. - We improved loading speed when interacting with bots and sites hosted on the platform. ### More control and flexibility for Your Account We upgraded customization tools so you have total autonomy. * **Editable subdomain and runtime:** Now you can edit your subdomain (`.squarecloud.app` and `.config`) and set the `RUNTIME` (javascript, typescript, etc.) directly in the application. (documentation for the `RUNTIME` field will be released soon). * **New "My Account" page and language:** Manage your information on a redesigned page and change the region/language to receive standardized emails. - We increased the limit to up to 3 username changes per day for your Square Cloud account. ### Experience and interface improvements We refined the interface for a cleaner and more productive workflow. * **Completely rewritten Logs tab:** The tab has been redesigned, including realtime, and now allows you to **delete all old records with a single click**. * **More intuitive dashboard:** We added icons for each language in the dashboard, making it easier to identify your applications. - We fixed an error that permanently redirected cookies to the login page in some cases. ### General Platform Adjustments * The API now returns the status `CONTAINER_TEMPORARILY_SUSPENDED` in cases of request abuse to ensure stability. * Inactive workspaces of users without active plans are now removed within 24 hours. These are just **some** of the new features we implemented with you in mind. Our commitment is to keep listening to the community and evolving to be **the best and most complete platform for the new generation of developers.** ## New Documentation in PT-BR and PostgreSQL Support! Once again, we listened to the community and brought some really cool news, focusing on improving the developer experience on our platform. It's time to present a series of improvements — some have been available for a few days, but may have gone unnoticed. Check them out below: ### Completely Renewed Documentation in Portuguese We created top-notch documentation, designed for Brazilian developers. * 100% in Portuguese (BR): Not a translation, but fully localized content, including images and tutorials. * Comprehensive Content: New guides, tutorials for specific scenarios, and detailed information about the platform. Check it out: **[https://docs.squarecloud.app/pt-br/getting-started/overview](https://docs.squarecloud.app/pt-br/getting-started/overview)** ### Enterprise-Scale PostgreSQL Support Create your PostgreSQL database with professional-level performance and security. * No limit on outbound and inbound network transfer. * Generous IOPS with NVME Enterprise. * Exclusive peer-to-peer certificate per database (mTLS). * Dedicated memory and CPU according to the plan. * Smart daily snapshots. * MySQL will be available in the coming days. * Square Cloud does not launch services that are not ready for production. ### Faster Snapshots We optimized the performance and stability of our backup system. * Performance: We doubled the internal bandwidth, processing up to 1,000 snapshots per minute. * Instant and free restoration of any snapshot from the last 30 days. ## Environment Update We are always improving our services to ensure you have access to the latest and most stable versions of the main programming languages. Check out what's new in this update! ### **New versions available:** * **JavaScript \[Node.js]** → Recommended: 22.18.0 | Latest: 24.5.0 * **Python** → Recommended: 3.13.6 | Latest: 3.13.6 * **Elixir** → Recommended: 1.18.4 | Latest: 1.18.4 * **Rust** → Recommended: 1.89.0 | Latest: 1.89.0 * **Go** → Recommended: 1.24.6 | Latest: 1.24.6 * **PHP** → Recommended: 8.4.11 | Latest: 8.4.11 \-- Improved support for Redis & MongoDB, with native support for the C-written library for Redis. What does this mean for you? * More stability and compatibility with modern applications. The updates are already available. 😄 ## General Platform Improvement (LOTS OF AMAZING NEWS!) Recently, we focused our efforts on **revolutionizing** the developer experience on our platform. It's time to present a series of **powerful new features** — some have been available for a few days, but may have gone unnoticed. Check out the improvements already live below: ### 100% Integrated Environment Variables * Now you can set environment variables directly via deploy or API. * Variables are automatically injected with a simple **restart** of the application. No need to use `.env` or extra packages! * Public routes available for **POST, PUT, DELETE, and GET** of variables. ### New Snapshot System (goodbye, manual backups) * Extremely generous limits: each plan can generate `(RAM / 256) * 2` snapshots per day. E.g.: Hobby plan with 2048MB = **16 daily snapshots** or up to **480/month**! * **Instant and FREE restoration** — recover any snapshot from the last 30 days in seconds. (gradual release for everyone in the coming days) * Square is going **against the market**: no charges, no hassle. ### Real-Time Configurable Start * Forget redeploying just to change the start script (START field in your config file). * Now you can **edit the START line directly**, restart the app, and that's it. All in real time and hassle-free. ### Advanced Databases (Redis & Mongo available!) * Create your real database with just 1 click. * **Exclusive peer-to-peer certificate** per database (no generic certificates). (mTLS) * RAM and processing from your plan, with total dedicated performance for the database. * 10GB of enterprise storage included with future expansion plans. * **Daily and automatic snapshots**. * **Intelligent and proactive snapshot system**: detects suspicious deletions and creates emergency backup (beta). * No bandwidth limitation and up to **512 simultaneous connections** per database. * Certificate and password reset in **one click**. * Databases already available: **Redis** and **MongoDB** — new databases coming soon! ### Faster and Smoother Dashboard * New "Settings" tab inside an application. * Deploys tab moved to Settings → Deploys. * Dedicated Environment Variables panel (Settings → Environment Variables). * Settings page now segmented into **5 sections** for easier navigation: General, Deploys, Environment Variables, Network, and Risk Zone. * New Pricing page and new page about Square Cloud Enterprise infrastructure and its exclusive plans (/enterprise). * New Analytics tab (viewing new data and interactive charts), with extremely accurate and improved insights for websites hosted on Square Cloud. * New application upload, more fluid and beautiful, with automatic detection of environment variables via .env file or internal context (automatic import). Oh, you can also paste variables using Ctrl+C and Ctrl+V. * The API now returns realtime records with surgical precision since the application start. These are just **some** of the improvements we are releasing for you. We keep listening to the community and working daily to make Square Cloud **the best platform for next-generation developers.** Note: we have greatly reduced and compacted the release notes, changed a lot in recent weeks, and focused on improving your experience. Thanks to everyone who participated or participates in our early access or beta test programs. @everyone ## General Security and Performance Update Recently, we have focused our efforts on improving the performance of some critical Square Cloud services. ### Security and Encryption * **Minimum TLS:** We now require TLS 1.2 as the standard for all of Square Cloud, including custom domains. * **Custom domains:** All custom domains have been configured to a minimum of TLS 1.2. * **Square Cloud proprietary domains:** For anti-phishing domains and enterprise scopes, the minimum TLS is 1.3. ### Log Management * **Application Log Limitation:** The maximum number of logs per category (logs/crash) in `.squarecloud` files has been reduced from 10 to 5. * **Log Infrastructure Change:** We have migrated our log infrastructure from Logtail (BetterStack) to Loki (Grafana). * **Log Coverage and Retention:** We now log 100% of requests to our main infrastructure (API, Website, Blob, etc.), with a 7 times greater data retention. ### Performance Optimization * **Asset Pre-processing:** We have improved asset pre-processing in our infrastructure, resulting in higher processing capacity (throughput). * **IAM Optimization:** We have optimized the encoding of each validation layer of IAM (Identity and Access Management). * **Blob Performance:** Direct actions on the Blob are 20-35% faster, and full logging has been implemented. ### API and Environment Improvements * **New Query for Application Status:** The `/v2/apps/status` route now accepts the `"workspaceId"` query to facilitate state data collection. * **Clearer Error Messages:** Environments now return specific error messages like `"CONTAINER_ALREADY_STARTED"` or `"CONTAINER_ALREADY_STOPPED"`, instead of the generic `"ACTION_FAILED"`, for direct scenarios. Fun facts about Square Cloud: Even though this is the Square Cloud community server, we are currently the **second largest programming server on the Brazilian Discord**, behind only Rocketseat. ### API Update – Extended Support for Workspaces We are excited to announce the addition of new API routes to facilitate the complete management of **workspaces**, **applications**, and **members**. This update provides greater control and flexibility for developers and team administrators. ### Workspaces * `GET /v2/workspaces`: Lists all workspaces of the authenticated user. * `GET /v2/workspaces/:workspaceId`: Retrieves the details of a specific workspace. * `POST /v2/workspaces`: Creates a new workspace. **Body:** `{ name: string }` **Validation:** Name must follow the regex `/^[\w ]{1,32}$/`. * `DELETE /v2/workspaces`: Removes an existing workspace. **Body:** `{ workspaceId: string }` * `DELETE /v2/workspaces/leave`: Allows a user to leave a workspace. **Body:** `{ workspaceId: string }` ### Workspaces – Applications * `POST /v2/workspaces/applications`: Associates an application with a workspace. **Body:** `{ workspaceId: string, appId: string }` * `DELETE /v2/workspaces/applications`: Removes an application from a workspace. **Body:** `{ workspaceId: string, appId: string }` ### Workspaces – Members * `GET /v2/workspaces/members/code`: Generates an invitation code for new members to join a workspace. * `POST /v2/workspaces/members`: Adds a new member to the workspace using an invitation code. **Body:** `{ workspaceId: string, code: string, group: string }` * `PATCH /v2/workspaces/members`: Updates a member's group within the workspace. **Body:** `{ workspaceId: string, memberId: string, group: string }` * `DELETE /v2/workspaces/members`: Removes a member from the workspace. **Body:** `{ workspaceId: string, memberId: string }` Workspaces now adopt Square's unique ID model (40 characters). Square no longer deletes a workspace when its creator's plan expires. By default, **we have reset all teams on the platform**, meaning: **teams created before this update milestone have been deleted**. These changes aim to make workspace management more robust, collaborative, and efficient. 🚀 General changes: * New route for GLOBAL listing of backups: `/v2/users/backups` (GET). * The global application status listing route now defaults to listing only your applications; workspace applications require the `workspaceId` query. For more technical details, consult the official API documentation. > A new documentation update is expected to be published within 24 hours. ## Environment Update We are always improving our services to ensure you have access to the latest and most stable versions of the main programming languages. Check out what's new in this update! ### New versions available: * **JavaScript \[Node.js]** → Recommended: 22.15.1 | Latest: 24.0.2 * **Python** → Recommended: 3.13.3 | Latest: 3.13.3 * **Elixir** → Recommended: 1.18.3 | Latest: 1.18.3 * **Rust** → Recommended: 1.87.0 | Latest: 1.87.0 * **PHP** → Recommended: 8.4.7 | Latest: 8.4.7 * **Go** → Recommended: 1.24.3 | Latest: 1.24.3 ### New for PHP environments: Node.js v22 updated & npm updated by default. COMPOSER\_HOME set to application (base of your project), we also improved the general interoperability of PHP environments. 1. * Extensions active by default: `pdo`, `pdo_mysql`, `pdo_pgsql`, `pdo_sqlite`, `pgsql`, `mysqli`, `mbstring`, `exif`, `pcntl`, `bcmath`, `gd`, `zip`, `opcache`, `sockets`, `intl`, `ldap`, `xml`, `tidy`, `xsl`, `gmp`, `sodium`, `curl`, `ctype`, `fileinfo`, `posix`, `simplexml`, `xmlreader`, `xmlwriter`, `dom`. 2. Libraries and dependencies have been improved, ensuring better integration with PHP frameworks. List: `build-essential`, `git`, `curl`, `wget`, `unzip`, `sqlite3`, `libonig-dev`, `libsqlite3-dev`, `libpq-dev`, `libzip-dev`, `libpng-dev`, `libjpeg-dev`, `libfreetype6-dev`, `zlib1g-dev`, `libssl-dev`, `libcurl4-openssl-dev`, `libldap2-dev`, `unixodbc-dev`, `libicu-dev`, `libxslt-dev`, `libtidy-dev`, `libmemcached-dev`, `libxml2-dev`, `libevent-dev`, `libgmp-dev`, `libreadline-dev`, `libargon2-dev`, `libsodium-dev`, `ca-certificates`, `gnupg`, `nodejs`. 💡 **What does this mean for you?** * More stability and security in all environments. * More compatibility for modern and production-focused applications. The updates are already available. 😄 Note: Redis support will be released soon in version 7.4.0, initially in open testing with users. ## Technical and general balancing changes. Over the past week, we have made a series of adjustments aimed at improving the performance and stability of our API. Here are the main highlights: `/v2/apps/status` * Now returns statuses in **real-time**, without using cache. * New limit of **15 requests per 60 seconds** (rate class: `KEEP CALM`). `/v2/apps/:appId/logs` * Reduced cooldown between requests: from **10s to 5s**. `/v2/apps/:appId/metrics` * **Increased rate and throughput**. * Output now with **compression enabled**. * New limit: **10 requests every 5 seconds**. `/v2/apps/:appId/commit` * Cooldown reduction: from **5s to 3 seconds**. POST `/v2/apps` * Cooldown reduction: from 10s → 5s → **now: 3 seconds**. DELETE `/v2/apps/:appId` * New execution limit: **1 request per second**. * This prevents human errors that could cause serious impacts on the integrity of the user's applications. We have also globally updated some important topics on Square Cloud. **1. Custom domains:** The system now **automatically removes** domains with pending, inactive, deleted, or moved DNS for more than **24h**. **2. GitHub Integration:** Global cooldown reduced between deploys of the same ID: 90s → 60s → **now: 30 seconds**. **3. Deploys (globally) and general commits:** Fixed an issue where poorly formatted requests (e.g., incorrect `Content-Type`) resulted in **proxy timeouts**. We now return a clear and developer-friendly error, with an error code for correction. **4. Invoices:** The service description now displays the **account ID**, replacing the email. This change aims to avoid validation errors caused by limitations of the Goiânia City Hall with certain characters. **5. Global compression:** Note: this was **included for free in all plans**, at no cost and with no limits. * We have enabled an extra layer of compression on our API responses, websites on our infrastructure, and web assets. * You should notice improved responses from your web applications (specifically APIs that return a lot of data for download). * Compression is applied only if possible, in the order: **ZSTD → Brotli → Gzip → \[no compression]**. (it is exactly in this order). Fun facts about Square Cloud: Did you know that Square Cloud is the largest Discord bot hosting platform in Latin America? 🥰 Note: We never really imagined we would grow so much. We also never invested heavily in marketing, which is quite evident if we analyze some numbers and work with triangulated data, we can state with good accuracy that: about **70% of our customers come from recommendations**. These improvements reinforce our commitment to the performance, clarity, and security of your experience with Square Cloud. ## User experience improvement. We took advantage of the last few days of the holiday to focus on improving the overall experience of our site, bringing important improvements that make navigation more fluid, fast, and intuitive. 1. New Redeem page. `/account/redeem` We completely removed that annoying button and modal from the control panel's home page and created an exclusive page for redeeming codes. 2. New Dashboard layout. We have significantly improved the experience on mobile devices; the control panel's home page now takes up less initial space, improving the browsing experience. We also fixed several issues that caused strangeness in the loading of some functions. 3. Actions in the context menu. It is now possible to perform quick actions such as: start, restart, and stop an application directly from the 3 dots of an application in the control panel. 4. Improved log viewing The application's 'Logs' tab has been significantly improved, providing a clearer view of the records and much faster loading. 4. Blob Calculator. The Blob service page now has a new layout and a very cool calculator, allowing you to get an idea of a future cost you might have using our Blob service. It is worth noting that the price per GB and Objects has not yet been fully defined. (There is no active billing for Blob). We have also improved the plan renewal experience and fixed several front-end bugs that impacted this action on our site. In addition, we have made optimizations that improved the overall performance of the platform. Other miscellaneous updates: 1. We improved the invoice experience; now an invoice is automatically canceled 24 hours after its creation date (in case of non-payment). 2. We improved the general stability of our API and reduced infrastructure costs by 27% using new stream handling algorithms and reducing the cost of repetitive actions. 3. We fixed a bug that resulted in an IP swap below a safe margin in the clusters, which caused a 'rebound' effect and the same application received the same IP in some specific scenarios. In simpler terms: we improved the stability of the entire network. 😌 Fun fact about Square Cloud: In the last 7 days, we processed 532 million and 59 thousand requests in our infrastructure. A very impressive number, right? 🤪 > What do you think about me bringing a random fun fact in every changelog? I think it's a cool way to bring the community closer. ## Overhaul of error pages. We have changed the functionality and improved the experience of all error pages within the web scope of our platform. 1. "This site could be yours." When accessing a subdomain (squareweb.app) that does not yet exist, visitors will see an elegant and explanatory page stating that the address is available, meaning: it can be easily activated through a deploy. A simple and intuitive way to show the potential of Square Cloud. (and obviously make your life as a developer easier) 2. "The site took too long to respond..." If your website is misconfigured (for example, listening on the wrong port or host) or experiences momentary instabilities, your visitors will no longer see a cold error screen. Instead, we automatically show a page translated into several languages, clearly explaining what happened, and better yet: with an automatic reconnection attempt after a few seconds. This reduces traffic loss and improves the perception of your site even during occasional failures. All of this is part of our commitment to delivering an increasingly intelligent, practical, and user-focused platform. 💙 3. Optimized traffic and exclusive routing. We have significantly optimized the network traffic between our clusters and proxies, reducing latency and making content delivery even more efficient and faster for all sites hosted on Square Cloud. Now, your visitors access your site more quickly, regardless of location or access volume. And for those who like technical curiosities: in the last 30 days, Square Cloud processed more than **5.41 billion requests**. This is equivalent to about **67% of the world's population**, considering the current 8 billion inhabitants of Earth. 😎 ps.: it's as if for every 2 people on planet earth, 1 and a half people (don't divide a person ok) had sent a request to our services, that's a lot 😌 ## Dashboard Update We are always improving our dashboard to ensure you have the best possible experience. Check out what's new in this update! 1. **You can now favorite applications:** Favorite applications by browser/device directly on the dashboard. Just click the 3 dots (`···`) and select the `Favorite` option. > In the future, we will sync this across all devices. 2. **You can now import your project directly via GitHub:** You can import projects from GitHub by clicking "Import via GitHub" on the upload page or by accessing the link directly: [Import via GitHub](https://squarecloud.app/en/upload?type=github). 3. **Improvement in the session disconnect function:** For security reasons, you can now disconnect all your sessions simultaneously and immediately if you suspect any abnormal activity in your account, an option available 4. **New My Account tab:** The Square Cloud account page has been completely redesigned to make your navigation simpler and more organized. It is now divided into specific sections, with dedicated routes for each feature: * **Account Information** — `/account` View and edit your personal data and account preferences. * **Blob Storage** — `/account/blob` Manage your stored files and data conveniently. * **My Invoices** — `/account/invoices` Track your payment history, plans, and download receipts. * **Account Connections** — `/account/connections` View and control all integrations connected to your account. * **Security and Authentication** — `/account/security` Manage your account code, API key, and active sessions securely. 5. **Billing history available:** You can now view all your invoices directly on the [Invoices](https://squarecloud.app/en/account/invoices) page. 6. **New design for PIX payments:** The PIX payment page has been redesigned with a more modern and intuitive design. 7. **Improvement in the Blob file manager:** Now when uploading a file to blob storage through our dashboard, if the file name field is empty, the system will automatically fill the field with the original name of the attached file. We have also improved the feedback when deleting multiple files from blob storage, offering more clarity and speed in the action. ## General Latency Update We have changed the infrastructure of our backups, deploys, and blob storage, moving them from `Miami` to `Virginia`. We managed to bring our distribution closer to our datacenter in New York, which resulted in significant performance gains. Other important general improvements: 1. **Monitoring and notifications via emails.**: > Note: included for FREE in ALL plans, we do not charge for this. 😉😆 In short: we now send informational emails if your application faces RAM, CPU, or network problems, ensuring faster and more efficient responses to any incident. 2. **Complete rewrite of Blob Storage**: Usage status update: Now, usage statuses, which were previously updated every 12 hours, are updated every 1 minute, providing more real-time information. Object deletion: The object deletion route no longer allows bulk deletions of up to 100 items. The deletion of each object is done individually, preventing abuse and optimizing the load on our infrastructure. New security standard: We have implemented a new method for generating security hashes, which now generates a hash 16 times larger than the previous one, making our private assets more secure. 3. **Performance and Latency**: Asset upload: The latency for uploading assets has been reduced by an average of 23%, providing a faster experience for uploading and accessing your data. Asset retrieval: The response time when accessing asset URLs has been accelerated by up to 30% in various scenarios, due to the strategic location change in Virginia and ongoing tests in Singapore and Ireland. Application metrics: The **application metrics** have been rewritten and are now **returned, on average, in 200ms, compared to the previous 800ms**, providing a faster and more efficient view of your applications' performance. 4. **Future Expansion**: We are planning to further expand our global infrastructure, which will allow us to eliminate the dependency on external caches like Cloudflare, ensuring that your assets, even with a size greater than 100MB, can be delivered without additional network costs. We also fixed an error that generated an "Access Denied" return in the API, when, in fact, it should have been a "RateLimit" (429) in some cases. Now, the API behavior is appropriate for these scenarios. ## Update on Restrictions Sections In order to increase transparency and compliance with international standards, we are announcing a review of our trade restriction guidelines. From now on, we will provide more details on the prohibitions dictated by legislation such as the FCPA, IEEPA, EAR, and other relevant guidelines that influence the trade and use of our services by information technology companies. Additionally, we are expanding existing restrictions, based on practices already established by United States companies, to ensure that our operations meet the criteria of the global market. These changes aim to reinforce security, legal compliance, and transparency in international transactions, especially in relation to countries under sanctions. With data centers located in New York and a strict commitment to standards, Square Cloud remains dedicated to providing a safe and compliant environment for all our users. It is important to note that: although we are a 100% Brazilian company, we have our base of operations in New York and are subject to local legislation. ## General stability update We have increased the base log limit (via API) to `1000 lines`. (previously: `100 lines`). We have globally removed the `requests` parameter from our API (sent in the status route) (deprecated for \~6 months). We have reduced the ratelimit for GitHub integrations (via webhook) to `60 seconds`. (previously: `90 seconds`). Square Cloud no longer sends `SIGTERM` signals with a `5-second` deadline. As of today (03/22/2025), we send the `SIGINT` signal with a `3-second` timeout. This was done to ensure better compatibility with various frameworks and for greater overall stability. Square Cloud now fully forces permissions on all commits and initializations (no longer just on the out-of-execution scope), meaning: we force permissions even if your application is completely running/stopped equally, reducing the probability of EACCESS or similar errors. We also applied a new startup logic, reducing the overall load. ⚠️ **Addendum for Next.js users: [https://nextjs.org/blog/cve-2025-29927](https://nextjs.org/blog/cve-2025-29927)** ## Update on limits We have great news: **we have increased the API request limits** on all plans, and best of all... **at no additional cost!** 🎉 Now you can make many more requests per day! Check out the new numbers based on the daily limit increase: * **Standard:** 144,000 req/day (+14,400 requests/day added) * **Advanced:** 216,000 req/day (new plan) * **Pro:** 432,000 req/day (+216,000 requests/day added) * **Enterprise-24:** 864,000 req/day (new plan) * **Enterprise-32:** 1,152,000 req/day (+864,000 requests/day added) The **Enterprise category will now proportionally support** up to ****36,864,000 requests per day****; previously the highest limit was: 2,448,000 million. Other changes: * The Hobby plan will no longer support the workspace system (formerly teams) and will not have access to the billable [Blob](https://squarecloud.app/blob) (it will still have access to the free quota), as it is being changed to a personal use focus plan. In contrast, we have increased the member limits per workspace for all plans: * **Advanced:** will support 5 members/workspace. * **Pro:** will support 7 members/workspace. * **Enterprise-24:** will support 10 members/workspace. Enterprise 32, 48, 64, 160 and above will support: 15, 20, 30, and infinite/members per workspace. This update ensures greater scalability for your projects, allowing you to focus exactly on your maximum efficiency. 😎 ## Proxies We have completely rewritten all of Square Cloud's proxies in **Go (Golang)**, bringing a more efficient, stable, and scalable infrastructure. This change covers all proxies on the platform, including: * 🌐 **squareweb.app (subdomains)** – Better performance and lower latency for web applications. * 🔗 **Custom domains** – New optimized routing, ensuring faster response times. * 🏗 **Individual clusters** – Each cluster now has an exclusive dedicated proxy, distributing the load better. In addition to the structural improvements, **we have expanded our capacity to support more than 100 billion monthly requests without any expected issues**, a significant advance from the previous theoretical limit of approximately **23 billion**. This update ensures greater stability, security, and scalability, allowing our users to operate with maximum efficiency. 😎 ## Compliance In compliance with LGPD, GDPR, and other applicable laws, we inform you that we have removed 40,667 accounts that have been inactive for more than 730 days (2 years) from our platform. This action reinforces our commitment to privacy, data security, and regulatory compliance. ## Infrastructure We have updated our entire infrastructure to ensure greater efficiency and performance. With this update, we have improved the base latency between clusters, reducing the internal interaction response time by approximately 2 to 5 ms, which optimizes various operations, especially for more advanced users. In addition, we have made strategic improvements to our proxy flow, preparing Square Cloud to handle traffic volumes exceeding 5 billion monthly requests. Currently, our infrastructure processes about 1.3 billion requests per month, and these optimizations will ensure scalability, resilience, and improved performance for our users. ## Dashboard Our dashboard has undergone several improvements to offer a more agile, intuitive, and efficient experience. Check out the main new features: 🔹 **New improved interface** * Small visual refinements to make navigation more fluid and accessible. * Better organization of information to facilitate the management of your projects. * New exclusive section for account management ("My Account"). **Optimized performance** * We have reduced page loading times, ensuring greater speed in displaying your data. * We have improved real-time synchronization, providing faster and more accurate updates. 🛠️ **New features and adjustments** * We have improved the logging system, allowing for more detailed and efficient monitoring. * Minor bugs have been fixed to ensure more stability and reliability. **Discord Connection** Get your wonderful role by connecting your Discord account to your Square Cloud account 🙂 Go to: [https://squarecloud.app/en/account](https://squarecloud.app/en/account), scroll down the page and make the connection. \*as this is a test connection, Square may reset the connection in case of failure during this authorization period 😄 ## Environment Update We are always improving our services to ensure you have access to the latest and most stable versions of the main programming languages. Check out what's new in this update! ### New versions available: * **JavaScript \[Node.js]** → Recommended: 22.13.1 | Latest: 23.7.0 * **Python** → Recommended: 3.13.1 | Latest: 3.13.1 * **Java** → Recommended: JDK 23 | Latest: JDK 25 * **Elixir** → Recommended: 1.18.1 | Latest: 1.18.1 * **Rust** → Recommended: 1.84.1 | Latest: 1.84.1 * **PHP** → Recommended: 8.4.3 | Latest: 8.4.3 * **Go** → Recommended: 1.23.6 | Latest: 1.23.6 * **C#** → Recommended: 9.0.1 | Latest: 9.0.1 * **HTML/CSS** → Build 10-02-2025 ### New for static sites: The environment now supports the `vite.html` file, making it easier to host sites exported by **Vite**. Additionally, a `404.html` will be created by default to improve the browsing experience. 💡 **What does this mean for you?** * More stability and security in all environments. * More compatibility for modern and production-focused applications. The updates are already available. 😄 # Authentication Source: https://docs.squarecloud.app/en/cli-reference/authentication Learn what it takes to authenticate to the Square Cloud CLI. First you need to get an API key from the [Developer Dashboard](https://squarecloud.app/en/account/security). You can use this API key to authenticate to the Square Cloud CLI. Authenticate to the Square Cloud CLI using the following command: ```bash theme={null} squarecloud auth login ``` You will be prompted to enter your API key. ```bash theme={null} Your API Token: > Insert your square cloud api token ``` After entering your API key, you will be authenticated to the Square Cloud CLI. You can skip the prompt by passing your API key with the `--token` flag: ```bash theme={null} squarecloud auth login --token= ``` ## Next steps After authenticating to the Square Cloud CLI, you can start deploying your applications. Learn how to deploy your application using the Square Cloud CLI. Learn about the commands available in the Square Cloud CLI. # squarecloud app commit Source: https://docs.squarecloud.app/en/cli-reference/commands/app/commit Commit your application to Square Cloud. ```bash theme={null} squarecloud app commit ``` ```bash theme={null} squarecloud app commit --file # Specifies the file you want to upload to Square Cloud. ``` ```bash -r or --restart theme={null} squarecloud app commit --restart # Restarts your application automatically after the commit is complete. ``` Use `squarecloud app commit --help` for more information about this command. # squarecloud app delete Source: https://docs.squarecloud.app/en/cli-reference/commands/app/delete Deletes your application on Square Cloud. ```bash theme={null} squarecloud app delete ``` Use `squarecloud app delete --help` for more information about this command. # squarecloud app list Source: https://docs.squarecloud.app/en/cli-reference/commands/app/list Lists all your applications on Square Cloud. ```bash theme={null} squarecloud app list ``` Use `squarecloud app list --help` for more information about this command. # squarecloud app logs Source: https://docs.squarecloud.app/en/cli-reference/commands/app/logs Displays the last 1000 terminal lines of your application on Square Cloud. ```bash theme={null} squarecloud app logs ``` Use `squarecloud app logs --help` for more information about this command. # squarecloud app restart Source: https://docs.squarecloud.app/en/cli-reference/commands/app/restart Restarts your application on Square Cloud. ```bash theme={null} squarecloud app restart ``` Use `squarecloud app restart --help` for more information about this command. # squarecloud app snapshot Source: https://docs.squarecloud.app/en/cli-reference/commands/app/snapshot Manages snapshots of your applications on Square Cloud. ```bash theme={null} squarecloud app snapshot create # Creates a snapshot of your application on Square Cloud. ``` ```bash theme={null} squarecloud app snapshot create --download # Downloads the snapshot to your local machine after it's created. ``` ```bash theme={null} squarecloud app snapshot list # Lists all applications snapshots on Square Cloud. ``` ```bash theme={null} squarecloud app snapshot list # Lists all snapshots for a specific application identified by . ``` Use `squarecloud app snapshot --help` for more information about this command. # squarecloud app start Source: https://docs.squarecloud.app/en/cli-reference/commands/app/start Starts your application on Square Cloud. ```bash theme={null} squarecloud app start ``` Use `squarecloud app start --help` for more information about this command. # squarecloud app status Source: https://docs.squarecloud.app/en/cli-reference/commands/app/status Displays the status of your application on Square Cloud. ```bash theme={null} squarecloud app status ``` Use `squarecloud app status --help` for more information about this command. # squarecloud app stop Source: https://docs.squarecloud.app/en/cli-reference/commands/app/stop Stops a running application on Square Cloud. ```bash theme={null} squarecloud app stop ``` Use `squarecloud app stop --help` for more information about this command. # squarecloud app upload Source: https://docs.squarecloud.app/en/cli-reference/commands/app/upload Deploys your application to Square Cloud. ```bash theme={null} squarecloud app upload ``` Now just wait a few moments and your application will be deployed to Square Cloud. ```bash Output theme={null} ✓ Your application has been uploaded ``` Use `squarecloud app upload --help` for more information about this command. # squarecloud auth login Source: https://docs.squarecloud.app/en/cli-reference/commands/auth/login Command to authenticate in the Square Cloud CLI. ```bash theme={null} squarecloud squarecloud auth login ``` You will be prompted to enter your API key. ```bash Insert your square cloud api token theme={null} Your API Token: > Insert your square cloud api token ``` ```bash Output theme={null} Your API Token has successfuly changed! You are now logged in a With great power comes great responsibility! ``` Tip: You can skip the prompt by passing your API key with the `--token` flag: ```bash theme={null} squarecloud auth login --token= ``` # squarecloud auth logout Source: https://docs.squarecloud.app/en/cli-reference/commands/auth/logout Command to log out from the Square Cloud CLI. ```bash theme={null} squarecloud auth logout ``` ```bash Output theme={null} You have successfully logged out of your Square Cloud account. ``` # squarecloud auth whoami Source: https://docs.squarecloud.app/en/cli-reference/commands/auth/whoami Command to display user information in the Square Cloud CLI. ```bash theme={null} squarecloud auth whoami ``` You will see the user information associated with the current Square Cloud token. ```bash Output theme={null} Currently logged as ``` # squarecloud database snapshot Source: https://docs.squarecloud.app/en/cli-reference/commands/database/snapshot Manages snapshots of your databases on Square Cloud. ```bash theme={null} squarecloud database snapshot list # Lists all database snapshots on Square Cloud. ``` ```bash theme={null} squarecloud database snapshot list # Lists all snapshots for a specific database identified by . ``` Use `squarecloud database snapshot --help` for more information about this command. # squarecloud help Source: https://docs.squarecloud.app/en/cli-reference/commands/help Command to get help about any command. ```bash theme={null} squarecloud help ``` ```bash Output theme={null} A command line application to manage your Square Cloud applications Usage: squarecloud COMMAND [flags] squarecloud [command] Available Commands: app Do some actions with your applications auth Manage your authentication with Square Cloud backup Manage your backups commit Commit your application to Square Cloud help Help about any command upload Upload your application to Square Cloud zip Zip the current folder Flags: -h, --help help for squarecloud -v, --version Print CLI version Use "squarecloud [command] --help" for more information about a command. ``` # squarecloud zip Source: https://docs.squarecloud.app/en/cli-reference/commands/zip Zip the current folder. ```bash theme={null} squarecloud zip ``` ```bash Success Output theme={null} Your source has successfuly zipped to ``` ```bash Failed Output theme={null} It was not possible to make the zip of your application OR .zip already exists and its not possible to delete it ``` # Installation Source: https://docs.squarecloud.app/en/cli-reference/installation Learn what it takes to install the Square Cloud CLI. The Square Cloud 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 much more. ## Installation To use the CLI, you need to install it on your local machine. You can install the CLI using the following commands:
```bash macOS, Linux, and WSL theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` ```bash Windows with npm theme={null} npm install -g @squarecloud/cli ``` ## Update the CLI To update the CLI, you can run the following command: ```bash Windows theme={null} npm update -g @squarecloud/cli ``` ```bash Linux, macOS, and WSL theme={null} curl -fsSL https://cli.squarecloud.app/install | bash ``` And that's it! You have successfully updated the Square Cloud CLI. 🎉 ## Next steps After installing the CLI, you need to authenticate to the Square Cloud API. Learn what it takes to authenticate to the Square Cloud CLI. # Automatic Deletion of Files When Deploying an Application to Square Cloud Source: https://docs.squarecloud.app/en/faqs/automatic-deletion-files-when-deploying-an-application-to-squarecloud Learn about the files that are automatically deleted when deploying an application to Square Cloud. When deploying your application to Square Cloud, you might encounter a scenario where certain files are automatically deleted during the deployment process. Understanding the files that are subject to automatic deletion is crucial for ensuring a smooth deployment experience. Here, we provide a list of files that are commonly deleted during deployment and need to be excluded from your deployment package. ## List of Files to Exclude: * `.bash_logout` * `.bashrc` * `.profile` * `node_modules` * `.mongodb` * `.cache` * `.composer` * `.git` * `.husky` * `.logs` * `.local` * `.venv` * `.vscode` * `__pycache__` * `.npm` These files are typically related to development environments, build configurations, and dependencies. Square Cloud may automatically remove them during the deployment process to optimize the application's performance and reduce unnecessary data transfer. It's important to note that certain development tools and platforms generate these files for local development purposes. However, they are not essential for the application to run in a production environment. Therefore, excluding them during deployment ensures a more efficient and streamlined application deployment process. To prevent these files from being deleted during deployment, make sure to exclude them from your deployment package or configure your deployment process accordingly. Understanding and managing these files will help you deploy your application smoothly on Square Cloud while maintaining a clean and efficient deployment package. # How to debug your Application Source: https://docs.squarecloud.app/en/faqs/debugging-an-application Learn how to debug your application using discord.py and discord.js. ## Debugging in [**discord.js**](https://old.discordjs.dev/#/docs/discord.js/14.14.1/class/Client?scrollTo=e-debug) With discord.js, you can utilize the "debug" and "error" events for debugging. Here's an example: ```js theme={null} // The client listens for a 'debug' event client.on('debug', (info) => { // Logs the debug info to the console console.log(`Debug Info: ${info}`); }); // The client listens for an 'error' event client.on('error', (error) => { // Logs the error message to the console console.error(`Encountered an Error: ${error.message}`); }); ``` In this code, we use the 'debug' event; it is triggered to provide general debugging information, and the debug messages are logged to the console. Similarly, when the 'error' event is triggered, the error message is logged to the console. ## Debugging in [**discord.py**](https://discordpy.readthedocs.io/en/stable/logging.html?highlight=debug) With discord.py, you can use the logging module for debugging. Here's an example: ```py theme={null} import logging import logging.handlers # Sets up the logger for discord logger = logging.getLogger('discord') logger.setLevel(logging.DEBUG) logging.getLogger('discord.http').setLevel(logging.INFO) # Sets up the handler for the logger handler = logging.StreamHandler() dt_fmt = '%Y-%m-%d %H:%M:%S' formatter = logging.Formatter('[{asctime}] [{levelname:<8}] {name}: {message}', dt_fmt, style='{') handler.setFormatter(formatter) logger.addHandler(handler) # Runs the bot client.run("your token here", log_handler=None) ``` In this code, all debugging information and errors are logged to the console. # Solving 'Could not locate the bindings file' Source: https://docs.squarecloud.app/en/faqs/troubleshooting/BETTER_SQLITE3_ERROR Learn how to resolve the 'Could not locate the bindings file' issue in your application. ## When does it occur? This issue happens when the `better-sqlite3` library or a library that depends on it, like `quick.db`, is not updated. ```bash theme={null} Error: Could not locate the bindings file. Tried: → /application/node_modules/better-sqlite3/build/better_sqlite3.node [...] ``` ## Why does it occur? This error occurs because the `better-sqlite3` library has not been updated to the latest version. In **previous** versions of `better-sqlite3`, the library **did not support Node.js LTS v24.x.x**. ## How to fix To fix this issue, you need to update the `better-sqlite3` library to the latest version. Remember to update libraries that depend on `better-sqlite3`, like `quick.db`. ### Check the latest versions of the libraries: * [npm better-sqlite3](https://www.npmjs.com/package/better-sqlite3) * [npm quick.db](https://www.npmjs.com/package/quick.db) ### Update the `better-sqlite3` in your `package.json` After checking the latest version of the library, you can update it in your `package.json`. For example, if the current version is 12.4.1, you can use the following: ```json Update manually in your package.json theme={null} "better-sqlite3": "^12.4.1", "quick.db": "^9.1.7" // or any other library that depends on better-sqlite3 ``` ```bash Update using the terminal theme={null} npm install better-sqlite3@latest ``` ### Removing files for a clean installation After updating your `package.json`, you should remove the files and folders: `node_modules`, `package-lock.json`, and the `.npm` folder. ### Reboot Your Application In conclusion, simply restart your application by clicking on the blue button. If you have followed all the steps correctly, your application should no longer encounter this error. # Solving INVALID_DEPENDENCY Source: https://docs.squarecloud.app/en/faqs/troubleshooting/INVALID_DEPENDENCY Learn how to resolve the Solving INVALID_DEPENDENCY issue in your application. ## When does it occur? This issue occurs when your dependency file could not be located in the root of your application. ## Why does it occur? This issue occurs when your dependency file could not be located in the root of your application. This can happen when your dependency file does not exist or its nominated with an extra `.txt`. ## How to fix ### For Node.js (package.json) 1. **Navigate to the root directory of your project:** Ensure that you are in the main directory of your application. 2. **Check for the presence of `package.json`:** Verify whether the `package.json` file exists in the root directory. If it is not present, create one using the following command: ```bash theme={null} npm init -y ``` This command initializes a default `package.json` file. 3. **Ensure correct naming:** Confirm that the file is named exactly as `package.json` and does not have any additional extensions (e.g., `package.json.txt`). If there are any discrepancies, rename the file accordingly. ### For Python (requirements.txt) 1. **Navigate to the root directory of your project:** Make sure you are in the main directory of your application. 2. **Check for the presence of `requirements.txt`:** Confirm whether the `requirements.txt` file exists in the root directory. If it is missing, create one. 3. **Ensure correct naming:** Verify that the file is named exactly as `requirements.txt` without any additional extensions (e.g., `requirements.txt.txt`). If the name is incorrect, rename the file accordingly. 4. **Add dependencies to the file:** Open the `requirements.txt` file and add the necessary dependencies for your Python project. For example: ```plaintext requirements.txt theme={null} discord.py ``` ### Additional Tips: * **Double-check file extensions:** Ensure that the file extensions are correct (e.g., `.json` for Node.js, `.txt` for Python). Incorrect extensions might lead to the `INVALID_DEPENDENCY` error. * **Review documentation and guides:** Consult the documentation for your specific programming language ([Node.js](/en/articles/getting-started-with-nodejs)/[Python](/en/articles/getting-started-with-python)). # Solving LACK_OF_CPU Source: https://docs.squarecloud.app/en/faqs/troubleshooting/LACK_OF_CPU Learn how to resolve the LACK_OF_CPU issue in your application. ## When does it occur? This issue occurs when your application is using more CPU than is available. ```bash theme={null} [SQUARE-SHIELD] LACK_OF_CPU ``` ## Why does it occur? This issue occurs when your application is using more CPU than is available. This can happen when your application is under heavy load, or when your application is not optimized to use less CPU. ## How to fix The CPU allocated to your application is determined by your current plan. To address this, consider upgrading to a higher plan on the [plans page](https://squarecloud.app/en/pricing). Alternatively, optimize your application to reduce CPU usage. ### Resubmitting your application After upgrading your plan, it's important to remove your application and resubmit it to reflect the updated CPU allocation. # Solving LACK_OF_RAM Source: https://docs.squarecloud.app/en/faqs/troubleshooting/LACK_OF_RAM Learn how to resolve the LACK_OF_RAM issue in your application. ## When does it occur? This issue occurs when your application is using more RAM than is available. ```bash theme={null} [SQUARE-SHIELD] LACK_OF_RAM ``` ## Why does it occur? This issue occurs when your application is using more RAM than is available. This can happen when your application is using more RAM than is available on your current plan. ## How to fix Navigate to the file manager and locate the `squarecloud.app/config` file. 1. Open the file and locate the `MEMORY` field. 2. Increase the value of the `MEMORY` field. The value is in megabytes (MB). 3. We recommend increasing the value by 50% of the current value. For example, if the current value is `512`, increase it to `768`. If you are already using the maximum available RAM based on your current plan, consider upgrading to a higher plan by visiting the [plans page](https://squarecloud.app/en/pricing). # Solving MODULE_NOT_FOUND Source: https://docs.squarecloud.app/en/faqs/troubleshooting/MODULE_NOT_FOUND Learn how to resolve the MODULE_NOT_FOUND issue in your application. ## When does it occur? This error occurs when your application tries to use a library that is not installed in the environment. ```bash javascript theme={null} Error: Cannot find module 'discord.js' ``` ```bash python theme={null} ModuleNotFoundError: No module named 'discord.py' ``` ## Why does it occur? This can happen when you try to use a library that is not installed by default in the environment. For example, the `discord.js` library is not installed by default in the JavaScript environment. ## How to fix To fix this, you need to add the missing library to your project's dependency files. These files list the libraries that will be installed in the environment. In the case of Python, this file is called `requirements.txt`, and for JavaScript, it is called `package.json`. Here is an example of the content of these files after adding the missing libraries: ```json package.json theme={null} { "name": "my-app", "version": "1.0.0", "dependencies": { "discord.js": "14.14.1", // other dependencies... } } ``` ```txt requirements.txt theme={null} discord.py # other dependencies... ``` ### Reboot Your Application After adding the necessary libraries to your project's dependency files, you should reboot your application. This allows your environment to recognize and install the newly added libraries. # Solving TOKEN_INVALID Source: https://docs.squarecloud.app/en/faqs/troubleshooting/TOKEN_INVALID Learn how to resolve the TOKEN_INVALID code error and ensure smooth communication with the Discord API. ## When does it occur? The authentication token for your Discord bot was not found or appears to be invalid. This might happen if the token is regenerated, revoked, or the bot's access to the server is restricted. ```bash discord.js theme={null} Error [TOKEN_INVALID]: An invalid token was provided. ``` ```bash discord.py theme={null} LoginFailure: Improper token has been passed. ``` ## Why does it occur? You will encounter this error when your application attempts to authenticate with the Discord API using an invalid or outdated bot token. ## How to fix Ensure that the token provided when creating the Discord.js client is accurate and up-to-date. If you suspect the token might be invalid, regenerate it on the Discord Developer Portal. ### Regenerate the Token If you have confirmed that the current token is invalid or compromised, generate a new one on the [Discord Developer Portal](https://discord.com/developers/applications). ### Update the Token in Your Code If you are using a `.env` file to store the token, make sure to update the file with the new token. Generally, the token is stored in `.env` or `config,json` files. If you are using a different method to store the token, update the code accordingly. ### Keep the library up to date Ensure you are using the latest version of your library. Developers regularly update the library to fix bugs and address compatibility issues. ```bash Update discord.js theme={null} npm install discord.js@latest # or update in your package.json ``` ```bash Update discord.py theme={null} pip install discord.py # or update in your requirements.txt ``` ### Reboot Your Application After implementing the changes, restart your application to apply the updates. This ensures that the new token and any code modifications take effect. # Troubleshooting Access Issues on Website or API Source: https://docs.squarecloud.app/en/faqs/troubleshooting/WEBSITE_UNAVAILABLE Discover how to resolve issues when accessing your website or API. ## Unauthorized * There are 2 situations that can result in this message when trying to access a website/API: 1. The URL of the site you tried to access is not hosted on Square Cloud. Any subdomain of a site that is not hosted on Square Cloud and is attempted to be accessed will receive the message "Unauthorized". If you added the "SUBDOMAIN" field after deploying your application, this field will not be read, and the URL will not exist because this field is only read during the deployment. Therefore, you need to remove and redeploy your application with this field correctly configured. 2. If you have recently hosted your site, please wait 1 minute. Square Cloud is finalizing the configurations for your site. After this period, try accessing it again. ## Timeout * There are 4 situations that can result in this message when trying to access a website/API: 1. Your website or API may have errors preventing it from responding properly. 2. If the website or API is offline, you will also receive this message. It's important to check the logs to identify any potential errors. 3. In Square Cloud, the default port for websites and APIs is port `80` for HTTP traffic. If your website or API is using a different port, you may encounter this error message. 4. If you do not correctly configure the host as `0.0.0.0` when hosting your site, this can lead to access errors. # Solving Lavalink Closed Abnormally issue Source: https://docs.squarecloud.app/en/faqs/troubleshooting/lavalink-closed-abnormally Due to recent Lavalink updates you may come across the following error: Lavalink Closed Abnormally. This article will help you solve this issue. ## When does it occur? When you are trying to connect your Lavalink server to your app hosted on Square Cloud, you may come across the following error: ``` Error: Unexpected server response: 400 Error: WebSocket closed abnormally with code 1006. ``` ## Why does it occur? You will receive this error if you are using a Lavalink version that is not compatible with the library you are using. For example, if you are using the Lavalink version 4.0.0, you will receive this error if you are using the Lavalink client version 3, as the Lavalink version 4 is entirely REST. ## How to fix To fix this error, you will need to update your Lavalink client to the latest version. Or use a Lavalink version that is compatible with your Lavalink client. ### Bonus Tips: * Remember to open your Lavalink server in port 80. * Connect in your Lavalink server using port 443 and option `secure: true`. Congratulations! You have successfully solved the Lavalink Closed Abnormally issue. Now you can connect your Lavalink to your app hosted on Square Cloud. # Configuring MongoDB Atlas Whitelist Source: https://docs.squarecloud.app/en/faqs/troubleshooting/whitelist-mongodb Due to how Square works in a way that has a dynamic IP, by an exclusive technology, it is impossible to provide you with an IP, since every restart in the application, you receive a unique IP. **Square Cloud** stands out with its **dynamic IP allocation**, assigning a **unique address** with **each application restart**. Unlike static IPs, this dynamic approach enhances security by constantly changing the network footprint, **making it more resilient against potential threats**. ## When does it occur? When you are trying to connect your MongoDB Atlas database to your app hosted on Square Cloud, you may come across the following error: ``` MongoNetworkError: connection 0 to shard-xxx-xxx.mongodb.net:27017 closed ``` ## Why does it occur? You will receive this error message if you have not included the MongoDB Atlas addresses, the IP where your app is hosted, on the whitelist. ## How to fix To fix this error, you need to whitelist the IP address, according to the [mongodb documentation](https://www.mongodb.com/docs/atlas/security/ip-access-list/), you need to whitelist 0.0.0.0/0 IP address. Congratulations! You have successfully whitelisted the IP address 0.0.0.0/0 for your MongoDB Atlas database. Now you can connect your database to your app hosted on Square Cloud. # How to use Auto Restart in Square Cloud Source: https://docs.squarecloud.app/en/faqs/using-autorestart-in-your-squarecloud-application Learn how to use Auto Restart in Square Cloud to automatically restart your application in case it crashes. A **Square Cloud exclusive technology**, Auto Restart is a powerful feature in Square Cloud that allows your application to **automatically restart in case it crashes**. This ensures that **your app** remains **accessible and functional** even in the **event of unexpected failures**. ## Enabling Auto Restart With Auto Restart, follow these steps to enable it in your application's configuration file: Create or edit your `squarecloud.app` or `squarecloud.config` file. The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things. Locate the `AUTORESTART` parameter in the configuration file. Or add it if it doesn't exist. Set the value of `AUTORESTART` to `true`. Here's an example of how to enable Auto Restart in your configuration file: ```systemd squarecloud.app OR squarecloud.config theme={null} AUTORESTART=true ``` ## How Auto Restart Works Auto Restart is a proactive feature that monitors the health of your application. If your application crashes or becomes unresponsive, Auto Restart takes action to get it back up and running. When your application crashes or becomes unresponsive, Auto Restart detects the issue if AUTORESTART is enabled in your configuration file. If the **application uptime is > 60 seconds**, will proceed to next step. If the **application exit status is 1**, will proceed to next step. If the **application didn't restart in the last 60 minutes**, will proceed to next step. If the application logs contain any of the excluded errors, Auto Restart will not restart the application. Examples of excluded errors include: ```json SyntaxError theme={null} SyntaxError: Unexpected token 'X'.. SyntaxError: Unexpected identifier 'X'.. SyntaxError: Invalid or unexpected token 'X'.. ``` ```json Version didn't find theme={null} npm ERR! notarget No matching version found for ERROR: Could not find a version that satisfies the requirement And variations of this error. ``` ```json Module not found theme={null} Error: Cannot find module 'X' Module not found: Can't resolve 'X' in 'Y' And variations of this error. ``` ```json Invalid dependency file theme={null} ERROR: Invalid requirement: 'X' ERROR: Could not open requirements file: 'X' npm ERR! code EJSONPARSE... npm ERR! Failed to parse json And variations of this error. ``` If the application logs contain any of these errors, Auto Restart will not restart the application. AUTORESTART automatically restarts your application to bring it back. 😉 Cooldown between restarts is 60 minutes. ## Best Practices Here are some best practices to make the most of Auto Restart: * Regularly review your application's logs to understand the reasons for any crashes or restarts. This can help you identify and address underlying issues. * Keep your MAIN file and memory allocation parameters up-to-date to ensure optimal performance and resource usage. ## Conclusion Auto Restart in Square Cloud is a valuable feature that enhances the reliability of your application. By automatically handling crashes and unresponsiveness, it helps maintain a seamless user experience. Ensure that you have a plan with Auto Restart enabled and configure it in your `squarecloud.app` or `squarecloud.config` file to make the most of this feature. # Square Cloud SDKs Source: https://docs.squarecloud.app/en/sdks/introduction Learn how to use the Square Cloud SDKs to interact with the Square Cloud API. ### Choose your SDK All sdks are open source and available on [Github](https://go.squarecloud.app/github). } href="https://github.com/squarecloudofc/sdk-api-js"> Learn how to use the Square Cloud JavaScript SDK to interact with the Square Cloud API. } href="https://github.com/squarecloudofc/sdk-api-py"> Learn how to use the Square Cloud Python SDK to interact with the Square Cloud API. Square Cloud is constantly improving and developing SDKs in new languages. If you don't see your language here, please [let us know](https://go.squarecloud.app/github) and we'll add it to our roadmap. # Client Source: https://docs.squarecloud.app/en/sdks/js/client The main object is the SquareCloudAPI object, instantiated with an API key. This object signifies a connection to the Square Cloud service and serves as an interface for interacting with different service aspects. ```bash theme={null} npm i @squarecloud/api ``` ```javascript theme={null} const { SquareCloudAPI } = require("@squarecloud/api"); const api = new SquareCloudAPI("Your API Key"); ``` ```typescript theme={null} import { SquareCloudAPI } from "@squarecloud/api"; const api = new SquareCloudAPI("Your API Key"); ``` ## Parameters ### API Key * Type: `string` * Required: Yes * Description: A valid API key must be provided as a string for authentication. ## Get Started Using the get started endpoint, you can obtain a user object representing the user associated with the API key, as well as a list of applications associated with the user. ```javascript theme={null} const user = await api.user.get(); console.log(user.applications); // List of Application's ``` ## Application Using the `Client`, you can obtain an object representing your application. This object is an instance of the `Application` class, allowing you to manage your application more conveniently without always needing to pass the ID. ```javascript Obtaining an Application theme={null} const app = user.applications.get("Application ID"); console.log(app); // Output: application object ``` ```javascript Obtaining All Applications theme={null} console.log(user.applications); // user = api.user.get() [Promise] ``` # Commit and Upload Source: https://docs.squarecloud.app/en/sdks/js/commit_and_upload In this section you will learn how to make commits and uploads using the Square Cloud JavaScript SDK. ## Making a commit `application.commit()` is a method that allows you to commit a file to your application. ```javascript theme={null} const { SquareCloudAPI } = require("@squarecloud/api"); const api = new SquareCloudAPI("Your API Key"); const application = await api.applications.get("Application ID"); // Specify the content and name of the file you want to commit const fileContent = Buffer.from("Your file content"); const fileName = "file.txt"; // Perform the commit operation const success = await application.commit(fileContent, fileName); // Handle the result accordingly if (success) { console.log(`File "${fileName}" committed successfully.`); } else { console.error(`Failed to commit file "${fileName}".`); } ``` ```javascript theme={null} const { SquareCloudAPI } = require("@squarecloud/api"); const api = new SquareCloudAPI("Your API Key"); const application = await api.applications.get("Application ID"); // Specify the content and name of the file you want to commit const { join } = require("node:path"); const fileName = "file.txt"; const filePath = join(__dirname, fileName); // Optionally, set whether the application should restart after the commit const shouldRestart = true; // Perform the commit operation const success = await application.commit(filePath, fileName, shouldRestart); // Handle the result accordingly if (success) { console.log(`File "${fileName}" committed successfully.`); } else { console.error(`Failed to commit file "${fileName}".`); } ``` ## Making a upload `application.create()` is a method that allows you to upload a application to Square Cloud. ```javascript theme={null} const { SquareCloudAPI } = require("@squarecloud/api"); const api = new SquareCloudAPI("Your API Key"); // Specify the content and name of the zip file you want to upload const { join } = require("node:path"); const fileName = "application.zip"; const filePath = join(__dirname, fileName); // Perform the upload operation const success = await api.applications.create(filePath); // Handle the result accordingly if (success) { console.log(`Application uploaded successfully.`, success); // Return the application uploaded information (id, tag, description, etc.) } else { console.error(`Failed to upload application.`); } ``` **Remember that to upload an application you need a zip that contains (at least) the following files:**: * Main file: responsible for starting your application * Dependencies file: contains information about which dependencies are necessary * Configuration file (squarecloud.app): a configuration file specifying the name, description, main file name, version, etc. To learn more about the configuration file, take a look at this [guide](https://docs.squarecloud.app/en/getting-started/config-file). # Managing Applications Source: https://docs.squarecloud.app/en/sdks/js/managing_application In this section, you will learn how to manage your application using the available library. You can interact with your application in various ways, such as obtaining information about the application status, accessing logs, starting, stopping, and restarting the application, as well as managing files associated with it. ## Getting the status of your application `application.getStatus()` return a `ApplicationStatus` class. ```javascript theme={null} const { SquareCloudAPI } = require("@squarecloud/api"); const api = new SquareCloudAPI("Your API Key"); const application = await api.applications.get("Application ID"); const status = await application.getStatus(); console.log(status.usage.cpu); // '0.22%' console.log(status.usage.ram); // '70MB' console.log(status.usage.network); // {'total': '0 KB ↑ 0 KB ↓', 'now': '0 KB ↑ 0 KB ↓'} console.log(status.usage.storage); // '0B' console.log(status.running); // true | false console.log(status.status); // 'running' | 'exited' ... ``` ## Getting logs `application.getLogs()` return a String. ```javascript theme={null} const application = await api.applications.get("Application ID"); const logs = await application.getLogs(); console.log(logs); // String ``` ## Starting the application `application.start()` return a Boolean. ```javascript theme={null} const application = await api.applications.get("Application ID"); const started = await application.start(); console.log(started); // Boolean (true or false) ``` ## Stopping the application `application.stop()` return a Boolean. ```javascript theme={null} const application = await api.applications.get("Application ID"); const stopped = await application.stop(); console.log(stopped); // Boolean (true or false) ``` ## Restarting the application `application.restart()` return a Boolean. ```javascript theme={null} const application = await api.applications.get("Application ID"); const restarted = await application.restart(); console.log(restarted); // Boolean (true or false) ``` ## Deleting an application `application.delete()` return a Boolean. This will delete your application **PERMANENTLY**, meaning that unless you have a backup of your application, it cannot be recovered. ```javascript theme={null} const application = await api.applications.get("Application ID"); const deleted = await application.delete(); console.log(deleted); // Boolean (true or false) ``` # Managing Files Source: https://docs.squarecloud.app/en/sdks/js/managing_files In this section, you will find information and examples on how to manipulate the files associated with your application. Learn how to list, read, create, and delete files using the Square Cloud JavaScript SDK. ## Getting a list of files `application.files.list()` return a list of `APIListedFile` objects. ```javascript theme={null} const application = await api.applications.get("Application ID"); const filesList = await application.files.list(); console.log(filesList); // Return a Array of File Objects // [{type: "file", name: "index.js", size: 123, lastModified: 123456789}] ``` ## Reading a file `application.files.read()` returns a Buffer object. ```javascript theme={null} const application = await api.applications.get("Application ID"); const file = await application.files.read("index.js"); console.log(file.toString()); // String ``` ## Creating a file `application.files.create()` returns a Boolean. ```javascript theme={null} const { SquareCloudAPI } = require("@squarecloud/api"); const api = new SquareCloudAPI("Your API Key"); const application = await api.applications.get("Application ID"); // Specify the content and name of the file you want to create const fileContent = Buffer.from("archive content here"); const filePath = "./folder/test_file.txt"; // Perform the create file operation const file = await application.files.create(fileContent, filePath); console.log(file); // Boolean (true or false) ``` ```javascript theme={null} const { SquareCloudAPI } = require("@squarecloud/api"); const api = new SquareCloudAPI("Your API Key"); const application = await api.applications.get("Application ID"); // Specify the content and name of the file you want to create const { join } = require("node:path"); const fileName = "local_txt_file.txt"; const fileContent = join(__dirname, fileName); const filePathtoCreate = "./folder/test_file.txt"; // Perform the create file operation const file = await application.files.create(fileContent, filePathtoCreate); console.log(file); // Boolean (true or false) ``` ## Deleting a file `application.files.delete()` returns a Boolean. ```javascript theme={null} const application = await api.applications.get("Application ID"); const deleted = await application.files.delete("index.js"); console.log(deleted); // Boolean (true or false) ``` # App Cache Source: https://docs.squarecloud.app/en/sdks/py/advanced/app_cache Learn how to use the App cache. When a request is made, it returns application information and caches it in the Application object itself. This is useful if you need to access this information again in a relatively short time, meaning it's not worth making a new API request for updated data. In such cases, you can access `Application.cache`. ```python theme={null} import squarecloud as square client = square.Client('API_KEY') async def example(): app = await client.app('application_id') # Note that, as no requests have been made, * in the cache will be None print(app.cache.logs) # None print(app.cache.status) # None print(app.cache.backup) # None # Now let's make some requests await app.logs() await app.status() await app.backup() # The cache has been updated 🤯 print(app.cache.logs) # LogsData(...) print(app.cache.status) # StatusData(...) print(app.cache.backup) # BackupData(...) ``` ## Making requests without updating the cache If, for some reason, you don't want to update the cache when making a request, you can pass the `update_cache=False` argument. ```python theme={null} import squarecloud as square client = square.Client('API_KEY') async def example(): app = await client.app('application_id') await app.status(update_cache=False) print(app.cache.status) # None ``` If the arguments you pass to `cache.update` are not an instance of `StatusData`, `LogsData`, or `BackupData`, a `SquareException` error will be raised. ## Manually clearing the cache You can manually clear the cache using `cache.clear`. ```python theme={null} import squarecloud as square client = square.Client('API_KEY') async def example(): app = await client.app('application_id') await app.status() print(app.cache.status) # StatusData(...) app.cache.clear() print(app.cache.status) # None ``` ## Manually updating the cache You can also manually update it using the `cache.update` method. ```python theme={null} import squarecloud as square client = square.Client('API_KEY') async def example(): app = await client.app('application_id') logs = await app.logs() status = await app.status() backup = await app.backup() app.cache.clear() # Clears the cache app.cache.update(status, logs, backup) # Updates the cache print(app.cache.logs) # LogsData(...) print(app.cache.status) # StatusData(...) print(app.cache.backup) # BackupData(...) ``` # Listeners Source: https://docs.squarecloud.app/en/sdks/py/advanced/listeners Learn how to use listeners in your application using the squarecloud python sdk. Sometimes it's very useful to have listeners for requests, allowing you to implement features that need to be called whenever "something" happens in your application. Two types of listeners have been added for this purpose. ## Capture Listener For example, imagine that every time a request to the '/logs' route is made, my code performs a task that checks if the new logs differ from the old ones. Well, let's see how this can be done: ```python theme={null} import squarecloud as square from squarecloud import Endpoint @app.capture(endpoint=Endpoint.logs()) async def on_logs_request(before, after): if after != before: print(f'New logs!!! {after}') async def main(): client = square.Client('your api key') app = await client.app('application_id') await app.logs() # True await app.logs() # False ``` As seen above, by using the app.capture decorator on a function, this function will be called every time a request is made to the endpoint specified in the decorator. The accepted endpoints are `APP_STATUS`, `LOGS`, or `BACKUP`. This function should take two parameters: * `before`(represents the state after the request) * `after`(represents the state before the request) The data type returned by `before` and `after` depends on which endpoint the listener is "listening" to. If it is the **APP\_STATUS** route, it will receive a `StatusData`, **LOGS** will receive a `LogsData`, and **BACKUP** will receive a `BackupData`. As you may have noticed in the example above, the first time the comparison between the logs occurs, `after != before` returns True. This happens precisely because after is equal to `LogsData(logs='')`, as there is still nothing stored in the cache internally. * If you use discord.py or some fork (you probably use), you should know that what differentiates events is the name of the functions that the decorator wraps, but here it differs. To know which API route the decorator needs to "listen" to, we use the `endpopint` parameter, it receives an `Endpoint` class, so the name of the function that the decorator wraps is up to you. * The function that the decorator wraps can actually be anything that is a callable. This includes regular functions, coroutines, and even classes (`__init__` will be called). * If the endpoint is not an \[Endpoint.app\_status()], \[Endpoint.logs()], or \[Endpoint.backup()], only a `response` parameter (of type `squarecloud.http.Response`) will be returned. You can use the `avoid_listener=True` parameter so that the application listener is not called. ## Request Listener The "request listeners" do pretty much the same thing. But here you use the \[Client], and the return of all endpoints is `squarecloud.http.Response` objects. ```python theme={null} import squarecloud as square from squarecloud import Endpoint @client.on_request(endpoint=Endpoint.logs()) async def on_logs_request(response): print(1, response) async def main(): client = square.Client('your api key') await client.get_logs(app_id='application_id') # 1, Response(success) ``` ## Passing extra arguments You can pass to some methods keyword argument called `extra`, and this will be passed to your listener ```python theme={null} import squarecloud as square from squarecloud import Endpoint @client.on_request(Endpoint.status()) async def get_extra_param(before, after, extra: dict[str, str]): print(extra) async def main(): client = square.Client('your api key') await client.app_status('application_id', extra={'name': 'robertinho'}) ``` You can get some cool features in listeners using pydantic in your project, take a look at [using pydantic](./using_pydantic) # Using pydantic Source: https://docs.squarecloud.app/en/sdks/py/advanced/using_pydantic Learn how to use pydantic to data validation. ## What is pydantic? Pydantic is an awesome and modern Python library for data validation using type annotations. It enforces type constraints, ensuring data consistency and providing clear error messages when validation fails. Pydantic is both powerful and easy to use, making it a popular choice for developers working with structured data. ## Installation To use Pydantic with this SDK, you need to install the SDK with the pydantic extra dependency, as it is not included by default: ```bash theme={null} pip install "squarecloud[pydantic]" ``` ## Features In this SDK, Pydantic is used to cast an extra parameter from a dictionary into a Pydantic model, allowing for more robust data validation and manipulation. ```python theme={null} import squarecloud as square from squarecloud import Endpoint from pydantic import BaseModel class Animal(BaseModel): name: str age: int @client.on_request(Endpoint.status()) async def get_extra_param(before, after, extra: Animal): print(extra.name) print(extra.age) async def main(): client = square.Client('your api key') await client.app_status('application_id', extra={'name': 'felix', 'age': 3}) ``` In this example, the Animal class is a Pydantic model with two fields: name and age. When a request is made to the status endpoint, the extra parameter is automatically cast into an Animal instance, allowing you to easily access and validate the data. # Client Source: https://docs.squarecloud.app/en/sdks/py/client The central object is the Client object, instantiated with an API key. This object represents a connection to the Square Cloud service and acts as an interface to interact with various aspects of the service. ```python theme={null} import squarecloud as square client = square.Client(api_key='API_KEY') async def example(): app_status = await client.app_status('application_id') print(app_status) ``` ## Parameters: * api\_key `api_key: str`: This is the required parameter when instantiating the Client object. A valid API key must be provided as a string for authentication to be performed correctly. * debug `debug: bool = True`: This is an optional parameter that controls the debug mode of the Client object. When set to True, every time a request is made, the Client object prints debug information to facilitate the detection and resolution of issues. However, in production environments, it is common to set this parameter to False to avoid displaying unnecessary information. This value defaults to True. ## Application Using the \[Client], you can obtain an object (or a list of objects) that represents your application. This object would be an instance of the Application class that you can use to manage your application more conveniently, without always needing to pass the id of your application. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application id') print(app) # ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): apps = await client.all_apps() print(apps) # list[] ``` # Commit and Upload Source: https://docs.squarecloud.app/en/sdks/py/commit_and_upload In this section you will learn how to make commits and uploads using the Client, Application and CLI. You can make commits and uploads using Client or Application. You just need a `squarecloud.File` object and pass the path where your zip file is. ## Making a commit ```python theme={null} import squarecloud as square client = square.Client('API_KEY') async def example(): file = square.File('path/to/you/file.zip') await client.commit(file=file, app_id='application_id') ``` ```python theme={null} import squarecloud as square client = square.Client('API_KEY') async def example(): app = await client.app(app_id='application_id') file = square.File('path/to/you/file.zip') await app.commit(file=file) ``` ## Making a upload To upload an application, you can use only the \[Client]. ```python theme={null} import squarecloud as square client = square.Client(...) async def example(): file = square.File('path/to/you/file.zip') await client.upload_app(file=file) ``` **Remember that to upload an application you need a zip that contains (at least) the following files:**: * Main file: responsible for starting your application * Dependencies file: contains information about which dependencies are necessary * Configuration file (squarecloud.app): a configuration file specifying the name, description, main file name, version, etc. To learn more about the configuration file, take a look at this [guide](https://docs.squarecloud.app/en/getting-started/config-file). For your convenience, a class has been added to create this configuration file: `squarecloud.utils.ConfigFile`. # Deployments Source: https://docs.squarecloud.app/en/sdks/py/deployments This guide provides examples on how to integrate and manage application deployments using this SDK. You will learn how to create GitHub integrations, retrieve current integration details, and view the latest deployments using both the client and application objects. ## Create Integration ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): webhook_url = await client.github_integration( 'application_id', access_token='access_token' ) print( webhook_url ) ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') webhook_url = await app.github_integration(access_token='access_token') print( webhook_url ) ``` ## Obtaining Current Integration ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): webhook_url = await client.current_app_integration( 'application_id', ) print(webhook_url) ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') webhook_url = await app.current_integration() print( webhook_url ) ``` ## Last Deploys ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): deploys = await client.last_deploys('application_id') print(deploys) # [[DeployData(...), DeployData(...), DeployData(...)]] ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') deploys = await app.last_deploys() print(deploys) # [[DeployData(...), DeployData(...), DeployData(...)]] ``` # Installation Source: https://docs.squarecloud.app/en/sdks/py/installation Learn how to install the squarecloud-api package for seamless integration into your projects ```bash theme={null} pip install squarecloud-api ``` Now you can seamlessly integrate the squarecloud-api into your development workflow 😊. # Managing Applications Source: https://docs.squarecloud.app/en/sdks/py/managing_application In this section, you will learn how to manage your application using the available library. You can interact with your application in various ways, such as obtaining information about the application status, accessing logs, starting, stopping, and restarting the application, as well as managing files associated with it. [Client]: client [Application]: client#aplication All operations below can be performed by either the [Client] class, the [Application] class and the CLI. Below are examples of how to perform each of these tasks using both classes: ## Getting the status of your application `client.app_status` and `app.status` return a `StatusData` object. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): status = await client.app_status('application_id') # StatusData(...) print(status.ram) # '70MB' print(status.cpu) # '5%' print(status.network) # {'total': '0 KB ↑ 0 KB ↓', 'now': '0 KB ↑ 0 KB ↓'} print(status.running) # True | False print(status.storage) # '0B' ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') # StatusData(...) status = await app.status() print(status.ram) # '70MB' print(status.cpu) # '5%' print(status.network) # {'total': '0 KB ↑ 0 KB ↓', 'now': '0 KB ↑ 0 KB ↓'} print(status.running) # True | False print(status.storage) # '0B' ``` ## Getting logs `client.get_logs` and `app.logs` return a `LogsData` object. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): logs = await client.get_logs('application_id') print(logs) # LogsData(logs='Hello World!') print(logs.logs) # 'Hello World' ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') logs = await app.logs() print(logs) # LogsData(logs='Hello World!') print(logs.logs) # 'Hello World' ``` ## Starting the application `client.start_app` and `app.start` return a `Response` object. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): await client.start_app('application_id') ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') await app.start() ``` ## Stopping the application `client.stop_app` and `app.stop` return a `Response` object. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): await client.stop_app('application_id') ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') await app.stop() ``` ## Restarting the application `client.restart_app` and `app.restart` return a `Response` object. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): await client.restart_app('application_id') ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') await app.restart() ``` ## Deleting an application `client.delete_app` and `app.delete` return a `Response` object. This will delete your application **PERMANENTLY**, meaning that unless you have a backup of your application, it cannot be recovered. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): await client.delete_app('application_id') ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') await app.delete() ``` # Managing Files Source: https://docs.squarecloud.app/en/sdks/py/managing_files In this section, you will find information and examples on how to manipulate the files associated with your application. Learn how to list, read, create, and delete files using the Client or the Application class for efficient resource administration of your application. [Client]: client [Application]: client#application All operations below can be performed by either the [Client] class, the [Application] class and the CLI. Below are examples of how to perform each of these tasks using both classes: ## Getting a list of files `client.app_files_list` and `app.files_list` return a list of `FileInfo` objects. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): files_list = await client.app_files_list(app_id='application_id', path='/') for file in files_list: print(file.name) # 'main.py' print(file.type) # 'directory' or 'file' print(file.size) # 2140 print(file.lastModified) # 1677112835000 ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') files_list = await app.files_list(path='/') # list[FileInfo(...)] for file in files_list: print(file.name) # 'main.py' print(file.type) # 'directory' or 'file' print(file.size) # 2140 print(file.lastModified) # 1677112835000 ``` ## Reading a file `client.read_app_file` and `app.read_file` return a `BytesIO` object. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): file_bytes = await client.read_app_file( app_id='application_id', path='main.py' ) print(file_bytes) # b'01101000 01101001' ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') file_bytes = await app.read_file(path='main.py') print(file_bytes) # b'01101000 01101001' ``` ## Creating a file `client.create_app_file` and `app.create_file` return a `Response` object. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): await client.create_app_file( app_id='application_id', path='/file.txt', file=square.File('file.txt') ) ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') await app.create_file(path='/file.txt', file=square.File('file.txt')) ``` ## Deleting a file `client.delete_app_file` and `app.delete_file` return a `Response` object. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): await client.delete_app_file(app_id='application_id', path='/file.txt') ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') await app.delete_file(path='/file.txt') ``` ## Moving a file `client.move_app_file` and `app.move_file` return a `Response` object. ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): await client.move_app_file( app_id='application_id', origin='path/to/origin/file.py', dest='path/to/destination/file.py', ) ``` ```python theme={null} import squarecloud as square client = square.Client(api_key='API KEY') async def example(): app = await client.app('application_id') await app.move_file( origin='path/to/origin/file.py', dest='path/to/destination/file.py' ) ```