๐Ÿš€ 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.
  • Next, you will need to create an account on Square Cloud, which can be done through the login page. You can use either your email or Discord, or both, 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.

โš™๏ธ Creating the squarecloud config file

Learn about: how to make the configuration file for Square Cloud.

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.
  • 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:

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

๐Ÿ“ค 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 and upload your project files.

If you continue to experience any issues, please donโ€™t hesitate to contact our support team.