syncano-cli v0.55.0
Quickstart Guide
A small teaser of what you will have build in a couple of minutes from now:

Tutorial steps: 1. Cloning an example repository with a simple front-end project (a chat app) 2. Syncano CLI installation 3. Signing up and creating a Syncano project 4. Installing a Syncano Socket 5. Configuring the front-end 6. Deploying your application to the cloud
You can test the app live at this url: https://production--chat-app.syncano.site/
Clone the example repository
First git clone the sample Chat project by going to your terminal application and running:
git clone https://github.com/Syncano-Community/chat-app.git
cd chat-appInstall the Syncano CLI
In order to use the Syncano CLI you will have to install the following dependencies:
The syncano-cli is the main tool for setting up and managing your projects on the Syncano Platform. To install it, run:
npm install -g syncano-cliSign up and create a project
Once the Syncano CLI is installed you can sign up for an account. Run the following command in the root directory of your project:
syncano-cli initYou'll be asked for an email and password so that we can create an account for you.
You'll also be prompted for a project template. Choose the recommended Hello World template and press enter.

Install a Syncano Socket
Now, we will install the chat socket from the Syncano Registry.
Sockets are modules that enclose a piece of functionality needed for your app. The difference is, that instead of functions they expose endpoints for communication with the server, and emit events so that integrations with other sockets are possible. You can find out more about the Sockets concept in the Sockets Overview section.
syncano-cli add chat
This command will add a chat Socket as a dependency of your project. It has everything that is needed for your chat application front-end to work. By now your chat-app project structure should look like this:

Run
syncano-cli list chatto view the Socket documentation
To make sure it has been added correctly, you can open the /chat-app/syncano/syncano.yml and see if these lines are present:
The chat app Socket you installed may have a higher version number
dependencies:
sockets:
chat:
version: 0.0.1Configure your front-end
The only change you need to make in the code is in the ./web/index.html file. Open it and replace the INSTANCE_NAME with your Instance name in the 8th line:

To find out your Instance name you can run
syncano-clicommand. It will be printed as aCurrent Instance.
Deploy your project
Now it's time to deploy your app. To do this, run the following command:
syncano-cli hosting add ./web
Choose the defaults when prompted and type y and press enter when asked Do you want to sync files now?
Your web assets will be published under the url printed by the Syncano CLI. It should have this format: https://staging--<instance name>.syncano.site/. Go to this url to see the published project. Open the url in two tabs to experience the realtime in action.
Ok, but What has just happened!?
You have successfully configured and deployed a full stack, realtime chat application. Well done!
How did it happen? Here's a quick rundown:
- When running
syncano-cli add chatyou have connected toSyncano Registrywhich contains components that you can integrate into your app. Runsyncano-cli search [term]to discover more Sockets. - The
chatSocket was added as a dependency in thesyncano.ymlfile. All the dependencies installed from theSyncano Registrywill be present in this file - By providing the
instance_namein theindex.htmlyou simply configure your web app to use your API. TheSyncano Clientlibrary handles the rest. - When running
syncano-cli deploy chat, you tell Syncano to read from thesocket.ymlspec and, based on it, build your own API endpoints. The endpoints are available for use instantly after thedeploycommand is finished. To keep your local changes in sync with the Instance during development you can use thesyncano-cli deploy --hot [socket-name]command syncano-cli hosting addis the last command. It publishes your static web assets from thewebfolder and hosts them on Syncano.
That's it! If you have any questions, log into our Slack and chat with the community. Happy coding!
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago