This is a sample application built with a CLEAN stack (CLoudant NoSQL database, Express, Angular and Node.js).
If you are looking for the ORIGINAL step-by-step tutorial, look at this branch.
This version contains some changes related to autoscaling service. You can watch the german YouTube playlist: https://www.youtube.com/watch?v=bu_7eYvRJmY&list=PLUte4WEyMEjVPJ0mESXM4jgQvYlEmUwCF
-
Create a IBM Cloud Account
Sign up for IBM Cloud, or use an existing account.
-
Download and install the Cloud-foundry CLI tool
-
Clone the app to your local environment from your terminal using the following command
git clone https://github.com/thomassuedbroecker/todo.git
-
cd into this newly created directory
-
Connect to IBM Cloud in the command line tool and follow the prompts to log in. Note: Optional with -sso
$ bx login -a https://api.eu-de.bluemix.net
-
Create the Cloudant service in IBM Cloud and bind to Cloud Foundry App
$ bx cf create-service cloudantNoSQLDB Shared todo-cloudant
- Push the application to IBM Cloud.
$ bx cf push
- Watch the logs of the application in IBM Cloud.
$ bx cf logs todo
- Get the number of app instances in IBM Cloud.
$ bx cf apps
And voila! You now have your very own instance of the Todo application running on IBM Cloud.
Navigate to the application url, e.g. <application-host>.mybluemix.net
to create Todo.
Note: You can change the color of the kill button, with the btn btn-danger btn-lg statement inside the public/index.html in line 67.
You can run the application locally, connecting to the Cloudant service running in IBM CLoud. To do so you need we will create one file to store the Cloudant credentials. These credentials can be retrieved in the IBM IBM Cloud dashboard.
To run the application locally, you will need:
-
Copy template.vcap-local.json to vcap-local.json
-
Edit vcap-local.json and fill in the url of the Cloudant database
-
In the project directory, run:
$ npm install
This will get all the server-side and client-side (through bower) dependencies for the project.
- Start the application
$ npm start
The console output will look like:
Loaded local VCAP { services: { cloudantNoSQLDB: [ [Object] ] } }
Initializing database...
Creating database...
server starting on http://localhost:6020
Setting current database to todos
See License.txt for license information.
Based on scotch-io/node-todo
This is a sample application created for the purpose of demonstration and learning The program is provided as-is with no warranties of any kind, express or implied.