Frontend demo application to be used with trainee-cdk.
Developed using Swift on Server and the Vapor framework (including the Leaf library).
Follow the instructions on the official Vapor website to install the client application.
On a Mac, you can use Homebrew to install the CLI using the following command.
brew install vapor
Run the Vapor new
command.
vapor new trainee-frontend
The command will generate a trainee-frontend
folder with this structure
trainee-frontend
Public
- Files to be served to client without processing (images, CSS files)Resources/Views
- Leaf templatesSources/App
Controllers
- Controllers that handle routes defined inroutes.swift
configure.swift
entrypoint.swift
routes.swift
Tests
docker-compose.yml
Dockerfile
Package.swift
To build the application into an executable run the command
swift build
To build and run the application
swift run
To build and run the unit tests
swift test
The buildspec.yml
configuration file is used to tell
CodeBuild how to build this project and what the artifacts are.
The appspec.yml
configuration file is used to tell
CodeDeploy how to deploy artifacts and run the application in production.
The configuration also makes use of the scripts found in the Scripts
folder
to manage the lifecycle of the application.