df/README.md
itsscb 86186af05a
Itsscb/issue_Add-Dockerfile-for-backend-57 (#61)
* Add Dockerfile for backend
Fixes #57

* Add Dockerfile for backend
Fixes #57

* removes a temporary test relict

* Major changes in Makefile
2023-10-02 22:03:23 +02:00

2.0 KiB

df

To first run the application in your local environment you can use

# to (re-)build the app image including migration
make backend_build

# to run the db and the app as docker images
make backend

or run those commands, listed in Makefile, manually with your terminal in the repository root directory.

Prerequisites

To create a local development environment you need some tools.

Backend

Basics

You need the basics if you just want to start a test environment to test the application.

If you wish to use the Makefile you need make which should be available for most linux systems.

However if you are on Windows you could use GnuWin32.Make which can be installed on Windows 11 using:

winget install GnuWin32.Make

Database

To work with the database you need the following tools.

Container software

You can use either docker or podman. But the Makefile uses the docker command.

If you wish to use podman you can create a symlink to make it work. On fedora it works like this:

# Rename the docker binary:
sudo mv /usr/bin/docker /usr/bin/docker_bkp

# Create a symlink
sudo ln -s /usr/bin/podman /usr/bin/docker
golang-migrate

golang-migrate makes db schema initialization and updates easy.

You can install it as described here.

Furthermore the binary should be in your PATH environment variable.

Server

To run the server you need go installed. See here for instructions

Developing

Should you want to make changes you need further tools.

  • sqlc: For generating code from postgres queries
  • gomock: For generating a mock database for testing

Frontend

This section will be added as soon as we begin with the development of the frontend