Documentation


maka

install

Maka can now install your meteor base application, and configure it on Linux, MacOS, and Windows 10 (without chocolatey!).

  • meteor
    $ maka install meteor
    • --version | -v

      Specify a version of meteor to install. By default, Maka will attempt to get the latest release version.

      $ maka install meteor -v 1.12.1
      $ maka install meteor -v 2.0
    • --force

      Don't prompt to verify that you are not running in sudo or administrative mode.

create

This is where we start, makes sense. With this one little command, an orchestra of installers, configurations, and string interpolations get to work building out an entire fully functioning website. By default, with no arguments, maka create will build a meteor application with a ReactJS front end. Reason being, is ReactJS is the most popular and widely supported front-end JavaScript framework.
Here is a list of possible arguments to change the creation of your application:

  • --client=react | reflux | blaze | vanilla

    React is default, if you'd like to use more sophisticated state management, you may choose the Reflux client option. Reflux operates just like React, but it provides features for creating "Stores" and the React components are abstracted through Reflux. Of course, Blaze is also an option but it has limited support for other features such as server-side-rendering, graphql, and material-ui. An important note I feel I need to make here is that React apps use react-router@3.2.1because it was (frankly) simple and later versions introduce a lot of complexity. When using Blaze, the router is flow-router.Newly added, Vanilla is a way to use meteor without any frontend framework (for the framwork-fatigued) and just uses jquery for DOM manipulation.

  • --graphql=apollo

    Using the graphql switch you can create a fully featured, full-stack, graphql service powered by Apollo GraphQL

  • --ssr=true

    This flag will add in server-side-rendering to a ReactJS application. This is only offered for React and Reflux applications, not for Blaze. (Check out the walk through: Scaffold Server-Side Rendering Web Applications with Meteor and Maka-CLI)

  • --theme=material

    Material-UI is a very popular front end styling library. It's a bit cumbersome to get setup up each time, so I added the scaffolding. Check out my walk through: Scaffold Material-UI themed React Web Applications with Maka-CLI)

  • --test=jasmine | mocha

    In order to install the testing suite, you'll need to specify which testing driver to use. If you choose Jasmine, you'll be treated to a very nice html-reporter package developed by the now dissolved group called Velocity. Mocha is the preferred testing engine by Meteor, but it lacks some of the extra attention jasmine got with Meteor in the early days.

  • --js=js | ts | jsx | tsx

    When choosing Blaze as your front end framework, you have a choice to use js extensions or to enable typescript (ts). Same goes for React/Reflux, but you would need to specify between normal javascript or typescript with jsx or tsx.

generate | g

This command will allow you to create elements of your application quickly and with structure.

  • :hook | :h

    New! Create a React Hook.

    $ maka g:hook cool-kid-hook
  • :template | :t

    The template generator is broken up into several parts: layouts, pages, components, and when applicable stores

    • --layout

      Create a new layout. By default a "master-layout" already exists in the layouts directory.

      $ maka g:t mobile-layout --layout
    • --page

      This is the default argument for template, and will create a new page. This does NOT create a new route. By default, two pages are created by default: 'home' and 'not-found'

      $ maka g:t contact --page
    • --component

      This will create a component; a reusable element to be included in your pages or layouts.

      $ maka g:t nav-bar --component
    • --store

      Only if you are creating a Reflux application, you may create new UI stores to handle global React state.

      $ maka g:t login --store
  • :route | r

    When you create new pages, this will be your primary means. By default this generator will automatically call the page template generator.

    $ maka g:route contact
    • --layout

      Specify which layout to enable this route in.

      $ maka g:route about-me --layout=MasterLayout
    • --private

      Create a private route. If you're creating new apps after version 3.1.9, your routes will look a bit different. There is now a private route that will only be rendered if a user is logged in. By default this will render into a PrivateLayout.

      $ maka g:route super-secret --private
  • :api

    This generator will scaffold out a server side resource that will contain a Mongo ORM definition, publication, rpc-methods, fixtures, and if using graphql the typedef and resolvers.

    $ maka g:api trucks
  • :collection | col

    Create a mongo collection that does not need to be accessed from the outside world. This, very simply, only creates the Mongo ORM definition.

    $ maka g:collection planes
    • --where=server | client | both

      Specify where to install the collection. By default it will be installed in the /lib path, which is common to both client and server.

      $ maka g:col private-data --where=server
      $ maka g:col public-data --where=client
      $ maka g:col bit-of-both-data --where=both
  • :dbc

    While Meteor comes prebaked with Mongo, it's very useful to be able to connect to other databases.
    There are three options: PostgreSQL (pgsql), MySQL (mysql), and Microsoft SQL (mssql).

    • --type=pgsql | mysql | mssql

      For each of these options, the proper npm drivers will be installed and two files will be generated. A config and a connection file.

      $ maka g:dbc geoserver --type=pgsql
  • :package

    If you would like to create a sub package, this will scaffold out the required files needed to make a Meteor Atmosphere package. If you don't want to publish your package on Meteor's Atmosphere, you may omit your Meteor developer user name and just define the package name.

    $ maka g:package maka:new-thing
  • :scaffold

    A more complete generator, this will scaffold out an API resource, a page, and a route.

    $ maka g:scaffold Todos
  • :service | s

    A generator designed to scaffold out non-meteor specific services that run along with your application.

    • --type=logger

      Currently, there is only a logger service that leverages the npm module winston

      $ maka g:s logger --type=logger
  • :configuration | config

    A generator which will create configuration environments.

    • Configuration directories now contain several files needed to configure and deploy your meteor app. The focus is on two main production level packages:

      PM2"Advanced, production process manager for Node.js"Nginx"Open source web server that powers 400 million websites"NVMWill allow your node version to stay in line with what Meteor needs.

      $ maka g:config staging
      • ssh.json - contains ssh connection information
      • pm2.config.js - configuration for pm2
      • settings.json - Your app config for client and server.
      • process.env - Node environment variables to simulate production settings.
      • nginx.conf - Nginx config to work with Meteor
      • deploy.sh - Deployment configuration, run remotely
      • letsencrypt.json - LetsEncrypt configuration
