Skip to content

zskarte/zskarte

Repository files navigation

πŸ—ΊοΈ Zivilschutz-Karte

GitHub license GitHub release GitHub last commit GitHub contributors GitHub pull requests GitHub forks GitHub stars GitHub watchers GitHub followers GitHub repo size GitHub code size GitHub language count GitHub top language GitHub issues PRs Welcome ZSKarte.ch

ℹ️ About

Zivilschutz-Karte is a powerful JavaScript application (based on Angular) designed for creating detailed situation maps for disaster management. Developed specifically for Swiss civil defense organisations, it works seamlessly on both standard computers and interactive whiteboards. πŸ–₯️ πŸ“±

πŸ” Key Features

  • 🎨 Intuitive drawing interface
  • 🌍 Multiple map provider integration
  • πŸ’Ύ Local storage support
  • πŸ”„ Real-time collaboration
  • πŸ“± Responsive design
  • πŸ”’ Secure authentication

πŸ‘€ Demo

You can run Zivilschutz-Karte without installation from https://zskarte.ch. This is the production application. Please request access from your civil defence organisation or use the guest mode to try out.

Screenshot of ZS-Karte

πŸš€ Getting Started

πŸ› οΈ Prerequisites

  • πŸ“¦ Node.js 22.x
  • πŸ”§ npm 10.x
  • 🐳 docker 27.x or higher

πŸ“‹ Installation Steps

1. Install packages

npm install

2. For Server copy .env.example file and rename it to .env (you can keep the values as they are for local development)

cp packages/server/.env.example packages/server/.env

3. Start the application (database, backend, frontend)

npm run start

4. Access the Strapi admin panel (Backend)

  1. http://localhost:1337/admin
  2. Login with credentials: User -> [email protected], Password -> Supersecret123

5. Access the Zivilschutz-Karte application (Frontend)

Zivilschutz-Karte is optimized and tested for use with Google Chrome - nevertheless other browsers might work as well and are supported in a best effort manner.

  1. http://localhost:4300
  2. Login with credentials: User -> zso_development, Password -> Supersecret123

πŸ’‘ Help & Feedback

Need assistance or want to share your thoughts? We'd love to hear from you!

  • πŸ› Create an issue on GitHub
  • πŸ“§ Send feedback to [email protected]
  • πŸ’¬ Join our community discussions

βš–οΈ Terms of Use

Please note, that this application integrates several different map provider services. Since the terms of use of the different services usually restrict the extent of use (limited quotas, restricted access to data layers), it's the liability of the user to make sure that the corresponding limitations and/or preconditions are fulfilled.

πŸ› οΈ Development Tools

🐳 Docker-Compose

This will startup a local postgresDB with a RDMS system (pgadmin).

Start

docker compose up -d

πŸ’‘ If you have trouble with the creation of the containers use: docker compose up -d --force-recreate or check Linux/WSL prerequisites.

Stop

docker compose down

PGAdmin

A postgresql database management tool pgadmin

  • PostgreSQL:
    • User: postgres
    • Password: supersecret123

Linux/WSL prerequisites

# Create the data/postgresql folder
mkdir -p data/postgresql
# Add the UID 1001 (non-root user of postgresql) as the folder owner
sudo chown -R 1001:1001 data/postgresql
# Create the data/pgadmin folder
mkdir -p data/pgadmin
# Add the UID 5050 (non-root user of pgadmin) as the folder owner
sudo chown -R 5050:5050 data/pgadmin

Informations for developer

More informations for developers for internal logic / tasks can be found in DEVELOPER_GUIDE.md.

☁️ Azure Setup

πŸ”— Kubernetes Connect

Connect to the AKS cluster with the following commands

# Install azure cli on MAC
brew update && brew install azure-cli

az login
az aks get-credentials --subscription zskarte --resource-group zskare --name zskare-aks --admin
# Switch your kubeconfig context (install kubectx first)
kubectx zskarte-aks-admin
# Switch to Test namespace (kubens doesn't work)
kubectl config set-context --current --namespace zskarte-test
# Switch to Prod namespace (kubens doesn't work)
kubectl config set-context --current --namespace zskarte-prod

Connect to pgadmin on AKS

kubectl port-forward service/pgadmin 8050:80 -n pgadmin

Cheap AKS Cluster

https://georgepaw.medium.com/how-to-run-the-cheapest-kubernetes-cluster-at-1-per-day-tutorial-9673f062b903

# Fill env variables
export SUBSCRIPTION=66961ec5-0870-43fb-a5cc-35e73d6d49d2
export LOCATION=switzerlandnorth
export RESOURCE_GROUP=zskarte
export AKS_CLUSTER=zskarte-aks
export VM_SIZE=Standard_B2s

# Create SSH key pair to login to instance in the future filename: zskarte
ssh-keygen -t rsa -b 4096 -C "zskarte"

# Create resource group
az group create --name $RESOURCE_GROUP \
		--subscription $SUBSCRIPTION \
		--location $LOCATION

# Create a basic single-node AKS cluster
az aks create \
	--subscription $SUBSCRIPTION \
	--resource-group $RESOURCE_GROUP \
	--name $AKS_CLUSTER \
	--vm-set-type VirtualMachineScaleSets \
	--node-count 1 \
	--ssh-key-value zskarte.pub \
	--load-balancer-sku basic \
	--enable-cluster-autoscaler \
	--min-count 1 \
	--max-count 1 \
    --node-vm-size $VM_SIZE \
    --nodepool-name default \
    --node-osdisk-size 32 \
    --node-osdisk-type managed

# Get credentials of AKS cluster
az aks get-credentials \
	--subscription $SUBSCRIPTION \
	--resource-group $RESOURCE_GROUP \
	--name $AKS_CLUSTER \
    --admin

Disable AKS SLA

AKSResourceID=$(az aks show --subscription $SUBSCRIPTION --name $AKS_CLUSTER --resource-group $RESOURCE_GROUP --query id -o tsv)
az resource update --ids $AKSResourceID --subscription $SUBSCRIPTION --set sku.tier="Free"

Helm add Bitnami repo

helm repo add bitnami https://charts.bitnami.com/bitnami

Install NGINX Ingress

helm upgrade --install nginx-ingress-controller bitnami/nginx-ingress-controller --create-namespace -n nginx-ingress-controller -f .azure/aks/nginx/values.yml

Install Cert-Manager

helm upgrade --install cert-manager bitnami/cert-manager --create-namespace -n cert-manager -f .azure/aks/cert-manager/values.yml
kubectl apply -f .azure/aks/cert-manager/letsencrpyt-staging.yml
kubectl apply -f .azure/aks/cert-manager/letsencrpyt-prod.yml

🀝 Contributing

We welcome contributions! Here's how you can help:

  • πŸ› Report bugs
  • πŸ’‘ Suggest new features
  • πŸ”§ Submit pull requests
  • πŸ“š Improve documentation

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

🌟 Star Us!

If you find this project useful, please consider giving it a star on GitHub! ⭐

About

Zivilschutz-Karte allows to draw situation maps for disaster management

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors