Git Product home page Git Product logo

megaboilerplate's Introduction

Gitter Build Status

Mega Boilerplate is a starter project generator that focuses on simplicity and ease of use, while providing you with flexibility of choices. It was heavily inspired by the Hackathon Starter, but unlike it, you can customize any part of your application stack β€” from web framework and database to CSS preprocessor and client-side JavaScript framework. Currently, generators are primarily limited to Node.js web apps, but I am planning to expand support for other platforms and languages in the near future.

Table of Contents

Getting Started

Prerequisites

  • Node.js 6.0
  • Git
  • Command Line Tools
  • Mac OS X: Xcode or xcode-select --install
  • Windows: Visual C++ Build Tools 2015
  • Ubuntu: sudo apt-get install build-essential
  • Fedora: sudo dnf groupinstall "Development Tools"
  • OpenSUSE: sudo zypper install --type pattern devel_basis

Express

Download and extract the project. Then in your Terminal type the following:

$ cd megaboilerplate-app

# Install NPM dependencies
$ npm install

# Start the app
$ node server.js

# Express server listening on port 3000

Note: If you have selected Gulp or NPM build tool, you may also need to run npm run build command.

Note: If you have selected a database, please make sure it is up and running. For additional information, see Database Setup.

πŸ” back to top

Jekyll

Prerequisites

$ cd megaboilerplate-app

# Start Jekyll app
$ jekyll serve

# Server address: http://127.0.0.1:4000/
# Server running... press ctrl-c to stop.

πŸ” back to top

Middleman

Prerequisites

$ cd megaboilerplate-app

# Install Ruby dependencies
$ bundle install

# Start Middleman app
$ bundle exec middleman

# The Middleman is loading
# View your site at "http://localhost:4567"

πŸ” back to top

JS Library

This JavaScript library boilerplate was inspired and based on Dan Abramov's library-boilerplate project. The main idea here is you write your code in ES6, which then gets transpiled into CommonJS and UMD builds. Consider lodash as an example - a very popular JavaScript library that supports ES6 import, CommonJS require() and can be used inside a browser via <script> tag.

$ cd megaboilerplate-app

# Install NPM dependencies
$ npm install

# ES5 / CommonJS build
$ npm run build

# UMD build
$ npm run build:umd

# Run tests
$ npm test

πŸ” back to top

Database Setup

πŸ” back to top

MongoDB

Mac OS X

Install Homebrew package manager. Then follow the steps below to install and setup MongoDB.

# Update Homebrew's package database
$ brew update

# Install MongoDB
$ brew install mongodb

# Create the data directory
$ sudo mkdir -p /data/db

# Set permissions for the data directory
$ sudo chown -R `whoami` /data/db

# Run MongoDB Server
$ mongod

Windows

  1. Download and install the current stable release.
  2. Create the data directory: C:\data\db.
  3. Run MongoDB Server by opening mongod.exe in C:\Program Files\MongoDB\Server\3.2\bin.

Ubuntu

# Import the public key used by the package management system
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

# Create a source list file for MongoDB
$ echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

# Update the repository
$ sudo apt-get update

# Install the latest stable version of MongoDB
$ sudo apt-get install -y mongodb-org

# Start MongoDB service
$ sudo service mongod start

πŸ” back to top

MySQL

Use database settings below in the .env file.

Key Value
DB_HOST localhost
DB_USER root
DB_PASSWORD (use root password configured during installation or leave blank)
DB_NAME mysql

Mac OS X

Install Homebrew package manager. Then follow the steps below to install and start MySQL.

# Update Homebrew's package database
$ brew update

# Install MySQL
$ brew install mysql

# Start MySQL Server
$ mysql.server start

Windows

  1. Download MySQL Installer for Windows.
  2. Start the installer and follow instructions until the installation is complete.
  • When prompted, choose Server only or Developer Default setup type.

Note: Alternatively, you may use XAMPP, which already comes bundled with MySQL and phpMyAdmin.

Ubuntu

# Update the repository
$ sudo apt-get update
$ sudo apt-get upgrade

# Install MySQL
$ sudo apt-get install mysql-server

πŸ” back to top

PostgreSQL

Use database settings below in the .env file.

Key Value
DB_HOST localhost
DB_USER postgres
DB_PASSWORD (use root password configured during installation)
DB_NAME postgres

