
Pre-Introduction
Welcome to the ColdBox Zero to Hero workshop. Meet your trainer, Gavin Pickin, and learn about his background with Ortus Solutions, coldfusion, and ColdBox MVC. Learn why we designed the training the way we did.
In this video, we start on our twitter clone, by scaffolding our Base Application,using CommandBox. We'll create our scaffold, and then start our CFML server up (using CommandBox) and see what we get with a newly created app. We'll browse the tests from TestBox in the browser, and run the tests in the CLI as well.
Take hands-on step one by building the base app with bots, using the code box application and command boxes, then run tests and view the local server and test runner.
Demonstrates the code box framework anatomy, Kobuk settings, caching, and interceptors, and guides configuring development versus production environments with environment variables and an example file.
Explore ColdBox config and routing by examining framework tight integration, environment variables, and development/production modes; learn to restart servers, reload environment variables, and work with router, CFC, and views.
Explore mvc conventions in ColdBox by treating handlers as controllers, sharing data to views via rc and prc, and placing business logic in models while views remain presentation only.
This hands-on walkthrough shows creating a new handler, defining actions and links, and routing from the handler to different views while demonstrating looping through links and data.
Create your own layout from the instructions below, add a style sheet to the includes folder, ensure all links are connected, and apply the new layout to your app.
Explore how to apply layouts in ColdBox handlers, assign module or handler level layouts, and use pre, post, and around handlers with explicit exceptions for login checks.
Set up database migrations with mamba migrations, perform up and down migrations, and track changes via a migration table while using environment variables and the Cube schema builder.
Install and configure the C Migration's module, then run your first migration's up and down to ground your stuff, as the rest of the app relies on Sea Migration's.
learn to create a base integration spec in ColdBox, wire in the migration service, and run migrations automatically with around each to guarantee a fresh test database.
Create a new base integration spec and update the existing test to use the base spec instead of the code box based spec, following the provided instructions.
In ColdBox, create a user service CFC in a TDD workflow, implement a list function, and learn singleton persistence versus transient lifetime for managing users across requests.
Connect the USA service model to the Hamlet view using dependency injection powered by Wyborcza Box, with a handler and scope to expose data to the viewer.
Explore implementing user login and logout by replacing flash messages with a message box, wiring authentication via a CBS module and a dedicated user service, and securing sessions.
Learn to use the html helper and cbAuth for registration and automatic login, and to display users with the table helper. Explore testing and safe refactoring in this ColdBox lesson.
Compare cflocation and relocate, explaining how relocate defers page relocation until the box life cycle completes, enabling safe testing with wrappers and accurate relocation testing.
Explains the cold box request life cycle from the browser to the request context and event controller, to the layout and the view, with interceptors handling pre-process and post-process events.
Build a login and logout flow, install new security, and implement the required methods while using a model, creating hammer views and tips, and linking them all together.
Create a rants table with an auto-increment id, body, created and modified timestamps, and a user_id foreign key, using the schema builder; then build test-driven integration tests and mocks.
Explore building a rant feature from authentication to persistence, using test-driven development, service injections, and model relationships to create, list, and relocate rants.
Move the rents outside the if statement so rents are always present, fix a logic flaw that caused Altice to fail when clearing the database, and show how tests help.
Configure the home redirect to the rants page and secure routes using cbSecurity. Implement authentication and authorization rules, and use the security visualizer after installing the cybersecurity module.
Apply cyber security measures to secure the app and enforce the login requirement before creating new Rentz step living instructions.
Create a user show page to display a user's rants by wiring a user handler, routing /users/{username}, and rendering the rants with a partial view.
Implement reactions by creating a bumps table and a many-to-many relation, build a reaction service to manage bumps and poops, and update the rent view to display counts.
Perform hands-on step 13 to build social media–style reactions, upgrade database migrations, create rent view on the user page, and implement a reaction service updating the rent model with helpers.
Make the reactions functional by gating bump and poop options on login, posting to the rant endpoints, and updating counts with a reaction service that tracks has_bumped and has_pooped.
Enhance reactions by updating the view to show counts, enable clickable reactions for logged-in users, add a respond handler for purchasing clothes, and include helpers to track and remove reactions.
Join us for an in-depth, hands-on workshop where you’ll dive into the latest features of ColdBox 6, the most popular CFML MVC framework. Whether you’re a seasoned ColdBox user or new to the framework, this session is designed to guide you through everything you need to build powerful, maintainable, and scalable applications.
Prerequisites
Latest CommandBox CLI
A local database server (MySql 8 is recommended)
Basic to Intermediate ColdFusion (CFML) Knowledge
IMPORTANT - DISCLAIMER
This course was done live with students as part of our training seminars. The entire course can be found in our GitHub repository as well. Please note that since the format of this course was done on-site, some information might be missing context or done off-camera.
What You’ll Learn
This workshop will start with the fundamentals and gradually progress to advanced concepts. Here’s a glimpse of what you can expect:
• Getting Started with ColdBox 6: Learn the installation process, framework templating, and core configuration to set up your project with ease.
• Advanced HMVC Development: Master Hierarchical MVC with modules for organized, modular, and reusable codebases.
• Building RESTful APIs: Discover how to create robust APIs with ColdBox, making your applications ready for modern client-server communication.
• Interception Points: Gain control over application workflows by leveraging the interception point system for event-driven development.
• Integration Testing: Implement comprehensive testing strategies to ensure the quality and reliability of your applications.
Building a Real-World Application: SoapBox
To solidify your learning, we’ll focus on building SoapBox, a dynamic micro-blogging application. This project will demonstrate key ColdBox concepts and methodologies, ensuring you leave the workshop with practical, real-world experience.
• Behavior-Driven Development (BDD): Harness the power of BDD to design, test, and refine your application features.
• ForgeBox Integration: Use popular ForgeBox modules to enhance your application with prebuilt, reusable components and tools.
By the end of this workshop, you’ll have a deep understanding of ColdBox and the confidence to apply its capabilities to your projects. Whether you’re building modern web applications or APIs, this session will equip you with the knowledge and tools to succeed.