In this documentation, you will learn how to create a LeanEngine project, debug it locally, and deploy your project to the cloud.
Creating a Project
Creating a Project with Command-Line Interface (Recommended)
Before creating a project, make sure you have installed the command-line interface according to Command-Line Interface. To check if it is installed properly, run the following command:
lean help
You will see the help information if everything is good.
Now run the following command to create a project:
lean init
Follow the prompts to enter the project information.
Creating a Project from a Template
You can use our sample project as a skeleton to start your project. Run the following command to clone the sample project from GitHub:
git clone https://github.com/leancloud/node-js-getting-started.git
cd node-js-getting-started
git clone https://github.com/leancloud/python-getting-started.git
cd python-getting-started
git clone https://github.com/leancloud/slim-getting-started.git
cd slim-getting-started
git clone https://github.com/leancloud/java-war-getting-started.git
cd java-war-getting-started
Now go to the directory of the sample project and run the following command to add your App ID to it:
lean switch
Running the Project Locally
Run the following command to install dependencies for your project:
npm install
pip install -Ur requirements.txt
composer install
mvn package
Now you are good to run your project:
lean up
Accessing the Site
Open your browser and go to http://localhost:3000. You will see the following content:
Try adding a todo item at http://localhost:3000/todos and then go to your app's dashboard. You will see a new item in the class Todo with its content as the string you just entered. See LeanStorage guides for more instructions about how it could be implemented.
Deploying Your Project to the Cloud
Run the following command to deploy your project to the production environment (if you haven't purchased a standard instance):
lean deploy
If you have a second-level domain set up, you will be able to access your project via http://${your_app_domain}.avosapps.us.
If you have purchased a standard instance, your project will be deployed to the staging environment first when you run lean deploy. To deploy it to the production environment, run lean publish:
LeanEngine Quick Start
In this documentation, you will learn how to create a LeanEngine project, debug it locally, and deploy your project to the cloud.
Creating a Project
Creating a Project with Command-Line Interface (Recommended)
Before creating a project, make sure you have installed the command-line interface according to Command-Line Interface. To check if it is installed properly, run the following command:
You will see the help information if everything is good.
Now run the following command to create a project:
Follow the prompts to enter the project information.
Creating a Project from a Template
You can use our sample project as a skeleton to start your project. Run the following command to clone the sample project from GitHub:
Now go to the directory of the sample project and run the following command to add your App ID to it:
Running the Project Locally
Run the following command to install dependencies for your project:
Now you are good to run your project:
Accessing the Site
Open your browser and go to http://localhost:3000. You will see the following content:
The router of the site is defined as follows:
Creating a Todo Item
Try adding a todo item at http://localhost:3000/todos and then go to your app's dashboard. You will see a new item in the class
Todo
with itscontent
as the string you just entered. See LeanStorage guides for more instructions about how it could be implemented.Deploying Your Project to the Cloud
Run the following command to deploy your project to the production environment (if you haven't purchased a standard instance):
If you have a second-level domain set up, you will be able to access your project via
http://${your_app_domain}.avosapps.us
.If you have purchased a standard instance, your project will be deployed to the staging environment first when you run
lean deploy
. To deploy it to the production environment, runlean publish
: