wheels new

Start a new CFWheels application quickly and easily

A wizard to create a new CFWheels application

$ wheels new

Walkthrough

App Name

So first, we need to enter an application name. This will be used as the folder name, the default datasource name, and also the Application this.name value. For this example, we're going to use myapp.

CommandBox:test> wheels new
========= Hello! =================================
= Welcome to the CFWheels app wizard. We're here =
= to try and give you a helping start for your   =
= first app.                                     =
==================================================

========= We Need Some Information... ============
= To get going, we're going to need to know a    =
= NAME for your application. We recommend        =
= something like myapp to start with             =
==================================================

Please enter a name for your application: myapp

Version

========= Version?... ============================
=   1) 1.4.5 via Forgebox                        =
=   2) Master Branch via Git                     =
==================================================

Please enter your preferred version [1-2]: 2

When new CFWheels versions get released, we will be adding the recommended options here. At the time of writing this documentation there isn't a stable 2.x release. The Master Branch will essentially do a git clone from the cfwheels/cfwheels repo.

For this example, that's what we're after as the CLI doesn't support version 1.x

Reload Password

========= And a 'Reload' Password ================
= We also need a 'reload' password. This can be  =
= something simple, but unique and known only to =
= you; Your reload password allows you to restart=
= your app via the URL. You can change it later  =
= if you need!                                                             =
==================================================

Please enter a "reload" password for your application: foo

To encourage best practice, we ask you to set a reload password: it needn't be complex, but do make it unique!

Datasources

========= Data...data...data..       =============
= All good apps need data. Unfortunately you're  =
= going to have to be responsible for this bit.  =
= We're expecting  a valid DataSource to be      =
= setup; so you'll need mySQL or some other      =
= supported DB server running locally. Once      =
= you've setup a database, you'll need to add it =
= to the local CommandBox Lucee server which     =
= we'll start in a bit. For now, we just need to =
= know what that datasource name will be.        =
=                                                =
= if you're going to run lucee, we can autocreate =
= a development database for you later           =
==================================================

Please enter a datasource name if different from myapp:

If you'd like your datasource name to be different, you can enter it here, but for our example, we're just keeping with myapp, and so can just press enter.

Default CF Engine

========= Default CFML Engine        =============
= Please select your preferred CFML engine for   =
= local development: you can always change it    =
= later!                                         =
=                                                =
=  1) lucee 4.5 (Commandbox default)             =
=  2) lucee 5.x                                  =
=  3) Adobe ColdFusion 10                        =
=  4) Adobe ColdFusion 11                        =
=  5) Adobe ColdFusion 2016                      =
==================================================

Please enter your preferred engine: [1-5] 2

This is the CFML engine we're going to add to local server.json; I'm going to select Lucee 5.x

Development Databases

As you are using Lucee, would you like to use an embedded 
H2 database for development? [y/n] : y

This then gives me an option to create an H2 database (as I selected Lucee - H2 isn't available in Adobe ColdFusion) - this is a file based database which lives in /db/h2/ - it's a very useful way to get started very quickly without having to install mySQL or some other platform. Selecting y here will write the necessary configuration to config/app.cfm which will then autocreate the database when the application starts.

Confirm and go!

Great! Think we all good to go. We're going to install CFWheels in '/myapp/', 
with a reload password of 'foo', and a datasource of 'myapp'.
We're also going to try and setup an embedded H2 database for development mode.
Sound good? [y/n] : y

This will then execute the installer.

Example output

========= Installing CFWheels..........
Package: cfwheels does not exist!
Try 'artifacts list' to see what packages are in the cache.

Installing package [github:cfwheels/cfwheels]
Cloning Git URL [https://github.com/cfwheels/cfwheels.git]
remote: Counting objects: 45209
remote: Compressing objects: 100% (56/56)
Receiving objects:      100% (45209/45209)
Resolving deltas:       100% (27953/27953)
Updating references:    100% (68/68)
box.json is missing so this isn't really a package! I'll install it anyway, but I'm not happy about it
I'm just guessing what the package name, version and type are.  Please ask the package owner to add a box.json.
D:\test/box.json updated with dependency.
Installing to: D:\test\016566EC-D289-4C38-9880AFEEFAEAD746/cfwheels
-> 769 File(s) Installed
-> 0 File(s) ignored
Eureka, 'cfwheels/cfwheels' has been installed!
========= Moving Contents ..........
Directory renamed/moved to D:\test\myapp
========= Removing Temp Dir.........
Deleted D:\test\016566EC-D289-4C38-9880AFEEFAEAD746
========= Navigating to new application...
D:\test\myapp
========= Creating config/app.cfm
========= Creating Development Database
========= Creating /db/h2/ path
========= Adding Datasource to onApplicationStart
========= Creating config/settings.cfm
========= Creating default server.json
Dir           0 Feb 20,2017 11:02:54 config
Dir           0 Feb 20,2017 11:02:54 controllers
Dir           0 Feb 20,2017 11:02:58 db
Dir           0 Feb 20,2017 11:02:54 events
Dir           0 Feb 20,2017 11:02:54 files
Dir           0 Feb 20,2017 11:02:54 images
Dir           0 Feb 20,2017 11:02:54 javascripts
Dir           0 Feb 20,2017 11:02:54 miscellaneous
Dir           0 Feb 20,2017 11:02:54 models
Dir           0 Feb 20,2017 11:02:54 plugins
Dir           0 Feb 20,2017 11:02:54 src
Dir           0 Feb 20,2017 11:02:54 stylesheets
Dir           0 Feb 20,2017 11:02:54 tests
Dir           0 Feb 20,2017 11:02:54 views
Dir           0 Feb 20,2017 11:02:57 wheels
File        137 Feb 20,2017 11:02:54 .editorconfig
File        156 Feb 20,2017 11:02:54 .gitignore
File        843 Feb 20,2017 11:02:54 .htaccess
File       1629 Feb 20,2017 11:02:54 .travis.yml
File         65 Feb 20,2017 11:02:54 Application.cfc
File         54 Feb 20,2017 11:02:54 index.cfm
File      18804 Feb 20,2017 11:02:54 pom.xml
File       2201 Feb 20,2017 11:02:54 README.md
File         54 Feb 20,2017 11:02:54 rewrite.cfm
File        154 Feb 20,2017 11:02:54 root.cfm
File        307 Feb 20,2017 11:02:58 server.json
File        334 Feb 20,2017 11:02:54 server-cf10.json
File        335 Feb 20,2017 11:02:54 server-cf11.json
File        339 Feb 20,2017 11:02:54 server-cf2016.json
File        335 Feb 20,2017 11:02:54 server-lucee4.json
File        336 Feb 20,2017 11:02:54 server-lucee5.json
File       1481 Feb 20,2017 11:02:54 urlrewrite.xml
File       1201 Feb 20,2017 11:02:54 web.config

========= All Done! =============================
= Your app has been successfully created. Type   =
= 'start' to start a server here.                =
=                                                =
= Once you've started a local server, we can get =
= going with scaffolding and other awesome things=
==================================================

As you can see, CFWheels is downloaded, then renamed to a directory matching the app name; Various files are written for the request configuration and from that point you just need to do start to get going!