This project is POC of using ColdBox stack for DFO internal/external site project.
This project:
- Utilize ColdBox HMVC framework as fundation
- Utilize ColdBox-Elixir template (Coldfusion+VueJS) from ColdBox
- Utilize Bootstrap/BootstrapVue (most common UI framework in the world)
- Utilize RESTFul Backend (other project)
- Utilize Vue+Axios for Javascript REST call
- Utilize Hyper for Coldfusion REST Call
- Utilize JWT for Authentication
- Utilize CBSecurity for Authorization
- Utilize CBORM (powered by Hibernate) for quick Scaffolding for DB access
- Backend (other project) uses Windows Domain Authentication
- Backend (other project) integrated with PACADMIN
A list of commonly used resources that I find helpful are listed here.
This is an example of how setup DEV environment.
FOR Development:
CommandBox and Node.js are requried.
- commandbox (similar to npm for JS, this is Coldfusion package management tool)
https://www.ortussolutions.com/products/commandbox
- npm
npm install npm@latest -g
-
Clone the repo, put in DFO App Folder
git clone https://github.com/ios-patricia/cbui.git
-
Setup IIS Rewrite for new folder for user-friendly URL, Sample:
<rule name="redirect cbui" stopProcessing="true"> <match url="^cbui/(.*)$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="/cbui/index.cfm/{R:1}" /> </rule>
-
Install ColdBox and its modules
box install
-
Install NPM packages
npm install
-
Compile Javascript
npm run dev
-
Setup NEW DB under Coldfusion Admin
-
Config .cfconfig.json file and .env file for DB access
sample(partial) .cfconfig.json file. ColdBox uses this config file format
"datasources" : { "${DB_DATABASE}":{ "host":"${DB_HOST}", "dbdriver":"${DB_DRIVER}", "database":"${DB_DATABASE}", "dsn":"jdbc:derby:{dbfolder}", "custom":"", "port":"${DB_PORT}", "class":"${DB_CLASS}", "username":"${DB_USER}", "password":"${DB_PASSWORD}", "connectionLimit":"100", "connectionTimeout":"1", "dbfolder":"${DB_FOLDER}" } }
sample(partial) .env file. App config info
# Database Information DB_CONNECTIONSTRING=jdbc:derby:C:\wwwroot\cbui\DBFile DB_CLASS=org.apache.derby.jdbc.EmbeddedDriver DB_DRIVER=Generic DB_DATABASE=cbui-passwordsafe DB_USER= DB_PASSWORD= DB_FOLDER=C:\wwwroot\cbui\DBFile
- Landing page is for un-authenticated user
- Authentication used JWT, REST Call from RESTFul backend
- Password page is for authorized users, and use CBOrm scaffolding (i.e. NOT calling RESTFul Backend)
- Contacts page is for authorized users, and use Javascript REST call
applicationfolder // Your ColdBox Application Folder
├── coldbox/ // ColdBox sytem files, will be installed after we run box install
├── config/ // ColdBox config file.
├── handlers/ // controllers in MVC concept, called handler in ColdBox
├── includes/ // JS/CSS/as well as some common coldfusion function if needed
├── interceptors/ // interceptors -- hooks
├── layouts/ // layouts file ONLY, views under other folder
├── models/ // models in MVC concept, includes both entity model and service model
├── modules/ // ColdBox modules, for ex, CBORM, CBSecuirty, Hyper. install after run box install
├── modules_app/ // HMVC folder for Subapps/Components. for ex: HR/Accouting/Billing
├── node_modules/ // node modules for development only. after run npm install
├── resources/ // JS source folder, similar to _src folder
├── testbox/ // TDD engine
├── tests/ // TDD logic if being used
├── views/ // views in MVC concept
├── .babelrc // babel config file for transpile JS
├── .cfconfig.json // ColdBox running config format
├── .env // App running config .env file
├── Application.cfc // ColdBox entry point, need some twicks for mapping and ORM
├── box.json // CommandBox config file, similar to packege.json to NPM
├── favicon.ico
├── index.cfm // redirect entry point
├── package-lock.json
├── package.json // npm config file
├── README.md
├── robots.txt
├── server.json // CommandBox server command config
└── webpack.config.js // webpack config for compile JS
- Run ColdBox Framework under DFO server settings
- Install from ColdBox-Elixir template
- Add Theme
- Add Authenticatioin and Authorization
- Scaffolding CRUD from ColdBox
- REST Call from inside Coldfusion
- REST Call from Javascript
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License.
ios-patricia
Project Link: https://github.com/ios-patricia/cbui
- DFO for providing opportunity to discover new framework