Posts Tagged ‘wheels.dev’


Creating a Basic CRUD Interface with Wheels 3.0

Accompanying Video

This blog post has an accompanying video posted to YouTube.

Welcome to the next installment in our Wheels 3.0 tutorial series! Today, we’ll guide you through creating a basic CRUD (Create, Read, Update, Delete) interface using the Wheels CLI. If you’re just joining us and don’t have the Wheels CLI installed yet, be sure to catch up with our previous video detailing the setup of your development environment.

Setting Up Your Wheels Project

To get started, we activate the `WHEELS NEW` command, which launches a wizard designed to help us build a new Wheels project efficiently. First, provide a name for your application—I’ll be using “myapp” as the demonstration name.

During the setup, you’ll be prompted to select which Wheels version to install, and we’ll choose the second option for Wheels 3.0. For development purposes, we’ll leave the reload password empty, but remember to set a secure password before moving to production. Next, the wizard will ask for a datasource name, which defaults to our application name and suits our needs.

You’ll then be asked to select a CFML engine for deployment, and we’ll stick with the default, the latest version of Lucee. Since we opted for the Lucee engine, it offers the use of a built-in H2 database—a great development option that avoids setting up a separate database server. We’ll go ahead and select “yes” to use it.

You’ll have the option to include the Bootstrap CSS framework to enhance the appearance of your app. Finally, decide whether you want a box.json file for uploading the project to Forgebox.io. For this project, I’ll choose “no.”

After confirming our settings, the wizard will download the specified 3.0 template, along with any necessary dependencies, setup the H2 database, integrate Bootstrap, and start the server. Once the installation is complete, we can explore what’s been set up.

Exploring the CLI Setup

The CLI generates a default Wheels installation skeleton, which it modifies based on our inputs, such as updating configuration files and creating essentials like the URL rewrite file and a server.json file.

Upon successful installation, the confirmation screen assures us with a set of configurations displayed on the Info tab. This includes details like application and datasource names, and confirms the H2 database driver installation with the ready-to-use datasource.

Creating a User Model

Now, it’s time to create users through the CLI. In CommandBox, we use the `wheels scaffold` command to begin creating a User model. We’ll bypass the database migration initially but note how this step has generated skeleton view files, a model file, and a controller in the app. This default setup is crucial for the business logic and user interactions.

To give the user model some structure, we use the command line to add properties like first name, last name, and email to the User model, although we’ll skip database migrations for these incremental property additions.

Consolidating Migration Files

Before executing database migrations, it’s wise to consolidate the migration files generated. Inside the app’s migrator/migrations folder are several CFC files. We aim to merge these into a single file, ensuring the `up` and `down` functions are properly matched—creating a table in `up` and dropping it in `down`.

Once consolidated, enhance the migration script by adding string-based columns for first and last names with a character limit, and a longer limit for emails, ensuring database integrity and conformity.

Running Migrations

Migrations can be executed via the CLI or the application’s user interface. Using the UI, navigate to the Migrator tab and run the migrations in sequence or opt for ‘Migrate to Latest’ to process all migrations.

Given that model configurations are cached, reload the application post-migration to let the framework update model configurations based on new database structures.

Finalizing the Application

Lastly, make the User index the default application page rather than the Congratulations page. Modify the routes.cfm file to direct URLs to the users index route by default. Reload the application to apply this routing change, and upon revisiting the default route, the Users page should now load by default.

This tutorial concludes our hands-on exploration of CRUD interface creation in Wheels 3.0 using CLI. We covered project setup, database configuration, scaffolding models, property additions, migration management, and front-end interfacing—all culminating in a functional application displaying user data.

Celebrating 20 Years of CFWheels: A Look Back and a Step Forward as Wheels.dev

As we ring in the new year, we’re thrilled to celebrate a monumental milestone: 20 years of CFWheels! This anniversary isn’t just a celebration of two decades of innovation, growth, and community; it’s also a moment to embrace the future with a new name—Wheels.dev.

A Legacy of Innovation

When CFWheels Beta was launched in 2005, the web development world was a vastly different place. ColdFusion was a dominant force, and frameworks like Rails were just beginning to reshape how developers approached web application development. Inspired by Rails, CFWheels set out to bring the same elegance and productivity to ColdFusion developers, becoming one of the first MVC frameworks in the ColdFusion ecosystem.

Over the years, CFWheels has empowered countless developers to build robust, maintainable web applications. Its commitment to simplicity, convention over configuration, and an active community made it a go-to choice for many.

The Community: The Heart of CFWheels

None of this would have been possible without you—the community. From contributors who improved the framework, to developers who adopted it for their projects, to those who joined discussions and shared knowledge—you are the reason CFWheels has thrived for 20 years.

Your passion and dedication have shaped the framework into what it is today. As we move forward, the community remains at the heart of everything we do.

Why the Name Change?

After two decades, the web development landscape has evolved dramatically, and so have we. While ColdFusion remains a core technology, the framework has grown to be more versatile and forward-thinking. The name Wheels.dev reflects this evolution:

  • Broader Appeal: The new name positions Wheels as a modern, technology-agnostic framework that’s ready to integrate with emerging technologies.
  • Simplicity and Clarity: “Wheels.dev” is concise, memorable, and speaks to developers everywhere.
  • Future-Proofing: This change signifies our commitment to staying relevant and adaptable in the ever-changing web development world.

What’s Next for Wheels.dev?

The transition to Wheels.dev is more than just a rebranding—it’s a signal of exciting changes to come. Here’s a glimpse at what’s ahead:

  • Revamped Directory Structure: The application directory structure has been modernized to adhere to best practices and more secure.
  • Enhanced Documentation: A revamped website with improved documentation to make onboarding and learning easier than ever.
  • Modern Features: Continued updates that embrace modern development practices, including support for APIs, cloud deployments, and integrations with other technologies.
  • Community Engagement: More opportunities to connect with fellow developers through forums, meetups, and contributions.

Looking Back, Moving Forward

As we celebrate 20 years of innovation, we’re filled with gratitude for everything the CFWheels journey has brought us. At the same time, we’re excited to step into the future as Wheels.dev.

To our community, past and present: thank you for believing in us, contributing to the framework, and building incredible projects with CFWheels. Together, we’ve created something truly special, and the best is yet to come.

Here’s to the next chapter as Wheels.dev—building faster, smarter, and together!

Stay connected: We will be building out the new site at Wheels.dev over the next few weeks, explore the new site and learn more about what’s ahead.