diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3675bb6..4dd16f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,8 @@ # Contributing -## Formatting python code +## Formatting + +### Python This repository uses [autopep8](https://pypi.org/project/autopep8/) to format Python code with its default settings. @@ -20,7 +22,7 @@ Check formatting by running: pycodestyle --exclude back-end/server/settings.py,*/migrations/*.py . ``` -## Formatting TF configuration +### TF This repository uses `tofu fmt` to format `.tf` configuration files. @@ -36,7 +38,7 @@ Check formatting by running: tofu fmt -check -recursive ``` -## Formatting other code +### Other code This repository uses [Prettier](https://prettier.io/) to format code with its default settings. diff --git a/README.md b/README.md index c7fec61..21b22d2 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,26 @@ This is an example application for: - Learning basics of how modern web applications are built with HTML, CSS, JavaScript, servers, and databases. - Deploying something a little more advanced than a _Hello world!_ page or unconfigured nginx server. +## Running the application + +To run the application on your machine, you will need [Docker Compose](https://docs.docker.com/compose/). You can either install it manually or by using Docker Desktop (see also [Installing Docker](https://cicd-tutorials.net/#installing-docker)). + +To start the application, run `docker compose up -d`. This will build the container images and start the containers in the background. The application should be soon available in [http://localhost:8080](http://localhost:8080). The API container will create two demo forms, which are available in [/thumbs](http://localhost:8080/thumbs) and [/weather](http://localhost:8080/weather) paths. + +```sh +docker compose up -d +``` + +If you want to inspect the admin panel, print out the content of `/var/feedback/initial_admin_password` in the `api` container with `docker compose exec` for the initial admin account password. Admin panel is available in [http://localhost:8080/admin](http://localhost:8080/admin) and the username for the admin account is `admin`. + +```sh +docker compose exec api cat /var/feedback/initial_admin_password +``` + +For a more production like deployment, there is an OpenTofu/Terraform configuration example in [iac/tf](./iac/tf/) directory. + + + ## Three-tier architecture The application is built using a three-tier architecture. I.e., the application consists of presentation tier, application tier and a data tier.