Documentation


maka

help

Help is now the default command for Maka. Run any other command with '--help' to show the help page for each.

$ maka run --help
$ maka generator --help
$ maka g:api --help
$ maka version --help
$ maka install --help

create

This command will prompt you through the options available when creating a new Maka generated Meteor application.
For command line arguments, here is a list to change the creation of your application:

  • --client=react | vanilla

    The default is React, and if you want to try out a framework-free client try plain ol' Vanilla!

  • --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.

  • --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.

  • --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.

run

Run the meteor service which starts the backend, mongo, HMR server, and your web server.

  • --env | -e

    Specify which environment to run meteor in.

    $ maka --env production
  • --raw-logs | -r

    Don't include the time stamp in the logs outputted to the terminal.

  • --port | -p

    The port to run meteor on, defaults to 3000

  • --inspect | -i

    Run meteor in "debug" mode, only a little better. This will allow the app to continue running and you can set breakpoints.

  • --mobile-server | -m

    Set the server your app will connect to if it's running in cordova.

  • --exclude-arch | -x

    Exclude architectures not needed for development. Defaults to web.browser.legacy and web.cordova. This will improve build times.

  • :docker

    Runs your app into a Docker container using "development" as the default environment using the docker-compose.yaml file contained in that environment. Docker Desktop or Colima must be installed (of course).

build

Run the meteor service which starts the backend, mongo, HMR server, and your web server.

  • --env | -e

    Specify which environment to run meteor in.

    $ maka --env production
  • --force | -f

    Build without prompting to overwrite

    $ maka --env production
  • --noRebuild

    Ok, this seems kind of silly. But this is more useful with the --docker flag, in case you need to tweak your Docker file but don't need to rebuild your app.

    $ maka --env production
  • :docker

    Builds your app into a Docker image. Docker must be installed (of course).

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

    Deprecation Warning! Layout, Component, Store, and Page will all be broken out into their own generators. e.g., maka g:layout new-layout

    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
  • :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

deploy

    galaxy

    This command will build, deploy and configure your application to Meteor's Galaxy hosting. https://www.meteor.com/cloud

    • --env

      Required

      This will grab the settings.json file for the specified environment configuration and send it off to Galaxy

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

      Setting this flag will instruct Galaxy to setup a mongo connection to a shared cluster. This appears to be the default option.

      $ maka deploy galaxy --env staging --mongo
    • --free

      Uses Meteor's free hosting tier for deployment.

      $ maka deploy galaxy -e p --free
    • --plan=professional | essentials

      Subscribe to one of Meteor's paid pricing plans. Note, this will override the --free flag. https://www.meteor.com/cloud#pricing-section

      $ maka deploy galaxy -e p --free

    ubuntu

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

    • --env

      Required

      $ maka deploy ubuntu --env prod 
      $ maka deploy ubuntu --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 ubuntu --env staging --mongo
    • --ssl | --ssl=letsencrypt

      When passing the --ssl option, you can choose between configuring 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 ubuntu --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 ubuntu --env staging --force
    • --noRebuild

      If you want to re-deploy, but didn't want to rebuild the bundle (maybe you made a new EC2 instance?) this flag will instruct a deployment without prompting for rebuild.

      $ maka deploy ubuntu --env staging --noRebuild

aws

Update: Maka-CLI no longer uses AWS-CLI, instead it uses the aws-cdk / aws-sdk and as such no longer requires AWS-CLI to be installed.

You still do need to have your credentials configured:

$ maka aws:create-instance --env prod
  • :create-instance

    • --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

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

    $ maka aws:reboot-instance
  • :terminate-instance

    $ maka aws:terminate-instance
    $ maka aws:ti

reconfig

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

  • --env

    Required

    $ 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'

ssl

Generate your own Certificate Signing Request and Self-Signed Certificate for testing, or use letsencrypt to configure your SSL certification for free.

  • --env

    Required

    $ maka ssl --env prod generate-csr
    $ maka ssl --env prod generate-ssc
    $ maka ssl --env prod letsencrypt

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