The Servian tech challenge app is a golang application used for challenging candidates applying to work with Servian.
readme.md - this file config.md - how to configure the application
Architectural decisions are recorded in the adr
folder, details on why can be found in the first entry
Naming convention: ####-<decision title>
where the first 4 digits are iterated by 1 for each record.
Single page application designed to be ran inside a container or on a vm (IaaS) with a postgres database to store data.
It is completely self contained, and should not require any additional dependencies to run.
- Download latest binary from release
- unzip into desired location
- and you should be good to go
This application is backed by a postgres db. Use the updatedb
command to create the database, tables, and seed with test data
Tested against:
- PostgreSQL 9.6
- PostgreSQL 10.7
update conf.toml
with database settings (details on how to configure the application can be found in config.md)
TechChallengeApp updatedb
to create a database, tables, and seed it with test data. Use -s
to skip creating the database and only create tables and seed data.
TechChallengeApp serve
will start serving requests
/
- root endpoint that will load the SPA
/api/tasks/
- api endpoint to create, read, update, and delete tasks
/healthcheck/
- Used to validate the health of the application
.
├── assets # Asset directory for the application
│ ├── css # Contains all the css files for the web site
│ ├── images # Contains all the images for the web site
│ └── js # Contains all the react javascript files
├── cmd # Command line UI logic is managed in this location
├── config # Contains the configuration logic for the application
├── daemon # Contains the logic of the daemon that runs and control the app
├── db # Contains the data layer and db connectivity logic
├── doc # Documentation folder
├── model # Data model for the application
└── ui # Web UI, routing, connectivity
The application itself is a React based single page application (SPA) with an API backend and a postgres database used for data persistence. It's been designed to be completely stateless and will deploy into most types of environments, be it container based or VM based.
Application is built using golang, this can be installed in many ways, go to golang to download the version that suits you.
If building using docker you need to have docker installed on your local machine. Download from the docker website
Download the application using go get:
go get -d github.com/servian/TechChallengeApp
run build.sh
to download all the dependencies and compile the application
the dist
folder contains the compiled web package
To build a docker image with the application installed on it
docker build . -t servian/techchallengeapp:latest
To pull a docker image pre-built
docker pull servian/techchallengeapp:latest
Continuous integration is managed through circleci and the build on the master branch will create a new release when a new version is defined.
Releases are deployed and managed through github, it's an automated process that is executed through the CI solution
To create a new release, update ../cmd/root.go
with the new version and merge that into the master branch.
The commit message on the merge, will be the release message, so make sure it contains the release notes.
A tag will be created on the master branch if the build and release is successful.
We use semver for versioning, major.minor.patch[-pre-release]
and the CI solution has been configured to take note of the -pre-release
tag of the version and upload it as a pre-release in git if it's included. So to release a new full release, make sure to not include -pre-release
and vice versa.
Builds will be produced for:
- MacOS (amd64)
- Linux (x86/amd64)
- Windows (x86/amd64)
- If you are setting up the database using RDS, do not run the
./TechChallengeApp updatedb
command. Instead run./TechChallengeApp updatedb -s