Git Product home page Git Product logo

mandrake's Introduction

๐ŸŽฉ Mandrake

Currently this a mirror of my local work on other DVCS | to update: git push github master

Mandrake is an application generator for Clever-Cloud:

  • it helps you with providing walking skeletons of web applications or addon
  • and with creating and pushing your application on Clever-Cloud for the first-time
  • when you'll feel confident, you'll be able to add your own templates of creation

WIP

Currently, Mandrake doesn't run on Windows (but WIP)

prerequisites

You have to install the Clever-Cloud CLI: https://www.clever-cloud.com/doc/clever-tools/getting_started/

Install

  • git clone this repository
  • cd mandrake
  • npm install
  • npm link

Tips: to remove the link: open /usr/local/bin/ and remove the link

Use

mandrake comes with several default templates (see the /templates directory). Here, this is a tutorial on how to use some of these generators to create a microservices architecture:

Vert-x discoverable microservice

I want to create a microservices architecture with Vert.x, Scala and Redis.

I'm going to create:

  • a redis Clever-Cloud addon, because I use the Redis Vert.x Discovery Backend
  • a Vert.x microservice
  • a Vert.x web application to call the microservice

Initialization

So, first, create a directory (and go inside), and launch mandrake:

mkdir microservices-demo
cd microservices-demo
mandrake

The first time you run mandrake in an empty directory, mandrake copies the default templates in the current directory...

01

... And mandrake creates a small database to keep project informations

02

Redis Addon

Select the addon-redis-small (mandrake will create and deploy a "small" redis database on Clever-Cloud)

03

Explain:

  • where you want to deploy the redis database
  • type the name of your organization on Clever-Cloud
  • give a name to your addon and type enter

04

Microservice application

Run mandrake again, and choose the app-discoverable-ms-vertx-scala-m item (mandrake will create and deploy a scala application on an sized "M" instance on Clever-Cloud)

05

Then, explain:

  • where you want to deploy the microservice
  • type the name of your organization on Clever-Cloud
  • give a name to your project
  • give a display name
  • give a domain name
  • give a name to the main scala file (the source code and the project structure will be generated by mandrake)
  • give an id for the microservice (it will be registered with it)
  • type the name of the previous redis addon and type enter

06

So, mandrake will create the git repository, the project structure and deploy it to Clever-Cloud

07

You can check that the application and the addon have been created and deployed to Clever-Cloud:

08

And this is the generated code:

09

Once the microservice deployed, you can check the redis database:

10

And try the operations of the microservice:

Now, it's time to create the code to use this microservice.

Web application to "call" the microservice

There is a template generator for this too.

Run mandrake again, and choose the app-invoke-ms-vertx-scala-m item (mandrake will create and deploy a scala application on an sized "M" instance on Clever-Cloud)

11

Then, explain:

  • where you want to deploy the microservice
  • type the name of your organization on Clever-Cloud
  • give a name to your project
  • give a display name
  • give a domain name
  • give a name to the main scala file (the source code and the project structure will be generated by mandrake)
  • give the id of the microservice to call
  • type the name of the previous redis addon and type enter

12

So, mandrake will create the git repository, the project structure and deploy it to Clever-Cloud

13

You can check that the application has been created and deployed to Clever-Cloud:

14

And this is the generated code:

15

Now you can call the two demo routes of the web application:

That's all! โœŒ๏ธ

Now each time you update a project, you just have to do this to deploy again:

git add .
git commit -m "my new killer feature"
git push clever master # if you want to deploy the master branch

Create a template

WIP

Application template

WIP

Addon template

WIP

Command template

WIP

Roadmap

WIP

mandrake's People

Contributors

k33g avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.