This repo contains a sample application for managing packaging. It is able to define packs size, and determine how many packs are needed for optimal delivery of a package.
Contains two parts: UI and Backend
The backend is present under server and is build with Golang.
It is dependent on a database, so that needs to be setup for the app. There are two options to get this working:
Under the server folder, there is a docker compose setup for starting a PostgreSQL container. Docker is required on the local machine for this to work. Can be started with
docker-compose -f db-docker-compose.yml logs -fThis exposes a database on localhost:6432, with name server, user server and pass server.
After this the golang app can be run with (this will set the default OS env vars for the app)
make runIf another database needs to be used, for example some local one on the system, just the make run command needs to be adjusted to that database props
make run DB_HOST=val DB_PORT=val DB_USERNAME=val DB_PASSWORD=val DB_NAME=valThe application can be accessed on http://localhost:8080
The UI application is build with Angular, and node is needed to run it.
npm startThe application can be accessed on http://localhost:4200
There is also an option to run the UI and backend as a bundle with docker-compose. The root folder has this file exposed, and can be executed with
docker-compose build
docker-compose up -dThe application can be accessed on http://localhost
The application is deployed on Render (free tier), and managed though render.yaml config.
3 services are created here:
- db - postgresql
- web service (go)
- static page (angular app)
UI can be accessed at https://ui-lfty.onrender.com/, and backend at https://server-k4jj.onrender.com