Maka can now install your meteor base application, and configure it on Linux, MacOS, and Windows 10 (without chocolatey!).
$ maka install meteor
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
Don't prompt to verify that you are not running in sudo or administrative mode.
Here is a list of possible arguments to change the creation of your application:
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 firstname.lastname@example.org 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.
Using the graphql switch you can create a fully featured, full-stack, graphql service powered by Apollo GraphQL
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)
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)
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.
This command will allow you to create elements of your application quickly and with structure.
New! Create a React Hook.
$ maka g:hook cool-kid-hook
The template generator is broken up into several parts: layouts, pages, components, and when applicable stores
Create a new layout. By default a "master-layout" already exists in the layouts directory.
$ maka g:t mobile-layout --layout
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
This will create a component; a reusable element to be included in your pages or layouts.
$ maka g:t nav-bar --component
Only if you are creating a Reflux application, you may create new UI stores to handle global React state.
$ maka g:t login --store
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
Specify which layout to enable this route in.
$ maka g:route about-me --layout=MasterLayout
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
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
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
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
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).
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
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
A more complete generator, this will scaffold out an API resource, a page, and a route.
$ maka g:scaffold Todos
A generator designed to scaffold out non-meteor specific services that run along with your application.
Currently, there is only a logger service that leverages the npm module winston
$ maka g:s logger --type=logger
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:
$ maka g:config staging
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
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
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
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
You may pass the name of the key pair, or await a prompt.
$ maka aws create-key-pair --name=key-pair-1
Every EC2 instance needs a security group.
If you're going to run this EC2 over SSL (recommended) set this flag to open port 443.
$ maka aws create-sg --ssl
You may pass the name of the security group, or await a prompt.
$ maka aws create-sg --name=sg-1
$ maka aws describe-instances
$ maka aws di
$ maka aws reboot-instance
$ maka aws terminate-instance
$ maka aws ti
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
$ maka deploy --env prod
$ maka deploy --env staging
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
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
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
$ maka deploy --env staging --force
Helpful command to send up the PM2 configuration and settings.json file and reconfigure the PM2 service.
$ maka rcfg --env prod
$ maka reconfig --env staging
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.
$ maka ssh --env staging
$ maka ssh --env prod 'npm -i g vtop'
$ maka ssh --env prod 'pm2 monit'
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
$ maka logs --env staging