- TypeScript 95.8%
- Shell 1.6%
- JavaScript 1.4%
- PLpgSQL 0.8%
- HTML 0.3%
| app | ||
| components | ||
| cypress | ||
| docker | ||
| docs | ||
| Dokumente | ||
| lib | ||
| prisma | ||
| public | ||
| .dockerignore | ||
| .env.example | ||
| .eslintrc.json | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .prettierignore | ||
| .prettierrc | ||
| abnahme.psql | ||
| cypress.config.ts | ||
| docker-compose.yml | ||
| DOCUMENTATION.pdf | ||
| jest.config.mjs | ||
| middleware.ts | ||
| mkdocs.yml | ||
| next.config.js | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| requirements.txt | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
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 fetchalias(optional, multiple): Aliases to fetchinclude(optional): Set tosystemto 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 deploymentsystemId(optional): The systemId of the deploymentinclude(optional, multiple): One ofsystem,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 deploymentsystemId(optional): The systemId of the deploymentinclude(optional, multiple): One ofsystem,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 fetchname(optional, multiple): Names to fetchinclude(optional): Set tosystemto 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 fetchname(optional, multiple): Aliases to fetchinclude(optional): Set tosystemto 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 fetchalias(optional, multiple): Aliases to fetchinclude(optional): Set tomouduleDeploymentto 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 fetchalias(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 fetchversionNumber(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
}
]