Mac OS X

Install Homebrew package manager. Then follow the steps below to install and start PostgreSQL.

# Update Homebrew's package database
$ brew update

# Install PostgreSQL
$ brew install postgres

# Start PostgreSQL Server
$ postgres -D /usr/local/var/postgres

Windows

  1. Download the latest version of PostgreSQL Installer.
  2. Start the installer and follow instructions until the installation is complete.

Ubuntu

# Update the repository
$ sudo apt-get update
$ sudo apt-get upgrade

# Install PostgreSQL
$ sudo apt-get install postgresql postgresql-contrib

SQLite

No additional steps required. Package sqlite3 will be automatically installed during npm install in Getting Started.

πŸ” back to top

Project Structure

Due to the nature of this project, there are too many possible project structure variations to list here. For the sake of simplicity, let's consider just the following project types:

Traditional Node.js Web App

This is perhaps the most straightforward web app type that does not use any client-side JavaScript frameworks or build tools. Is also the closest thing to Hackathon Starter project.

.
β”œβ”€β”€ config/                    # Configuration files for OAuth, database, etc.
β”‚   β”œβ”€β”€ passport.js/           # Passport strategies
β”œβ”€β”€ controllers/               # Express route handlers
β”œβ”€β”€ models/                    # Express database models
β”œβ”€β”€ public/                            
β”‚   β”œβ”€β”€ css/                   # Sass/LESS/PostCSS/CSS stylesheets (both source and generated)
β”‚   β”œβ”€β”€ fonts/                 # Web fonts
β”‚   β”œβ”€β”€ js/                    # Client-side JavaScript and third-party vendor files
β”œβ”€β”€ views/                     # Templates
β”œβ”€β”€ test/                      # Unit tests                    
β”œβ”€β”€ .env                       # API keys, passwords, and other sensitive information
β”œβ”€β”€ server.js                  # Express application
└── package.json               # NPM Dependencies and scripts

React App

The new hotness of the web β€” Universal JavaScript app, powered by React, Redux, React Router and Server Rendering.

Note: Some files were ommited like gulpfile.js and webpack.config.js.

.
β”œβ”€β”€ app/                       # React application
β”‚   β”œβ”€β”€ actions/               # Redux actions
β”‚   β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ reducers/              # Redux reducers
β”‚   β”œβ”€β”€ store/                 # Store initialization and configuration
β”‚   β”œβ”€β”€ main.js                # Client-side app entry-point
β”‚   β”œβ”€β”€ routes.js              # Universal application routes (React Router)
β”œβ”€β”€ controllers/               # Express route handlers
β”œβ”€β”€ models/                    # Express database models
β”œβ”€β”€ public/                    
β”‚   β”œβ”€β”€ css/                   # Sass/LESS/PostCSS/CSS stylesheets (both source and generated)
β”‚   β”œβ”€β”€ fonts/                 # Font Awesome web fonts
β”‚   β”œβ”€β”€ js/                    # Third-party vendor files and generated React app (bundle.js)
β”œβ”€β”€ views/                    
β”‚   β”œβ”€β”€ layout.jade            # Main container, into which React app is rendered
β”‚   β”œβ”€β”€ loading.jade           # Loading spinner animation for OAuth 1.0 / 2.0 authentication flow inside a popup
β”œβ”€β”€ .babelrc                   # Babel config
β”œβ”€β”€ .env                       # API keys, passwords, and other sensitive information
β”œβ”€β”€ server.js                  # Express application
└── package.json               # NPM Dependencies and scripts

AngularJS App

Your typical MEAN stack (MongoDB, Express, AngularJS, Node.js). Originally, I was not planning on adding AngularJS 1.x generator, especailly with Angular 2 around the corner. So without investing too much time, I kept it real simple: no Browserify, no ES6 classes, no AngularJS 1.5 components. Once officially released, Angular 2 generator will be more elaborate with quite a few additional options.

