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
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:
The default is React, and if you want to try out a framework-free client try plain ol' Vanilla!
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.
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.
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.
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 the meteor service which starts the backend, mongo, HMR server, and your web server.
Specify which environment to run meteor in.
$ maka --env production
Don't include the time stamp in the logs outputted to the terminal.
The port to run meteor on, defaults to 3000
Run meteor in "debug" mode, only a little better. This will allow the app to continue running and you can set breakpoints.
Set the server your app will connect to if it's running in cordova.
Exclude architectures not needed for development. Defaults to web.browser.legacy and web.cordova. This will improve build times.
pro
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).
Run the meteor service which starts the backend, mongo, HMR server, and your web server.
Specify which environment to run meteor in.
$ maka --env production
Build without prompting to overwrite
$ maka --env production
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
pro
Builds your app into a Docker image. Docker must be installed (of course).
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
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
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
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 command will build, deploy and configure your application to Meteor's Galaxy hosting. https://www.meteor.com/cloud
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
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
Uses Meteor's free hosting tier for deployment.
$ maka deploy galaxy -e p --free
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
pro
This command will build, deploy and configure your application on a remote Linux (ubuntu) host.
Required
$ maka deploy ubuntu --env prod
$ maka deploy ubuntu --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 ubuntu --env staging --mongo
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
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
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
pro
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
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
pro
Helpful command to send up the PM2 configuration and settings.json file and reconfigure the PM2 service.
Required
$ maka reconfig --env staging
pro
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.
Required
$ maka ssh --env staging
$ maka ssh --env prod 'npm -i g vtop'
$ maka ssh --env prod 'pm2 monit'
pro
Generate your own Certificate Signing Request and Self-Signed Certificate for testing, or use letsencrypt to configure your SSL certification for free.
Required
$ maka ssl --env prod generate-csr
$ maka ssl --env prod generate-ssc
$ maka ssl --env prod letsencrypt
pro
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
Required
$ maka logs --env staging