Quick Start Guide
Get up and running with Wheels CLI in minutes.
Prerequisites
CommandBox 5.0+
Java 8+
Database (MySQL, PostgreSQL, SQL Server, or H2)
Installation
Install CommandBox
Install Wheels CLI
Creating Your First Application
1. Generate Application
This creates a new Wheels application with:
Complete directory structure
Configuration files
Sample code
2. Configure Database
Edit /config/settings.cfm
:
Or use H2 embedded database:
3. Start Server
Visit http://localhost:3000
Creating Your First Feature
Let's create a blog post feature:
1. Generate Scaffold
This generates:
Model with validations
Controller with CRUD actions
Views for all actions
Database migration
Test files
2. Run Migration
3. Add Routes
Edit /config/routes.cfm
:
4. Reload Application
5. Test Your Feature
Visit http://localhost:3000/posts
You now have a fully functional blog post management system!
Development Workflow
File Watching
In a new terminal:
Now changes to .cfc
and .cfm
files trigger automatic reloads.
Running Tests
Adding Relationships
Let's add comments to posts:
Common Tasks
Adding Authentication
Adding API Endpoints
Working with Views
Best Practices
1. Use Migrations
Always use migrations for database changes:
2. Write Tests
Generate tests for your code:
3. Use Environment Configuration
4. Version Control
Add to .gitignore
:
Debugging
Check Logs
Enable Debug Mode
In /config/settings.cfm
:
Common Issues
Port already in use:
Database connection failed:
Migration failed:
Next Steps
Read the Guides:
Explore Commands:
wheels --help
wheels generate --help
wheels dbmigrate --help
Join the Community:
Example: Complete Blog Application
Here's a complete blog setup:
You now have a working blog with posts, authors, and comments!
Last updated
Was this helpful?