No description
  • TypeScript 95.8%
  • Shell 1.6%
  • JavaScript 1.4%
  • PLpgSQL 0.8%
  • HTML 0.3%
Find a file
2024-01-17 13:34:17 +01:00
app fix: revalidate system overview page on notes or release policy update 2024-01-17 13:34:17 +01:00
components feat: memo filtered recommendations so that they are not filtered on every rerender 2024-01-17 01:33:47 +01:00
cypress test: Fixed test 5 & 8 2024-01-10 15:28:13 +01:00
docker docs: centralize existing development documentation in docs folder 2024-01-12 17:25:42 +01:00
docs docs: add quick-start and use without browser 2024-01-17 11:50:37 +00:00
Dokumente Upload New File 2024-01-16 19:19:18 +00:00
lib format using prettier 2024-01-16 23:23:20 +01:00
prisma Feat/history 2023-12-14 15:53:03 +00:00
public feat(init): create-next-app 2023-11-09 14:04:29 +01:00
.dockerignore docker: add ignorefile 2023-12-21 23:10:14 +01:00
.env.example docs: simplify docs for installation test 2024-01-16 23:11:06 +01:00
.eslintrc.json feat(init): setup eslint for typescript 2023-11-09 20:56:19 +01:00
.gitignore docs: simplify docs for installation test 2024-01-16 23:11:06 +01:00
.gitlab-ci.yml ci: hook after successful deployment 2023-12-21 19:22:16 +01:00
.prettierignore ci: add build and lint pipeline 2023-11-09 21:45:44 +01:00
.prettierrc feat(init): add prettier 2023-11-09 20:51:22 +01:00
abnahme.psql test: Added database dump for final test 2024-01-10 15:14:00 +01:00
cypress.config.ts fix: formatting 2023-12-13 13:15:42 +00:00
docker-compose.yml docs: centralize existing development documentation in docs folder 2024-01-12 17:25:42 +01:00
DOCUMENTATION.pdf chore: build docs 2024-01-17 12:52:29 +01:00
jest.config.mjs feat(init): configure jest 2023-11-14 20:35:09 +01:00
middleware.ts docs: comment middleware and auth 2024-01-17 11:33:20 +00:00
mkdocs.yml fix: formatting 2024-01-16 23:11:39 +01:00
next.config.js format: fix 2023-12-06 15:44:47 +01:00
package-lock.json update light and dark theme of searchbar 2024-01-05 15:19:56 +01:00
package.json Merge branch 'main' into 'feat/accent-coloring' 2024-01-10 14:16:52 +00:00
postcss.config.js feat(init): add prettier 2023-11-09 20:51:22 +01:00
README.md docs: add quick-start and use without browser 2024-01-17 11:50:37 +00:00
requirements.txt docs: simplify docs for installation test 2024-01-16 23:11:06 +01:00
tailwind.config.ts format using prettier 2024-01-03 18:33:14 +01:00
tsconfig.json feat: add customer, deploy, release, system(type) api 2024-01-15 13:36:12 +00:00

Deployment Visualizer

Installation

Die Installationsanleitung befindet sich in DOCUMENTATION.pdf.

Quick Setup

Make sure you installed Docker and docker-compose:

docker build -f docker/Dockerfile.prod -t visualizer:latest .
cd docker
docker compose up -d

Now the app is running in production mode on localhost:3000. If you don't have a graphical interface, use curl:

curl -v http://localhost:3000/

This should return a 308 to either /customers or /login if authentication is set-up in the docker/docker-compose.yml.

Development Setup

The Database should be running in the background. Use the top-level docker-compose.yml or, if you're using VSCode, use the default Node+Postgres Template (adjust POSTGRES_{DB,PASSWORD,USER} to visualizer).

cp .env.example .env # optionally adjust DATABASE_URL
npm i --locked
npx prisma db push
npx prisma migrate dev

Environment variables

# PG Url for prisma
DATABASE_URL="postgresql://visualizer:visualizer@localhost:5432/visualizer?schema=public"


# Secret for signing JWTs for users (required if password is set)
JWT_SECRET=my-silly-secret
# Password for the frontend
WEB_INTERFACE_PASSWORD=foobar

# Literal string to compare the authorization header against (empty => no checks)
# Authorization: Bearer $API_TOKEN
API_TOKEN=foobar

# Whether to automatically apply new migrations on app startup
# When set to on now further interference is needed by sysadmin
# However keep in mind that the db is directly modified, so beware
# of potential issues with that!
# Default is off.
MIGRATE_AUTO=on/off

To run the app, use npm run dev.

Migration Management

To check the current migration status use.

(docker compose exec <container_name>) npx prisma migrate status

Before starting the application this command is executed to give you an overview! Check your logs.

If you want to apply all new migrations use this command

(docker compose exec <container_name>) npx prisma migrate deploy

API

GET /api/customer

Parameters

  • id (optional, multiple): Ids to fetch
  • alias (optional, multiple): Aliases to fetch
  • include (optional): Set to system to include all systems for a customer

If no parameters are specified, fetches all customers. If at least one id or alias is specified, the union of systems specified by both are fetched.

Example

GET /api/customer?alias=SWP&alias=Helga

[
  {
    "id": "673e0cb5-1eb1-4c4d-8d91-4843355591a0",
    "alias": "SWP",
    "notes": null
  },
  {
    "id": "201c53d7-1451-4742-9ff5-9c02078d7d80",
    "alias": "Helga",
    "notes": null
  }
]

