BoxLang 🚀 A New JVM Dynamic Language Learn More...
This directory contains a user management and authentication web application built with the Wheels framework (Wheels 4.x), an MVC framework inspired by Ruby on Rails. The app demonstrates Wheels conventions, security practices, and a Bootstrap UI.
Important: This is not a complete, full-featured app, but rather a starter/example app built with Wheels 4.x. It is designed to help you get started and to showcase best practices in authentication, authorization, auditing, and modern web UI using Wheels.
See the Quick Start section below for setup instructions.
Admin users have access to comprehensive management features:
User Management:
Role & Permission Management:
System Administration:
app/
├── controllers/ # Application controllers
│ ├── Controller.cfc # Base controller with security
│ ├── Main.cfc # Home page controller
│ ├── Sessions.cfc # Authentication controller
│ ├── Register.cfc # User registration
│ ├── PasswordResets.cfc # Password management
│ ├── Accounts.cfc # User account management
│ └── admin/ # Admin controllers
│ └── functions/ # helper functions
├── models/ # Data models
│ ├── User.cfc # User model with authentication
│ ├── Role.cfc # Role model
│ ├── Permission.cfc # Permission model
│ └── Auditlog.cfc # Audit logging
|── global/ # application-wide globally accessible functions
├── views/ # Presentation layer
├── mailers/ # Email templates
plugins/ # Legacy plugins the app still uses (authenticateThis, FlashMessagesBootstrap, jsconfirm)
vendor/wheels/
wheels
start (lucee.json); CommandBox's Lucee also
works (see below)wheels start, wheels migrate)wheels), 4.2 or
later. See the installation
guide for Homebrew, Scoop, apt and yum.The release zip includes the framework in vendor/wheels/
and uses an embedded SQLite database, so there's
nothing else to install and no database server to run.
# 1. Unzip the release and change into it
unzip wheels-starter-app-<version>.zip -d my-starter-app
cd my-starter-app
# 2. Create .env, then set WHEELS_RELOAD_PASSWORD and
# WHEELS_LUCEE_ADMIN_PASSWORD in it to values of your own
cp .env.example .env
# 3. Start the server (http://localhost:8080)
wheels start
# 4. Create the schema and seed the default data
wheels migrate latest
# 5. Reload so the app picks up the seeded settings
wheels reload
Until step 4 has run, the site returns an error such as key
[general_sitename] doesn't exist: the app reads its
settings table when it starts. wheels migrate
latest and wheels reload need the reload password
from step 2.
The database files are db/development.sqlite and, for
the tests, db/test.sqlite.
Default sign-in credentials are seeded by the migrations — see app/migrator/migrations/20180519105944_Adds_Default_UserAccounts.cfc.
The app also runs on CommandBox.
CommandBox's Lucee has no SQLite driver, so under CommandBox the app
uses an H2 embedded database instead:
server.json installs the H2 Lucee extension and sets
WHEELS_STARTER_DB=h2, which config/app.cfm
checks. The data files go in db/h2/.
# 1. Create .env and set WHEELS_RELOAD_PASSWORD in it, as in step 2 above
# (WHEELS_LUCEE_ADMIN_PASSWORD is only read by `wheels start`)
cp .env.example .env
# 2. Start the server (http://localhost:8081)
box server start
# 3. Create the schema and seed the default data: open the migrator page
# http://localhost:8081/wheels/migrator
# and click "Migrate To Latest", then "Confirm & Execute".
# 4. Restart the server so the app loads the seeded settings
box server restart
The wheels CLI commands, such as wheels migrate
latest, talk to a server started with wheels
start, so use the migrator page here.
To point the app at MySQL, PostgreSQL, SQL Server, or Oracle:
.env.example to .env
config/app.cfm
with one that reads the this.env.DB_* values (the
original env-driven MySQL example is preserved in the comments of .env.example)DB_TYPE=mysql
DB_HOST=localhost
DB_PORT=3306
DB_NAME=starterapp
DB_USER=youruser
DB_PASSWORD=yourpassword
DB_TYPE=postgresql
DB_HOST=localhost
DB_PORT=5432
DB_NAME=starterapp
DB_USER=youruser
DB_PASSWORD=yourpassword
DB_TYPE=mssql
DB_HOST=localhost
DB_PORT=1433
DB_NAME=starterapp
DB_USER=youruser
DB_PASSWORD=yourpassword
DB_TYPE=oracle
DB_HOST=localhost
DB_PORT=1521
DB_NAME=starterapp
DB_USER=youruser
DB_PASSWORD=yourpassword
DB_TYPE=h2
DB_HOST=localhost
DB_PORT=9092
DB_NAME=starterapp
DB_USER=sa
DB_PASSWORD=
tests/
├── runner.cfm # Entry point for /wheels/app/tests (the app template's runner)
├── populate.cfm # Migrates the test database before each run
├── specs/ # WheelsTest (BDD) specs: what the runner runs
└── RocketUnit/ # Legacy RocketUnit tests from the 3.x app (not run)
With the server running, open:
http://localhost:8080/wheels/app/tests
(port 8081 under CommandBox). Add ?format=json for a
JSON result. The specs run on the starterApp_test
datasource (SQLite, or H2 under CommandBox; defined in
config/app.cfm), which tests/populate.cfm
migrates before every run, so they never touch the development database.
This starter application is released under the Apache License 2.0.
Remember: This is a skeleton/starter application designed to showcase Wheels best practices. Use it as a starting point for your own projects and extend it according to your specific requirements.
$
box install wheels-starter-app