$ gem install daiku
$ gem update daiku
To generate a basic app, run the new
command, passing it the port your local server should listen to incoming requests on. The generated app is whole and complete, and ready to run.
$ daiku new myapp --port 5000
$ cd myapp
$ bundle install
$ bundle exec foreman start
$ open http://localhost:5000
Or as a oneliner:
daiku new myapp --port 5000 && cd myapp && bundle install && bundle exec foreman start
Then visit http://localhost:5000
in your browser.
You can further customize the app that's generated by passing additional options. The built-in help system explains the available options.
$ daiku help new
Usage:
daiku new APP -p, --port=N
Options:
-p, --port=N # Port this app should run on locally.
[--ruby=RUBY] # Specify the version of ruby this project should use.
# Default: 2.1.5
[--node=NODE] # Specify the version of node this project should use (for grunt, etc).
# Default: v0.10.33
-a, [--assets=ASSETS] # Choose the assets workflow this project uses.
# Possible values: grunt
-e, [--errors=ERRORS] # Choose the error reporting lib this project uses.
# Possible values: honeybadger
-j, [--jobs=JOBS] # Choose the background jobs lib this project uses.
# Possible values: sidekiq
-m, [--models=MODELS] # Choose the data modeling lib this project uses.
# Possible values: datamapper, sequel
-M, [--monitors=MONITORS] # Choose the monitoring lib this project uses.
# Possible values: newrelic
[--vcr] # Include `vcr` in this project's BDD stack?
[--sql] # SQL or No-SQL? If SQL, assumes postgresql
# Default: true
[--version]
Generate a new application with daiku
Consider the following example:
$ daiku new myapp --port 5000 --models datamapper --assets grunt --errors honeybadger --monitors newrelic --jobs sidekiq --vcr
This will generate the following app:
myapp
├── .bowerrc
├── .env
├── .gitignore
├── .grunt
│ ├── aliases.yaml
│ ├── coffee.coffee
│ ├── imagemin.coffee
│ ├── robotstxt.coffee
│ ├── sass.coffee
│ ├── slim.coffee
│ └── uglify.coffee
├── .node-version
├── .ruby-version
├── .slugignore
├── .travis.yml
├── Gemfile
├── Gruntfile.coffee
├── Procfile
├── README.md
├── Rakefile
├── app.rb
├── assets
│ ├── images
│ │ └── .gitkeep
│ ├── javascripts
│ │ └── app.coffee
│ ├── pages
│ │ └── .gitkeep
│ └── stylesheets
│ ├── .gitkeep
│ └── app.scss
├── bin
│ └── console
├── bower.json
├── config
│ ├── datamapper.rb
│ ├── pony.rb
│ ├── puma.rb
│ └── sidekiq.rb
├── config.ru
├── lib
│ ├── boot.rb
│ ├── core_ext
│ │ └── frame_options.rb
│ ├── errors
│ │ ├── .gitkeep
│ │ └── app.rb
│ ├── jobs
│ │ └── .gitkeep
│ ├── models
│ │ └── .gitkeep
│ ├── services
│ │ └── .gitkeep
│ ├── tasks
│ │ ├── .gitkeep
│ │ ├── datamapper.rake
│ │ └── db.rake
│ └── values
│ └── .gitkeep
├── package.json
├── public
│ ├── assets
│ │ └── .gitkeep
│ ├── favicon.ico
│ └── fonts
│ └── .gitkeep
├── spec
│ ├── _cassettes
│ │ └── .gitkeep
│ ├── app_spec.rb
│ ├── db_helper.rb
│ ├── models
│ │ └── .gitkeep
│ ├── services
│ │ └── .gitkeep
│ ├── spec_helper.rb
│ └── vcr_helper.rb
└── views
├── index.slim
└── layout.slim