We are continually bombarded with the latest and greatest new (or at least new to us) “thing” and constantly told we should integrate this or that right away! Keeping up with new technologies, modules, libraries, etc. can be a full-time job in itself.
In this session we will explore one of the “things” you may have heard tossed around, CBWire! We will go a little deeper than a typical “Elevator Pitch” and discuss what CBWire is, what it can do, and end with a live coding demonstration of how easy it is to integrate into an existing ColdBox application while building our first wire. We will end with a Q & A and hopefully gain a few more CBWire fans!
This repository contains the CBWire demos used for this presentation and more.
Copy .env.example to .env in the root of the repository
There are not any environment variables that need to be changed when copying .env.example to .env, However there are a few optional values you might want to modify. Setting the DEMO_USER_* values will allow ColdBox to reset the primary demo user on every appinit
# Demo User (ID=1) Info (will be reset on appinit. Remove or set to blank to disable)
DEMO_USER_EMAIL=you@example.com
DEMO_USER_PASSWORD=password
DEMO_USER_FIRST_NAME=Jonathon
DEMO_USER_LAST_NAME=Deauxville
DEMO_USER_TITLE=Baron
Five commands to get going! Start CommandBox in the root of the repository, change into the wwwroot folder, install dependencies, go back to the root directory, and fire up the server!
box
cd wwwroot
install
cd ..
server start- Includes a SQLite database
- SQLite database path defined in the
.envfile and used to define datasource inapplication.cfc - Initial Modules Installed:
- QB
- Quick
- CBSecurity
- BCrypt
- cbvalidation
- cbdebugger *not fully supported in boxlang yet, but leaving it in for now in hopes it will soon!
- CBWire (Of Course!)
- When
ENVIRONMENT=developmentin the.envfile you can automtically login usingCOMMAND KEY + lon mac andWINDOWS KEY + lon windows - Working CBSecurity user authentication
- Uses the AdminLTE Bootstrap open source admin dashboard & control panel theme
- Contains multiple CBWire demos covering many features of CBWire
- Contains a
.demofolder with demos for use with Demo Time VSCode Extension- I was first introduced to DemoTime from Modernize or Die >>> Demo Time - VSCode Hint Tip and Trick of the Week - 12/31/24 - Episode 226
Side Note: this is a basic stack I like to start with on projects to get jump started and add or remove from there.
To support CFML
To support image resizing of profile image
To support CBWIRE and csrfGenerateToken() and csrfVerifyToken()
To support the demo SQLite database
To support encodeFor*
-
If the server is having trouble finding the SQLite Database when started up, you can put the absolute path for the SQLite Database:
DB_PATHenvironment variable in.envreplacing the relative path ofDB/catchingWire.db(Note: If you change the.envfile make sure to restart commandbox to refresh the environment variables) -
If you want to run
fwreinitfrom the command line you will need to change into thewwwrootdirectory withcd wwwroot
A very useful, simple, and free tool for Mac users to interact directly with the SQLite DB is DB Browser for SQLite
Great for all things CBWire
Fabulous examples of a multitude of CBWIRE features
CBWire uses Livewire.js and is essentially the CF port of Livewire. Once I was more familiar with CBWire it became easier to look through the livewire documentation and corelate the PHP parts to CBWIRE counterparts.
Livewire includes alpine.js out of the box and adds some great features when your ready to dive into it deeper
used for all the code syntax highlighting at the bottom of each CBWire demo page.
The open source admin dashboard & control panel theme used in this demo