.
β”œβ”€β”€ app/                       # Angular app directory
β”‚   β”œβ”€β”€ controllers/           # Angular controllers
β”‚   β”œβ”€β”€ partials/              # Angular view templates
β”‚   β”œβ”€β”€ services/              # Angular services
β”‚   β”œβ”€β”€ store/                 # Store initialization and configuration
β”‚   β”œβ”€β”€ app.js                 # Main Angular app file
β”‚   β”œβ”€β”€ index.html             # Main layout template
β”œβ”€β”€ controllers/               # Express route handlers
β”œβ”€β”€ models/                    # Express database models
β”œβ”€β”€ public/                    
β”‚   β”œβ”€β”€ css/                   # Sass/LESS/PostCSS/CSS stylesheets (both source and generated)
β”‚   β”œβ”€β”€ js/                    # Compiled Angular app and third-party vendor files, e.g. angular.js, angular-route.js
β”œβ”€β”€ .env                       # API keys, passwords, and other sensitive information
β”œβ”€β”€ gulpfile.js                # Compiles Angular application and templates
β”œβ”€β”€ server.js                  # Express application
└── package.json               # NPM Dependencies and scripts

πŸ” back to top

Obtaining API Keys

To use any of the included OAuth providers (e.g. Facebook, Twitter, Google), you will need to obtain API keys. I have included "throw-away" API keys for all OAuth providers to get you up and running quickly, but be sure to update them with your own keys.

