Coder Social home page Coder Social logo

datstack's Introduction

datstack

Hyper portable and lean Javascript web application boilerplate.

dat stack tho

Requirements

  • NodeJS

Features

  • Automated unit testing
  • Code-based database migrations for MySQL, PostgreSQL, and sqlite3
  • Frontend app built with Browserify, Grunt, and Bower
  • Share code between the server and client
  • Works out of the box for Heroku

Awesome

Install dependencies (and implicitly run build and migrate):

$ npm install

Build the client application (check out Gruntfile.js for options):

$ npm run build

Run database migrations (if there are any, run via db-migrate):

$ npm run migrate

Run tests (if there are any, run via tape):

$ npm test

Start the server app:

$ npm start

Project Structure

  • app/client/main.js Client application
  • app/server/main.js Server application
  • database.json Database credentials
  • dist/client/ Compiled output directory for client app
  • public/ Web root
  • style/style.less Style sheet base
  • test/*.js Unit tests

Database

Migrations are handled via db-migrate, which has support for PostgreSQL, MySQL, and sqlite3. The migrate script is only run if there is a database.json present in the root of the repo.

Protip: Create a ./database.json file to ensure the database credentials are correct (see the db-migrate docs for format details).

It's probably a good idea to source this file in the server code so database credentials comes from one place.

Heroku

When pushing to a Heroku remote, the client application will automatically be built and all database migrations will be run.

Example

Using the heroku-toolbelt from the command line:

$ git clone https://github.com/bvalosek/datstack.git 
$ cd datstack
$ heroku create
$ git push heroku master
$ heroku open

datstack's People

Contributors

bvalosek avatar zxqx avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

zxqx

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.