GET /api/moduledeployment

Parameters

  • moduleId (optional): The moduleId of the deployment
  • systemId (optional): The systemId of the deployment
  • include (optional, multiple): One of system, module, version. If specified, the respective entity is expanded.

If no parameters are specified, fetches all deployments. If one parameter of moduleId and systemId is specified, fetches all deployments of the respective id. If both moduleId and systemId are specified, the deployment with this id (returns as a single object).

Example

GET /api/moduledeployment?systemId=fa7f8a62-1c0b-4734-b1d8-a2c1443dd33a"

[
  {
    "link": "http://localhost:3000/",
    "runId": 9,
    "timestamp": "2023-12-13T15:25:40.168Z",
    "systemId": "fa7f8a62-1c0b-4734-b1d8-a2c1443dd33a",
    "moduleId": "bddfd601-858b-4981-b737-ac9e3805136f",
    "versionId": "a2710498-d7c6-4765-a4cd-6876a8137033"
  },
  {
    "link": "http://localhost:3000/",
    "runId": 1,
    "timestamp": "2023-12-13T15:25:40.450Z",
    "systemId": "fa7f8a62-1c0b-4734-b1d8-a2c1443dd33a",
    "moduleId": "20627ca4-a16a-4f2e-9919-fbf3706b4740",
    "versionId": "be8beaab-970d-4341-b04e-016cbfa7878b"
  }
]

GET /api/moduledeploymenthistory

Parameters

  • moduleId (optional): The moduleId of the deployment
  • systemId (optional): The systemId of the deployment
  • include (optional, multiple): One of system, module, version. If specified, the respective entitys is expanded.

If no parameters are specified, fetches all deployments. If one parameter of moduleId and systemId is specified, fetches all deployments of the respective id.

Example

GET /api/moduledeploymenthistory?moduleId=d5f122c1-0659-433e-b726-d5c8bd4764b7&include=system"

[
  {
    "link": "http://localhost:3000/",
    "runId": 1,
    "timestamp": "2024-01-14T23:19:54.093Z",
    "system": {
      "id": "5e7bfbab-01aa-4895-99d8-873c5b0be4a5",
      "link": null,
      "alias": "helga-1",
      "customerId": "7e1a3136-1d8c-4691-a304-6098644f90a9",
      "systypeId": "4662a099-eb38-45dc-a002-7d1e9a62ee14",
      "releasepolicyId": null
    },
    "moduleId": "d5f122c1-0659-433e-b726-d5c8bd4764b7",
    "versionId": "f26c6d44-4b0a-40c8-8093-31804bdb25e0"
  }
]

GET /api/releasepolicy

Parameters

  • id (optional, multiple): Ids to fetch
  • name (optional, multiple): Names to fetch
  • include (optional): Set to system to include all systems with the respective release policy

If no parameters are specified, fetches all release policies. If at least one id or name is specified, the union of release policies specified by both are fetched.

Example

GET /api/releasepolicy

[
  {
    "id": "c42ea823-c5ae-4621-983b-325c9ad2ad61",
    "name": "OnlyPatches"
  },
  {
    "id": "ff1ff2bf-af24-4b10-a842-8550b10e089d",
    "name": "AfterApproval"
  }
]

GET /api/systemtype

Parameters

  • id (optional, multiple): Ids to fetch
  • name (optional, multiple): Aliases to fetch
  • include (optional): Set to system to include all systems of the respective type

If no parameters are specified, fetches all types. If at least one id or name is specified, the union of types specified by both are fetched.

Example

GET /api/systemtype?name=PROD

[
  {
    "id": "f0fc7ced-1b2f-493e-aa37-4e834095dc4b",
    "name": "PROD"
  }
]

GET /api/system

Parameters

  • id (optional, multiple): Ids to fetch
  • alias (optional, multiple): Aliases to fetch
  • include (optional): Set to mouduleDeployment to include all deployments on the respective system

If no parameters are specified, fetches all systems. If at least one id or alias is specified, the union of systems specified by both are fetched.

Example

GET /api/system?alias=helga-1

[
  {
    "id": "fa7f8a62-1c0b-4734-b1d8-a2c1443dd33a",
    "link": null,
    "alias": "helga-1",
    "customer": {
      "id": "201c53d7-1451-4742-9ff5-9c02078d7d80",
      "alias": "Helga"
    },
    "systype": {
      "id": "f0fc7ced-1b2f-493e-aa37-4e834095dc4b",
      "name": "PROD"
    },
    "releasepolicy": null
  }
]

GET /api/module

Parameters

  • moduleId (optional): Id to fetch
  • alias (optional): Alias to fetch

If no parameters are specified, fetches all types. If at least one moduleId or alias is specified, the union of types specified by both are fetched.

Example

GET /api/module?alias=syschecker

[
  {
    "id": "4175e810-9831-11ee-b9d1-0242ac120002",
    "alias": "syschecker"
  }
]

GET /api/version

Parameters

  • versionId (optional): Id to fetch
  • versionNumber (optional): versionNumber to fetch

If no parameters are specified, fetches all types. If at least one versionId or versionNumber is specified, the union of types specified by both are fetched.

Example

GET /api/version?versionId=f26c6d44-4b0a-40c8-8093-31804bdb25e0

[
  {
    "id": "f26c6d44-4b0a-40c8-8093-31804bdb25e0",
    "versionNumber": "v2.12.9+99",
    "major": 2,
    "minor": 12,
    "patch": 9
  }
]