- Go to [Facebook Developers](https://developers.facebook.com/). - Click on **My Apps** dropdown, then select **Add a New App**. - Select **Website** platform, then click on **Skip and Create App ID** button. - Enter a **name** and choose a **category** for your app. - Click on **Create App ID** button. - Copy and paste **App ID** and **App Secret** keys into `.env` file: - `FACEBOOK_ID='YOUR_APP_ID'` - `FACEBOOK_SECRET='YOUR_APP_SECRET'` - Click on the **Settings** tab, then click on **+ Add Platform** button. - Select **Website**, then enter `http://localhost:3000/auth/facebook/callback` in the **Site URL**.

Note: If you are using React or AngularJS, copy and paste App Secret into .env file and App ID into app/actions/oauth.js (React) and app/app.js (AngularJS).

- Go to [Google Cloud Console](https://cloud.google.com/console/project) - Click on **Create project** button. - Enter a **Project name**, then click on **Create** button. - Click on **Use Google APIs** (Enable and manage APIs) panel. - Click on **Credentials** tab in the sidebar. - Client on **Create credentials** dropdown, then select **OAuth client ID**. - Select or enter the following: - **Application type**: `Web application` - **Authorized JavaScript origins**: `http://localhost:3000` - **Authorized redirect URIs**: `http://localhost:3000/auth/google/callback` - Click on **Create** button. - Copy and paste **client ID** and **client secret** keys into `.env` file: - `GOOGLE_ID='YOUR_CLIENT_ID'` - `GOOGLE_SECRET='YOUR_CLIENT_SECRET'`

Note: If you are using React or AngularJS, copy and paste client secret into .env file and client ID into app/actions/oauth.js (React) and app/app.js (AngularJS).

- Go to [Twitter Application Management](https://apps.twitter.com/). - Click on **Create New App** button. - Fill out required fields. - **Callback URL**: `http://127.0.0.1:3000/auth/twitter/callback` - Go to **Settings** tab. - Click on **Allow this application to be used to Sign in with Twitter** checkbox. - Click on **Update Settings** button. - Go to **Keys and Access Tokens** tab. - Copy and paste **Consumer Key** and **Consumer Secret** keys into `.env` file: - `TWITTER_ID='YOUR_CONSUMER_KEY'` - `TWITTER_SECRET='YOUR_CONSUMER_SECRET'`

Note: If you are using React or AngularJS, copy and paste Consumer Secret into .env file and Consumer Key into app/actions/oauth.js (React) and app/app.js (AngularJS).

- Go to [Developers | VK](http://new.vk.com/dev) - Click on **Create an Application** button. - Enter a **Title** and select a **Category** (Website), then click on **Connect Application** button. - Confirm activation code via your mobile number. - Click on **Settings** tab in the sidebar. - Select or enter the following: - **Application status**: `Application on and visible to all` - **Site address**: `http://localhost:3000` - **Authorized redirect URI**: `http://localhost:3000/auth/vkontakte/callback` - Copy and paste **Application ID** and **Secure key** into `.env` file: - `VK_ID='YOUR_APPLICATION_ID'` - `VK_SECRET='YOUR_SECURE_KEY'`

Note: If you are using React or AngularJS, copy and paste Secure key into .env file and Application ID into app/actions/oauth.js (React) and app/app.js (AngularJS).

- Go to [Github Developer Applications Settings](https://github.com/settings/developers) - Click on **Register a new application** button. - Fill out required fields. - **Application Name** - **Homepage URL** - **Callback URL**: `http://127.0.0.1:3000/auth/github/callback` - Click on **Register application** - Copy and paste **client ID** and **client secret** keys into `.env` file: - `GITHUB_ID='YOUR_CLIENT_ID'` - `GITHUB_SECRET='YOUR_CLIENT_SECRET'`

Note: If you are using React or AngularJS, copy and paste client secret into .env file and client ID into app/actions/oauth.js (React) and app/app.js (AngularJS).

πŸ” back to top

Learning Resources

Web Tools

Express

React / Redux

Performance and SEO

AngularJS

Jekyll

Middleman

JS Library

Bookshelf.js (SQL ORM)

Mongoose (MongoDB ODM)

πŸ” back to top

Cheatsheets

ES6 Cheatsheet

Declarations

Declares a read-only named constant.

const name = 'yourName';

Declares a block scope local variable.

let index = 0;

Template Strings

Using the `${}` syntax, strings can embed expressions.

const name = 'Oggy';
const age = 3;

console.log(`My cat is named ${name} and is ${age} years old.`);

Modules

To import functions, objects or primitives exported from an external module. These are the most common types of importing.

import name from 'module-name';
import * as name from 'module-name';
import { foo, bar } from 'module-name';

To export functions, objects or primitives from a given file or module.

export { myFunction };
export const name = 'yourName';
export default myFunctionOrClass

Spread Operator

The spread operator allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) are expected.

myFunction(...iterableObject);
<ChildComponent {...this.props} />

Promises

A Promise is used in asynchronous computations to represent an operation that hasn't completed yet, but is expected in the future.

var p = new Promise(function(resolve, reject) { });

The catch() method returns a Promise and deals with rejected cases only.

p.catch(function(reason) { /* handle rejection */ });

The then() method returns a Promise. It takes 2 arguments: callback for the success & failure cases.

p.then(function(value) { /* handle fulfillment */, function(reason) { /* handle rejection */ });

The Promise.all(iterable) method returns a promise that resolves when all of the promises in the iterable argument have resolved, or rejects with the reason of the first passed promise that rejects.

Promise.all([p1, p2, p3]).then(function(values) { console.log(values) });

Arrow Functions

Arrow function expression. Shorter syntax & lexically binds the this value. Arrow functions are anonymous.

singleParam => { statements }
() => { statements }
(param1, param2) => expression
const arr = [1, 2, 3, 4, 5];
const squares = arr.map(x => x * x);

Classes

The class declaration creates a new class using prototype-based inheritance.

class Person {
  constructor(name, age, gender) {
    this.name   = name;
    this.age    = age;
    this.gender = gender;
  }

  incrementAge() {
    this.age++;
  }
}

🎁 Credits: DuckDuckGo and @DrkSephy.

πŸ” back to top

JavaScript Date Cheatsheet

Unix Timestamp (seconds)

Math.floor(Date.now() / 1000);

Add 30 minutes to a Date object

var now = new Date();
now.setMinutes(now.getMinutes() + 30);

Date Formatting

// DD-MM-YYYY
var now = new Date();

var DD = now.getDate();
var MM = now.getMonth() + 1;
var YYYY = now.getFullYear();

if (DD < 10) {
  DD = '0' + DD;
} 

if (MM < 10) {
  MM = '0' + MM;
}

console.log(MM + '-' + DD + '-' + YYYY); // 03-30-2016
// hh:mm (12 hour time with am/pm)
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var amPm = hours >= 12 ? 'pm' : 'am';

hours = hours % 12;
hours = hours ? hours : 12;
minutes = minutes < 10 ? '0' + minutes : minutes;

console.log(hours + ':' + minutes + ' ' + amPm); // 1:43 am

Next week Date object

var today = new Date();
var nextWeek = new Date(today.getTime() + 7 * 24 * 60 * 60 * 1000);

Yesterday Date object

var today = new Date();
var yesterday = date.setDate(date.getDate() - 1);

πŸ” back to top

Deployment

Once you are ready to deploy your app, you will need to create an account with a cloud platform to host it. These are not the only choices you have, but they are my top picks.

Heroku

  • Download and install Heroku Toolbelt
  • In Terminal, run heroku login, then enter your Heroku credentials
  • Navigate to the megaboilerplate-app directory and run the following commands:
  1. git init
  2. git add .
  3. git commit -m 'Initial commit'
  • Then run heroku create to create a new Heroku app and link it with your current Git repository

    Creating app... done, β¬’ floating-mesa-51019
    https://floating-mesa-51019.herokuapp.com/ | https://git.heroku.com/floating-mesa-51019.git
  • Run git push heroku master and you are done!

Note: If you have created a new app via Heroku Dashboard, you can link it with an existing Git repository by running:

heroku git:remote -a your-heroku-app-name

For more information, please visit Getting Started on Heroku with Node.js.

Heroku + PostgreSQL

Connecting to a Heroku Postgres database from outside of the Heroku network requires SSL. Furthermore, connection string given by Heroku (DATABASE_URL) does not have "?ssl=true" parameter by default.

The simplest solution is to add PGSSLMODE=require config var in the Heroku dashboard or via CLI: heroku config:set PGSSLMODE=require.

TODO: Deployment instructions for SQL and MongoDB databases. (Heroku Postgres, Compose, MongoLab)

Microsoft Azure

  • Sign in to your account at Azure Portal
  • Click on App Services, then click on Add button
  • Enter an App name for your app and create or select an existing Resource Group
  • Click on Create button and give it 15-20 seconds
  • Find and select your app under App Services
  • In the right-hand Settings sidebar, find and click on Deployment source
  • Under Choose Source select Local Git Repository, then press OK
  • Alternatively, you can choose GitHub to sync Azure with a GitHub repository for continous deployment
  • Right below Deployment source, click on Deployment credentials and create new username and password, then hit Save
  • Still inside Settings sidebar, find and click on Properties located under General settings
  • Copy Git URL, e.g. https://[email protected]:443/appname.git
  • Navigate to the megaboilerplate-app directory and run the following commands:
  1. git init
  2. git add .
  3. git commit -m 'Initial commit'
  4. git remote add azure https://[email protected]:443/appname.git
  • Note: Use your Git URL from above
  • Run git push azure master, and when prompted, enter your password created under Deployment credentials
  • All set!

Digital Ocean

TODO

πŸ” back to top

FAQ

πŸ” back to top

React

Actions, reducers, stores, containers, provider...what? ΰ² _ರೃ

Despite being such a small library, Redux can be difficult to grasp for beginners. It took me almost three days until Redux "clicked" for me, even with my prior experience of working with React and Flux. Here is a TL;DR: summary:

Concept Description
Actions Your application events, e.g. fetch data from server. Success and failure events of data fetching could also be actions. Actions are just plain JavaScript objects. They typically have some data associated with it. For example, LOGIN_ERROR action may contain an error message. Actions describe the fact that something happened, but don't specify how the application’s state changes in response. This is the job of a reducer.
Reducers Basically your action handlers, internally implemented via Array.prototype.reduce(). This is where you specify how should the application state be updated when LOGIN_ERROR action is dispatched, for example. And that's it. How that state affects your application should still be managed in your components. One thing to note, you never mutate the state, but rather create a new copy of your current state + new changes using Object.assign().
Store Brings actions and reducers together. Store holds entire application state, allows you access current state via getState(), and update application state via dispatch(action). You typically have just one Redux store that is configured during the inital bootstrap stage.
Provider Syntactic sugar from react-redux library. <Provider> component wrapper makes the Redux store available to the connect() function. Alternatively, you can manually pass store as a prop to every connect()ed component. connect() is another syntactic sugar provided by react-redux which connects a React component to a Redux store. Alternatively, you can manually subscribe/unsubscribe to/from a store during componentDidMount() and componentDidUnmount() lifecycle of each component.
Container So-called smart components that are aware of Redux, whereas traditional components are now considered dumb components, which are not aware of Redux; they just render markup with given props. I intentionally combined containers and components into simply β€” components for the sake of simplicity.

πŸ” back to faq

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our website and on our README on Github with a link to your site. [Become a sponsor]

Sites Built with Mega Boilerplate

If you have built an app using Mega Boilerplate, please enter yourself here by sending a pull request.

Changelog

1.1.0 (June 10, 2016)

  • Added Stylus CSS preprocessor support when no CSS Framework is selected.
  • Generate README.md for each boilerplate with selected choices.
  • Enabled Webpack hot module replacement for Redux reducers.
  • Updated React 15.0.2 to 15.1.0.
  • Removed unused lodash require() in the user controller.
  • Improved responsive design of login and signup container (Bootstrap).
  • Fixed indentation inside profile update controller (SQL).
  • Hide password field when calling toJSON() method on user model (Bookshelf.js / SQL).
  • Fixed a bug where an error was thrown after user updates their profile (SQL only).
  • Fixed invalid file path for Bootstrap CSS/JS imports inside layout.jade.
  • knexfile.js is no longer generated twice.
  • Updated Redux learning resources section in README.
  • Added special instructions to "Obtaining API Keys" section for React / AngularJS.

1.0.0 (June 8, 2016)

  • Initial release.

Contributing

Pull requests from beginners and seasoned JavaScript developers are welcome! As it stands, Mega Boilerplate is pretty large in scope to be maintained by a single person, so I am asking for your help to contribute where you can, whether it's a small fix in README or adding a whole new generator type, e.g. Meteor, Angular 2, React Native, Electron.

πŸ” back to top

License

MIT

megaboilerplate's People

Contributors

acknosyn avatar alexanderchan avatar baptistedixneuf avatar ciboulette avatar dracyr avatar eduardogch avatar estevanmaito avatar greenkeeperio-bot avatar ivanryzk avatar moflo avatar nimerix avatar obrientimothya avatar piamancini avatar robgyiv avatar sahat avatar victormiguez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

megaboilerplate's Issues

Move live demos from Azure to another PaaS

Free Tier on Azure seems to be down a lot. Explore other options such as OpenShift and Bluemix.

Can't host demos on Heroku because I need those 1000 hours/month to host the actual Mega Boilerplate website without interruptions.

Add README.md to boilerplates

Add a simple README.md file which would contain the basics:

  • Title
  • Reference how it was generated by MBP
  • Components: this is just a repeat of the things we checked on the website
    (ie: Node.js + express + ... )
  • License

Note this would greatly help when opening issues... so we don't have to enter one-by-one how we generated something but rather could just copy/paste from your generated README what we generated.

Google sign-in button not honoring .env settings

Configuration:

  • Platform: Node.js
  • Framework: Express
  • Database: SQLite
  • Template engine: Jade
  • CSS framework: Bootstrap

For those settings, creating the .env file as stated in the README.md works for Facebook and Twitter signins, but Google signup still takes me to the Megaboilerplate authorization rather than my Google app's auth. Removing the clientId in googleLogin() (line 52 on my app/actions/oauth.js) fixes this.

Can anyone confirm that this is happening with them too? Am I doing something wrong?

knexfile appears twice

Seems like knexfile appears both under config/ and in the main directory.

Generated:
node
express
jade
bootstrap
sass
react
gulp
no unit testing
postgreSQL
heroku

You probably meant to replace config/knexfile with the one that got copied into the main directory.

Convert Express app to ES6

The task is pretty straightforward - convert ES5 to ES6 syntax. The server-side code is based on Hackathon Starter project prior to migrating it to ES6.

Add Metalsmith (Static Site Generator) to Megaboilerplate

I would be happy to help implement this, as I would use it a lot. I do even have my own boilerplate that I've been working on for Metalsmith for a bit, although it would be amazing to do a build with different plugins (lots of options, I'd be happy to categorize them and place them appropriately).

I would also be willing to scaffold out different site functionality, like a blog (already have this working) or whatever else.

Enable Webpack hot module replacement for Redux reducers

When using Webpack and React, redux reducers do not keep state during hot reloads.

There is a simple fix though in app/store/configureStore.js

export default function configureStore(initialState) {
  const store = createStore(
    rootReducer,
    initialState,
    applyMiddleware(thunk)
  );

  // Enable Webpack hot module replacement for reducers
  if (module.hot) {
    module.hot.accept('../reducers', () => {
      const nextRootReducer = require('../reducers');
      store.replaceReducer(nextRootReducer);
    });
  }

  return store;
}

Refer to erikras/react-redux-universal-hot-example#44 (comment) for more info.

Great project!

Webpack support for AngularJS

At the moment Webpack cannot be selected together with AngularJS. Last time I used Angular, everyone was using Gulp or Grunt. I don't know how easy or difficult it would be to integrate it with Webpack.

If most people in the Angular community are not using Webpack, then it's fine to keep it as is - None and Gulp only.

Move asset source files

Hi, I think we should move the style & script source files out of the public directory (if using a build step) and into /assets for example. Then the build process will build into /public. Thoughts?

Sticky footer overlaying content issue - Demo 2

In Demo 2, the footer sticks to the bottom of the window regardless of content. It's always stuck at the bottom and overlays content.

On a mobile view, it's fixed to a position where the bottom of the window was when the view was first created. So it will stay there even when scrolling.

footer over content - mobile

On a responsive view, e.g. a resizeable window, the footer will stick to the bottom of the window.

footer over content - responsive

Update Express filename conventions

  1. Capitalize model filename user.js to User.js.
  2. Change Pascal Case to Camel Case for all controller references. For example:
    • Pascal Case: var UserController = require('./controllers/user')
    • Camel Case: var userController = require('./controllers/user') (use this)

@niallobrien I have decided to keep controller names as-is for now. At least with model names capitalized, it shouldn't cause any confusion between user model and user controller file names.

"lodash" npm module is needed but not specified in package.json

Here's my app config:

Configuration

  • Platform: node
  • Framework: express
  • Template Engine: handlebars
  • CSS Framework: bootstrap
  • CSS Preprocessor: less
  • JavaScript Framework: react
  • Build Tool: gulp
  • Unit Testing: mocha
  • Database: mongodb
  • Authentication: email,facebook,google,twitter
  • Deployment: heroku

when running the app with "npm start" i got an error, due to the fact the "lodash" was not available. I installed it and then everything was fine.

I see the module is available in "master" but it was not there after download.

Add option to generate only the frontend (React/Angular, etc)

As we know that much people prefer to choose a different backend, I think it is a good idea to have a option to start the generator asking for the Frontend JS Framework and optionally generate server code.

As we see on a bunch of yeoman generators and react boilerplates:

add support to select the type of indentation

It would be great if we have the option to select the type of indentation(2 spaces or 4 spaces).By default it is 2 spaces. But 4 spaces indentation is also widely used i believe

Please add ejs support

First of all: well done for making this project (I have been patiently waiting since you suggested it in sahat/hackathon-starter#439)!

I have just been having a look at your live example generator and I would love it if ejs support was added.

Why add ejs?:

  • Still used by lots of JS developers (I think)
  • Allows embedding of JS into a page, which (I think) Jade does not. This could used for dynamic content, such as showing something if a property is or is not equal to something
  • Might not be as clean as jade, but closely resembles normal HTML, which means you do not have to learn a new Markup language to design websites with it.

Thanks in advanced!

TypeError: user.then is not a function

Configuration:

  • Platform:
    • Node.js
  • Framework:
    • Express
    • Angular 1.x
  • Database:
    • SQLite
  • Template engine:
    • Jade
  • CSS framework:
    • Bootstrap

System:

  • OS: MacOS
  • Arch: x86_64

I'm trying to update "My profile" and receive this error:
TypeError: user.then is not a function

This happen when create a user or even log in with Facebook..

Improve responsive design of radio buttons

Should be easy fix by changing radio button margins, in order to have items on the next row be flush with the first row. Also need slight vertical spacing so it doesn't look crammed.

responsive

Mongoose used in SQL model

Hi, I generated a project and selected Postgres etc. My project was built successfully, however my User model is defining a Mongoose schema etc.

Thanks.

Refactor Express auth routes into auth.js controller

Move Facebook, Twitter, Google, VK, Email authentication route logic from User controller into a separate Auth controller.

Note: This will require updating quite a bit of references in the Authentication generator.

Fix responsive login container in Bootstrap demo

Avoid double request on POST /download

A POST request to /download is fired twice. First as an AJAX request, then as a form submission.

  1. We need an AJAX request to relay any potential errors back to the user without navigating away.
  2. A form submit is necessary to trigger file download.

Doing a form submit directly works well, until an error is thrown and user is navigated away to /download with some obscure error message. At this point all previous selections are lost. Not a great user experience.

If someone knows of a way to trigger a download via AJAX request I'd like to hear your thoughts. Otherwise, the next best thing would be to create a pretty-looking error page and save user's choices to sessionStorage, then clear sessionStorage on Download button click.

Angular password reset link not routed correctly

With the angular boilerplate, there are errors with the password reset functionality.

  1. The reset password angular controller calls the Account.forgotPassword() instead of Account.resetPassword()
  2. The resetPassword function on the account service tries to call '/reset', but on the server the only valid route is '/reset/:token'

This is not working as it is currently structured and needs to be refactored to call the right function and pass the token from the server to the browser.

In my application I built from this, I ended up taking the password reset as a query param in angular and then passing that to '/reset/:token' on the server because it was easier.

I am happy to make the change, but with the refactor being done with #109, this would make sense to combine with that effort or wait until the refactor is complete.

NW.js support

I see Electron support is being added. It's a little disappointing that it's getting support before NW.js, since it's just a bad knockoff of it.

  • NW.js has been around 5 years longer
  • Is more stable
  • Has better documentation
  • Is updated faster (within 24 hours of each new Chromium or Node release)
  • Supports more OS's (XP+, OSX 10.6+, Ubuntu/Zorin/Debian)
  • Wayyyyyyy easier to get started with
  • Common sense coding. (You can actually include jQuery like you normally would instead of having to require it in via Node in some backwards way)
  • It's ready out of the box, you don't need to create a JS file to then create a window to then create a close button that works. You just start with a Native Window with all the defaults and can opt out if you don't want them (more common sense).

Outside of a bad logo and horrendously bad name, NW.js is better in every way to Electron.

Add support for secondary database

In addition to primary database choicesβ€”MongoDB, PostgreSQL, MySQL, SQLiteβ€”add a secondary option for specialized databases, e.g. Redis and Elastic Search.

error in the mean bundle

Configuration

  • Platform: node
  • Framework: express
  • Template Engine: nunjucks
  • CSS Framework: bootstrap
  • CSS Preprocessor: css
  • JavaScript Framework: angularjs
  • Build Tool: gulp
  • Unit Testing: jasmine
  • Database: mongodb
  • Authentication: email,facebook,google,twitter
  • Deployment: none

Hi,

I'm running this setting and is giving error in profile update (error: 'Passwords must match')

I noticed that the "NEW PASSWORD" in this view filled
the field "CONFIRM PASSWORD" in view is blank

When I click on "Update Profile" returns the error message "Passwords must match"

This error should not return if I click on "Change Password"?

If I put the password and confirm it updates the same profile, but when I update the page to screen is blank and appears this message on the console ("VM106: 1 Uncaught SyntaxError: Unexpected token u in JSON at position 0")

The same configuration only using react not of any error

Sorry my english google (lol)

Thanks

GraphQL and Relay Support?

If you have used GraphQL or Relay, I'd like to hear your thoughts on how feasible it would be to add it to Mega Boilerplate.

Does it require structuring your schema a certain way or is it completely independent from database storage?

Would I need to create a separate set of Express API routes for GraphQL?

Does Relay work in conjunction with Redux or does it replace Redux?

Add Stylus css preprocessor choice

Add Stylus support for None CSS framework.

It should be able to generate CSS via the following:

  1. stylus-middleware
  2. Gulp
  3. Webpack
  4. NPM command line

Error on startup

After cloning this repo and npm i && npm start I get the below message on startup. I'm running node v6 with npm v3.

{ Error: ENOENT: no such file or directory, open '.env'
    at Error (native)
    at Object.fs.openSync (fs.js:634:18)
    at Object.fs.readFileSync (fs.js:502:33)
    at Object.module.exports.config (/private/var/application/my_projects/boilerplate/node_modules/dotenv/lib/main.js:30:37)
    at Object.<anonymous> (/private/var/application/my_projects/boilerplate/server.js:15:8)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:445:3 errno: -2, code: 'ENOENT', syscall: 'open', path: '.env' }
Express server listening on port 4000

Meteor 1.3 Progress

#### Meteor Checklist - [ ] Explore Meteor - [ ] See what's new in v1.3 (Blaze vs React) - [ ] Template Engine generator - [ ] CSS Framework generator - [ ] JS Framework generator - [ ] Build Tool generator - [ ] Unit Testing generator - [ ] Database generator - [ ] Authentication generator - [ ] Deployment generator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.