pro

aws

This is a proxy command to the AWS-CLI. You must have the AWS CLI installed and configured with your credentials before using.
Install AWS CLI v2

For a walk through of deploying to AWS: Deploy to AWS using Maka-CLI

$ maka aws create-instance --env prod
  • create-instance | ci

    • --env

      When creating a new instance, you'll need to specify which environment you would like associate to. By default, this is this production environment.

      $ maka aws ci --env
      $ maka aws ci --env staging
  • set-host

    Associate a AWS EC2 with an environment, and store the IP of either the public or private host in your ssh.json file.

    $ maka aws set-host
  • create-key-pair

    • --env

      When creating a new key-pair, you'll need to specify which environment you would like associate to. By default, this is this production environment.

      $ maka aws create-key-pair
      $ maka aws create-key-pair --env staging
    • --name

      You may pass the name of the key pair, or await a prompt.

      $ maka aws create-key-pair --name=key-pair-1
  • create-sg

    Every EC2 instance needs a security group.

    • --ssl

      If you're going to run this EC2 over SSL (recommended) set this flag to open port 443.

      $ maka aws create-sg --ssl
    • --name

      You may pass the name of the security group, or await a prompt.

      $ maka aws create-sg --name=sg-1
  • describe-instances | di

    $ maka aws describe-instances
    $ maka aws di
  • reboot-instance

    $ maka aws reboot-instance
  • terminate-instance | ti

    $ maka aws terminate-instance
    $ maka aws ti

deploy

This command will build, deploy and configure your application on a remote Linux (ubuntu) host.

For a walk through of deploying to AWS: Deploy to AWS using Maka-CLI

  • --env

    Required

    $ maka deploy --env prod 
    $ maka deploy --env staging
  • --mongo

    This option can be good in a staging environment, where you don't need a production level mongo db install. It can also be very useful for prototyping!

    $ maka deploy --env staging --mongo
  • --ssl | --ssl=letsencrypt

    When passing the --ssl option, you can choose between configuration your own SSL - generate the private key, cert signing request, and use an SSL provider to acquire a certificate. OR, use the amazing "Letsencrypt" service to automagically configure your SSL certificate... for FREE!

    $ maka deploy --env staging --ssl=letsencrypt
  • --force

    There are a couple of questions Maka-CLI will ask you when you proceed to deploy, if you'd like to accept them all, use the --force argument.

    $ maka deploy --env staging --force

reconfigure | reconfig | recfg | rcfg

Helpful command to send up the PM2 configuration and settings.json file and reconfigure the PM2 service.

  • --env

    Required

    $ maka rcfg --env prod 
    $ maka reconfig --env staging

ssh

If your ssh.json is configured for an environment, you'll be able to perform various SSH operations against the target host. And, of course, you can ssh into the host.

  • --env

    Required

    $ maka ssh --env staging
    $ maka ssh --env prod 'npm -i g vtop'
    $ maka ssh --env prod 'pm2 monit'

logs

This is a new command that will display the logs of the Pm2 service and soon to also output the logs of the Nginx service

  • --env

    Required

    $ maka logs --env staging