/demo-todo

Microservices boilerplate for Mutable app

Primary LanguageJavaScript

Welcome

This repo is meant to help you navigate the Mutable app and managing your service stack. We provided a boilerplate project and a walkthrough for using the Mutable app

Services

This stack uses our prepared boilerplate services available in Mutable's public repos.

Backend service: Repo
Frontend service: Repo
Proxy service: Repo

Setup instructions

  1. Create a mutable folder where your mutable projects will be located. Only projects inside this folder will show up inside Mutable application.
  2. Git clone this repository into the mutable folder you created.
  3. In Mutable application settings, write the directory of your mutable folder, then hit the save button on the bottom. screen shot 2019-01-21 at 5 33 46 pm
  4. In terminal, navigate inside the three folders backend, frontend, proxy and npm install them.
  5. Execute npm run build inside frontend folder.
  6. In terminal, open /etc/hosts file by sudo nano /etc/hosts command and add the following row at the end: 127.0.0.1 mutable.local
  7. Inside Mutable application, navigate into boilerplate-node-react stack, then proxy service, then to Configuration tab screen shot 2019-01-21 at 5 44 14 pm
  8. Add the routing settings below and hit the Save button. This lets services know where to redirect different routes.
{
	"hosts": {
		"mutable.local": {
			"routes": {
				"api": {
					"target": "http://backend/[~]"
				}
			},
			"target": "http://frontend/[~]"
		}
	},
	"page404": "<html><head><style>h1{margin: auto; position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: 100px; font-family: ‘arial’; font-weight: 100; color: #555; text-align: center; }body{background:#eee;}</style></head><body><h1>404 Not Found</h1></body></html>",
	"publish": [
		"backend",
		"frontend"
	]
}
  1. Run backend, frontend and proxy services. Then open your browser and visit mutable.local:8888

And thats it. You can add more services and api endpoints, by creating them and then editing the Configuration settings of the Proxy service to match the api call with its intended target and then publishing it by adding to the "publish" field.