Skip to content

starwit/SmartParkingConfig

Repository files navigation

Introduction

This repository contains an application that allows you to define areas to observe present objects and thresholds to count objects moving across. It is called SmartParkingConfig because its first use case is the management of parking spaces. It is open source under the AGPL license and other usages are recommended. For more details on licensing see section License.

What does it do?

This software provides graphical tools to manage parking spaces. Users can define various area types that creates a configuration for a parking space which will then converted into AI based counting and monitoring jobs.

Installation

This application runs on Kubernetes and standard installation tool is Helm. See section Development for other ways to run software in an dev environment.

Deployment with Helm

Helm is a templating engine, that generates Kubernetes config files. It can be used to install, upgrade or delete apps on Kubernetes.

Prerequisites

All artifacts for this app are stored in custom registries. For instructions how to use those please refer to Wiki.

# create a namespace for your application
kubectl create ns spc

# install app into created namespace
helm -n spc install spc internal/smartparkingconfig -f customvalues.yaml

# upgrade app
helm -n spc upgrade spc internal/smartparkingconfig -f customvalues.yaml

# delete app
helm -n spc uninstall spc

Custom Values File

For target environment some configuration is necessary. In Helm you can provide config data via a custom value file. See the template value file for an example. More detailed explanation for individual fields are provided in the Readme file.

Build

Build with Github

  • Docker image & Helm chart are released to custom registry
  • Custom runner necessary to reach custom registry

Custom runner installation

Please refer official documentation on how to install Github runners at: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners

Development Setup

Prerequisites

  • Java JDK 17 or later
  • Maven 3
  • NodeJs (16.9.1) and NPM (8.3.2) - NodeJS Install
  • Postgres (available for development via docker-compose scripts)
  • using Keycloak is optional

Installation Steps

Each step is executed from the project home directory.

  1. go to the deployment folder and start the environment (database and keycloak) via docker compose:

    cd deployment
    docker compose -f localenv-docker-compose.yml up
  2. go to webclient/app and install the frontend applications dependencies

    cd webclient/app
    npm install
  3. go to Main Folder and build the project

    mvn clean install -P frontend
  4. start project

    java -jar application/target/application-0.0.1-SNAPSHOT.jar

    You can also run the main-class via Visual Studio Code.

Debugging

Frontend Debugging

For debugging, you can start the frontend separately.

cd webclient/app
npm run dev

Vite dev server starts under http://localhost:5173/ by default. Requests to http://localhost:5173/api are automatically proxied to http://localhost:8081/smartparkingconfig/api which is where the app will run by default, so you just need to start the app locally (preferable without auth) for the dev server version to be fully functional.

If you are using the installation with keycloak, make sure you are logged in before first usage - just go to localhost:8081/starwit in your browser.

Backend Debugging

You can start the spring boot application in debug mode. See Spring Boot documentation for further details. The easiest way is, to use debug functionality integrated with your IDE like VS Code.

Postgres Client

The database is available under smartparkingconfig-db:5432 (using pgadmin of docker compose script)

Username:smartparkingconfig
Database:smartparkingconfig
Password:smartparkingconfig

PGAdmin is recommended to access database for development purpose. It can be deployed via docker-compose file.

Starting without keycloak

If you want to start your application without keycloak, you need to change spring boot profile to dev in application\src\main\resources\application.properties.

spring.profiles.active=dev

or define env-variable

SPRING_PROFILES_ACTIVE=dev

Start the database without keycloak:

cd deployment
docker-compose -f postgreslocal-docker-compose.yml up

Changelog

During development, you can add commits to change log by using this syntax: https://www.conventionalcommits.org/en/v1.0.0/#examples

License

Code in this repository is property of Starwit Technologies GmbH and is published under AGPL. So if you want to adapt it, any change needs to be published under AGPL as well. Please let us know, which changes you made. Same goes for errors and bugs. License can be found at here.

About

An app in order to configure parking places for computer vision

Resources

License

Stars

Watchers

Forks

Packages

No packages published