Git Product home page Git Product logo

microsvc's Introduction

microsvc

microsvc is a tiny reusable framework for building microservices with messaging and rest

Installation

npm install -g microsvc

Dependencies

microsvc uses hub by github in order to create repositories on github for you. Follow hub's official instructions to install and configure hub on your machine.

microsvc uses gitslave to create a metarepo that handles performing commands across any number of attached repositories. Gitslave may be installed via brew install gitslave, but note you may find an issue with using the command gits status on macs with newer versions of git. To escape that fun little problem, we've made our own fix and made it available to you as an npm package via npm i gitslave -g. You're welcome!

Usage

> microsvc create system <system_name>
# creates a new microsvc system that acts as a meta project to
# house all other service, site, api, and etc. repos.
# microsvc systems are managed using gitslave.

> microsvc create service <service_name>
# creates a new microsvc service which

> microsvc create handler <FILE_NAME>
# creates a new handler in the current directory
# with the provided routingKey and additional options

> microsvc create blank <PROJECT_NAME>
# creates a new blank project

microsvc create system

This project acts as a meta project to house all other service, site, api, etc repos.

To most easily work on all repos in unison, use gitslave. A good intro example of gitslave usage can be found (here)[http://gitslave.sourceforge.net/tutorial-basic.html].

To get started, download gitslave and perform the following operation in the development directory of your choice: 'gits clone [email protected]:example/repo.git'.

microsvc create system <SYSTEM_NAME>

microsvc create service

Creates a new service with example handlers and api exposed. The service also comes configured with configuration management using cconfig, logging with llog, and servicebus for messaging.

microsvc create service <SERVICE_NAME>

microsvc create handler

Creates a new handler with the provided routingKey and additional options.

microsvc create handler <FILE_NAME>

Options:

-h, --help                      output usage information
-V, --version                   output the version number
-s, --subscribe                 create subscribe handler (defaults to listen)
-r, --routingKey [routing key]  set the routing key name
-q, --queueName [queue name]    set the queue name
-a, --ack                       set ack=true to create persistent queue and durable messages
-t, --type [message type]       filter to a specific message type
-w, --where [where clause]      provide a where clause

microsvc create blank

Creates a new blank project initialized with README, .gitignore, and Makefile.

microsvc create blank <PROJECT_NAME>

microsvc technology

supporting technology

microsvc's People

Contributors

patrickleet avatar allain avatar johannbotha avatar

Stargazers

 avatar  avatar DandiestSquare1 avatar Dima Khadorkin avatar  avatar Carlos Justiniano avatar Liam Griffiths avatar Ken Warner avatar  avatar Henry Hz avatar Sveinung Tord Røsaker avatar

Watchers

 avatar Matt Walters avatar James Cloos avatar Dima Khadorkin avatar

microsvc's Issues

Unable to start a new system

I'm trying to get started with microsvc
I have installed hub and gitslave, as well as made sure I'm authenticated with GitHub in hub.
Node: v8.9.0
NPM: 5.5.1

# DEBUG=* microsvc create system saint-next
creating new system 'saint-next'...
  exec running 'git init' in cwd /Users/mikpet/Project/saint-next +0ms
Initialized empty Git repository in /Users/mikpet/Project/saint-next/.git/

  exec running 'hub create saint-next' in cwd /Users/mikpet/Project/saint-next +17ms
Updating origin

created repository: Evanion/saint-next

finished creating new system 'saint-next'...
type 'cd ./saint-next && npm i && make run' to initialize and run

This creates a folder with Makefile, yml file, and readme file. I noticed that the command referenced in the end of the output calls NPM .. but I don't see any package.json in the folder. I figure it might be some clever stuff, so I press on:

# cd ./saint-next && npm i && make run
npm WARN saveError ENOENT: no such file or directory, open '/Users/mikpet/Project/saint-next/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/mikpet/Project/saint-next/package.json'
npm WARN saint-next No description
npm WARN saint-next No repository field.
npm WARN saint-next No README data
npm WARN saint-next No license field.

up to date in 0.061s
/Library/Developer/CommandLineTools/usr/bin/make run-only
mkdir -p ~/.tmuxinator
cp ./tmuxinator.all.yml ~/.tmuxinator/saint-next.yml
NO_WEB= mux saint-next
/bin/sh: mux: command not found
make[1]: *** [run-only] Error 127
make: *** [run] Error 2

Well I might as well run the last step as well:

# microsvc create service client-gateway
creating new microsvc 'client-gateway'...
Initialized empty Git repository in /Users/mikpet/Project/saint-next/client-gateway/.git/

Evanion/client-gateway already exists on github.com

origin	[email protected]:Evanion/saint-next.git (fetch)
origin	[email protected]:Evanion/saint-next.git (push)

set remote origin: Evanion/client-gateway

[master (root-commit) de58c26] initial commit
 13 files changed, 307 insertions(+)
 create mode 100644 .npmignore
 create mode 100644 Makefile
 create mode 100644 README.md
 create mode 100644 api.js
 create mode 100755 bin/client-gateway-svc
 create mode 100644 config.json
 create mode 100644 lib/bus.js
 create mode 100644 lib/handlers/listen.js
 create mode 100644 lib/handlers/subscribe.js
 create mode 100644 package.json
 create mode 100644 routes/index.js
 create mode 100644 service.js
 create mode 100644 test/index.js

Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.

ERROR: Repository not found.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Cloning into 'client-gateway'...

warning: You appear to have cloned an empty repository.

error: pathspec '/Users/mikpet/Project/saint-next/.gitslave' did not match any file(s) known to git.

finished creating new microsvc 'client-gateway'...
type 'cd ./client-gateway && npm i && make run' to initialize and run

And lets run the last command just to be complete:

# cd ./client-gateway && npm i && make run
npm WARN saveError ENOENT: no such file or directory, open '/Users/mikpet/Project/saint-next/client-gateway/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/mikpet/Project/saint-next/client-gateway/package.json'
npm WARN client-gateway No description
npm WARN client-gateway No repository field.
npm WARN client-gateway No README data
npm WARN client-gateway No license field.

up to date in 0.068s
make: *** No rule to make target `run'.  Stop.

There seems to be something wrong when I run the first command that causes all the other commands to fail.

Ability to create a blank project

Sometimes you may want to just add a new blank repository, but still want it managed as part of the microsvc project.

microsvc create blank <PROJECT_NAME>

Working on this in a new branch.

Ability to remove a project

A command to remove projects from microsvc should be created. Once projects are added, to remove you need to manually edit the .microsvc, .gitslave, and .gitignore files.

microsvc rm <PROJECT_NAME>

microsvc create system test not completing

Hello.

Running: microsvc create system test outputs:

creating new system 'test'...
Initialized empty Git repository in /home/allain/personal/test/.git/

And then freezes and does nothing until I kill it (10 minutes later)

I've installed hub, and gitslave so I think I've got what I need to get started.

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.