Template for a modern CFML application with a containerized development environment. This template does by no means always represents the state of the art or the best possible solution, but I hope someone can benefit from it.
Backend
- Lucee 5.3 -> CFML Engine running in Commandbox Docker Container
- Taffy -> REST API Framework
- jwt-cfml
- cfmigrations -> Database Migrations
- PostgreSQL -> Database
Frontend
- Vue3 -> Frontend Framework
- Unix based OS (Linux, MacOS, WSL2)
- Docker (>= 24.0.5) -> This version already includes docker compose
- make (>= 4.4.1)
- nvm
- commandbox (optional -> Already running in docker container)
- cflint (optional -> VsCode Extension which needs a JAR file)
- Clone the repository:
git clone https://github.com/rabume/cfml-app-template
- Enter the directory:
cd cfml-app-template
- Copy the
.env.example
file to.env
and adjust the variables to your needs - Start development environment:
make dev
- Access the application (if not changed in
.env
):- Vue Frontend: http://localhost:3000 -> Login with
someGlobalKey
(if not changed in.env
): - Taffy Dashboard: http://localhost:8080
- Vue Frontend: http://localhost:3000 -> Login with
Currently, the global key is being utilized for user authentication. In a real-world application, the user would be authenticated through a login form, generating a JWT token for subsequent requests. Please note that this is just a basic illustration.
Command | Description |
---|---|
make dev |
Start development environment |
make clean |
Remove all containers and volumes |
make migrate |
Run database migrations (fresh) |
make seed |
Run database seeds |
make watch |
Watch for file changes |
You can find the deployment configuration in the /deploy
directory. Right now I use a makefile
to automate the deployment process. This is optional and can be replaced. The prod.env.example
contains the environment variables for the production environment. Instead of using a .env
file, you can also set the environment variables directly on your server.
make deploy
-> Deploy the application and runs the migrations