mumsy

Mumsy is an opinionated generator for projects that use express, passport, mongoose, bootstrap and handlebars.

Usage no npm install needed!

<script type="module">
  import mumsy from 'https://cdn.skypack.dev/mumsy';
</script>

README

Mumsy

A generator to quickly develop node applications.

Install

Mumsy is installed globally using the following command:

npm install mumsy -g

Use

Mumsy is ran from the command line inside an empty directory.

Create A Directory

mkdir mumsyproject && cd mumsyproject

Run Mumsy

mumsy

Configure Database

Mumsy uses a configuration file that requires configuration of the app secret and database url:

// config/database.js
var express = require('express');
var app = express();

if (app.get('env') === 'development') {
    var appSecret = 'yourappsecret';
    var dbUrl = 'path_to_your_mongo_db';
} else {  
    // production environment variable set manually in heroku app settings
    var appSecret = process.env.APPSECRET;
    // production environment variable set by mongolab add-on in heroku app resources
    var dbUrl = process.env.MONGOLAB_URI;
}
module.exports = {
    'secret': appSecret,
    'url': dbUrl
};

Deploy To Heroku

If you haven't already, initiate a git repo:

git init

To deploy to heroku, create an app:

heroku create mumsytest

Add heroku as a remote repository:

heroku git:remote -a mumsytest 

Add project to our git repository:

git add -A
git commit -m "Initial commit" 

Add the mongolab addon:

heroku addons:create mongolab

Add the APPSECRET configuration variable to heroku:

heroku config:set APPSECRET=myappsecret

Push to heroku:

git push heroku master

Setup Admin User

After you start your app locally or on heroku, you will need to visit the /setup path manually to setup your admin user. This process will only work if the app is brand new and there are currently no users in the database.