├── .dev └── .gitstore ├── .gitignore ├── frontend ├── .npmrc ├── .dockerignore ├── src │ ├── routes │ │ ├── +layout.js │ │ ├── +page.server.js │ │ └── +page.svelte │ ├── lib │ │ ├── stores.js │ │ ├── utils.js │ │ ├── header │ │ │ └── ButtonGitHub.svelte │ │ ├── Dummy.svelte │ │ ├── Footer.svelte │ │ ├── ComponentsList.svelte │ │ ├── api.js │ │ ├── Overview.svelte │ │ ├── Header.svelte │ │ ├── Tick.svelte │ │ └── Component.svelte │ └── app.html ├── static │ ├── favicon.png │ └── style.css ├── vite.config.js ├── .gitignore ├── .eslintignore ├── .prettierignore ├── .prettierrc ├── .eslintrc.cjs ├── Dockerfile ├── svelte.config.js ├── package.json ├── README.md └── package-lock.json ├── docs ├── images │ └── screenshot.png ├── architecture.md └── import-data.md ├── backend ├── requirements.txt ├── Dockerfile ├── README.md ├── lib │ ├── view.py │ └── db_interface.py └── main.py ├── charts └── pagetron │ ├── Chart.yaml │ ├── templates │ ├── prometheus.pvc.yaml │ ├── backend.service.yaml │ ├── blackbox.service.yaml │ ├── prometheus.service.yaml │ ├── frontend.service.yaml │ ├── tests │ │ └── test-connection.yaml │ ├── publisher.configmap.yaml │ ├── housekeeper.cronjob.yaml │ ├── housekeeper.configmap.yaml │ ├── blackbox.deployment.yaml │ ├── frontend.deployment.yaml │ ├── backend.deployment.yaml │ ├── common.ingress.yaml │ ├── prometheus.configmap.yaml │ ├── publisher.cronjob.yaml │ └── prometheus.deployment.yaml │ ├── .helmignore │ ├── values.dev.yaml │ └── values.yaml ├── .github └── workflows │ ├── release-chart.yaml │ ├── deploy-gh-pages.yaml │ ├── build-backend.yaml │ └── build-frontend.yaml ├── skaffold.yaml └── README.md /.dev/.gitstore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.secret.yaml 2 | -------------------------------------------------------------------------------- /frontend/.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /frontend/.dockerignore: -------------------------------------------------------------------------------- 1 | .svelte-kit/ 2 | build/ 3 | node_modules/ 4 | -------------------------------------------------------------------------------- /frontend/src/routes/+layout.js: -------------------------------------------------------------------------------- 1 | export const prerender = true; 2 | -------------------------------------------------------------------------------- /docs/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agrrh/pagetron/HEAD/docs/images/screenshot.png -------------------------------------------------------------------------------- /frontend/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agrrh/pagetron/HEAD/frontend/static/favicon.png -------------------------------------------------------------------------------- /frontend/src/lib/stores.js: -------------------------------------------------------------------------------- 1 | import { writable } from 'svelte/store'; 2 | 3 | export const viewStore = writable('quarter'); 4 | -------------------------------------------------------------------------------- /backend/requirements.txt: -------------------------------------------------------------------------------- 1 | fastapi==0.104.1 2 | uvicorn==0.23.2 3 | prometheus-api-client==0.5.4 4 | pydantic==2.5.2 5 | ttl-cache==1.6 6 | -------------------------------------------------------------------------------- /frontend/src/lib/utils.js: -------------------------------------------------------------------------------- 1 | export let isBuildingSnapshot = false; 2 | 3 | isBuildingSnapshot = import.meta.env.VITE_BUILD_SNAPSHOT == true; 4 | -------------------------------------------------------------------------------- /frontend/vite.config.js: -------------------------------------------------------------------------------- 1 | import { sveltekit } from '@sveltejs/kit/vite'; 2 | import { defineConfig } from 'vite'; 3 | 4 | export default defineConfig({ 5 | plugins: [sveltekit()] 6 | }); 7 | -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | vite.config.js.timestamp-* 10 | vite.config.ts.timestamp-* 11 | -------------------------------------------------------------------------------- /charts/pagetron/Chart.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | apiVersion: v2 4 | name: pagetron 5 | description: A Helm chart for Kubernetes 6 | 7 | type: application 8 | 9 | version: 0.1.0 10 | 11 | appVersion: "0.2.2" 12 | 13 | # foo 14 | -------------------------------------------------------------------------------- /frontend/.eslintignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /frontend/.prettierignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /frontend/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true, 3 | "singleQuote": true, 4 | "trailingComma": "none", 5 | "printWidth": 100, 6 | "plugins": ["prettier-plugin-svelte"], 7 | "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] 8 | } 9 | -------------------------------------------------------------------------------- /frontend/static/style.css: -------------------------------------------------------------------------------- 1 | h1, 2 | h2, 3 | h3, 4 | h4, 5 | h5, 6 | .title { 7 | font-family: 'Rubik', serif; 8 | font-weight: normal; 9 | } 10 | 11 | body, 12 | div, 13 | p { 14 | font-family: 'Nunito', serif; 15 | font-weight: light; 16 | } 17 | -------------------------------------------------------------------------------- /backend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12 2 | 3 | WORKDIR /app 4 | 5 | COPY ./requirements.txt ./ 6 | RUN pip install --no-cache-dir -r requirements.txt 7 | 8 | ENV HADOLINT_RELAX yes 9 | 10 | COPY ./ ./ 11 | 12 | CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"] 13 | -------------------------------------------------------------------------------- /frontend/src/lib/header/ButtonGitHub.svelte: -------------------------------------------------------------------------------- 1 |
11 | -------------------------------------------------------------------------------- /backend/README.md: -------------------------------------------------------------------------------- 1 | # Info 2 | 3 | ``` 4 | docker build . -t local/tmp 5 | docker run --rm -ti --network host local/tmp 6 | ``` 7 | 8 | ``` 9 | http://0.0.0.0:3000/overview/ 10 | ``` 11 | 12 | ``` 13 | http://0.0.0.0:3000/components/ 14 | ``` 15 | 16 | ``` 17 | http://0.0.0.0:3000/components/?name=https://example.com&view=day 18 | ``` 19 | -------------------------------------------------------------------------------- /charts/pagetron/templates/prometheus.pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- with $.Values.prometheus }} 2 | 3 | --- 4 | 5 | kind: PersistentVolumeClaim 6 | apiVersion: v1 7 | 8 | metadata: 9 | name: pagetron-prometheus-data 10 | 11 | spec: 12 | accessModes: 13 | - ReadWriteOnce 14 | resources: 15 | requests: 16 | storage: 10Gi 17 | 18 | {{- end }} 19 | -------------------------------------------------------------------------------- /frontend/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /** @type { import("eslint").Linter.FlatConfig } */ 2 | module.exports = { 3 | root: true, 4 | extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier'], 5 | parserOptions: { 6 | sourceType: 'module', 7 | ecmaVersion: 2020, 8 | extraFileExtensions: ['.svelte'] 9 | }, 10 | env: { 11 | browser: true, 12 | es2017: true, 13 | node: true 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:21 AS builder 2 | 3 | WORKDIR /app 4 | 5 | COPY ./package.json ./ 6 | COPY ./package-lock.json ./ 7 | 8 | RUN npm install --include=dev 9 | 10 | COPY ./ ./ 11 | 12 | FROM node:21 AS build 13 | 14 | WORKDIR /app 15 | 16 | COPY --from=builder /app/ ./ 17 | 18 | RUN npm run build 19 | 20 | # --- 21 | 22 | FROM nginx:1.23-alpine 23 | 24 | COPY --from=build /app/build /usr/share/nginx/html 25 | -------------------------------------------------------------------------------- /charts/pagetron/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /charts/pagetron/templates/backend.service.yaml: -------------------------------------------------------------------------------- 1 | {{- with $.Values.backend }} 2 | 3 | --- 4 | 5 | apiVersion: v1 6 | kind: Service 7 | 8 | metadata: 9 | name: pagetron-backend 10 | labels: 11 | app: pagetron 12 | component: backend 13 | 14 | spec: 15 | type: ClusterIP 16 | ports: 17 | - name: http 18 | port: 80 19 | targetPort: http 20 | protocol: TCP 21 | 22 | selector: 23 | app: pagetron 24 | component: backend 25 | 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /charts/pagetron/templates/blackbox.service.yaml: -------------------------------------------------------------------------------- 1 | {{- with $.Values.blackbox }} 2 | 3 | --- 4 | 5 | apiVersion: v1 6 | kind: Service 7 | 8 | metadata: 9 | name: blackbox 10 | labels: 11 | app: pagetron 12 | component: blackbox 13 | 14 | spec: 15 | type: ClusterIP 16 | ports: 17 | - name: http 18 | port: 9115 19 | targetPort: http 20 | protocol: TCP 21 | 22 | selector: 23 | app: pagetron 24 | component: blackbox 25 | 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /charts/pagetron/templates/prometheus.service.yaml: -------------------------------------------------------------------------------- 1 | {{- with $.Values.prometheus }} 2 | 3 | --- 4 | 5 | apiVersion: v1 6 | kind: Service 7 | 8 | metadata: 9 | name: prometheus 10 | labels: 11 | app: pagetron 12 | component: prometheus 13 | 14 | spec: 15 | type: ClusterIP 16 | 17 | selector: 18 | app: pagetron 19 | component: prometheus 20 | 21 | ports: 22 | - name: http 23 | port: 9090 24 | targetPort: http 25 | protocol: TCP 26 | 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /frontend/src/routes/+page.server.js: -------------------------------------------------------------------------------- 1 | import { apiUrl, getAllData } from '$lib/api.js'; 2 | import { isBuildingSnapshot } from '$lib/utils.js'; 3 | import { error } from '@sveltejs/kit'; 4 | 5 | /** @type {import('./$types').PageLoad} */ 6 | export async function load({ fetch, params }) { 7 | let overview = {}; 8 | let components = []; 9 | let componentsData = {}; 10 | 11 | if (isBuildingSnapshot) { 12 | return getAllData(); 13 | } 14 | 15 | return { overview, components, componentsData }; 16 | } 17 | -------------------------------------------------------------------------------- /charts/pagetron/templates/frontend.service.yaml: -------------------------------------------------------------------------------- 1 | {{- if $.Values.publicAccess.ingress.enabled }} 2 | {{- with $.Values.frontend }} 3 | 4 | --- 5 | 6 | apiVersion: v1 7 | kind: Service 8 | 9 | metadata: 10 | name: pagetron-frontend 11 | labels: 12 | app: pagetron 13 | component: frontend 14 | 15 | spec: 16 | type: ClusterIP 17 | ports: 18 | - name: http 19 | port: 80 20 | targetPort: http 21 | protocol: TCP 22 | 23 | selector: 24 | app: pagetron 25 | component: frontend 26 | 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /charts/pagetron/templates/tests/test-connection.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | apiVersion: v1 4 | kind: Pod 5 | 6 | metadata: 7 | name: pagetron-test-connection 8 | labels: 9 | app: pagetron 10 | annotations: 11 | "helm.sh/hook": test 12 | 13 | spec: 14 | restartPolicy: Never 15 | containers: 16 | - name: frontend 17 | image: busybox 18 | command: ['wget'] 19 | args: ['http://pagetron-frontend:80'] 20 | 21 | - name: backend 22 | image: busybox 23 | command: ['wget'] 24 | args: ['http://pagetron-backend:80'] 25 | -------------------------------------------------------------------------------- /frontend/src/lib/Dummy.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |9 | 10 |
11 | {:else} 12 | 20 | {/if} 21 |8 | Powered by 9 | Pagetron 10 |
11 | 12 |version {version}
13 | 14 |15 | Made with 16 | 17 | and 18 | 19 |
20 |{statusText}
28 |Last updated on {datetime_human} UTC
29 |113 | {name} 114 |
115 |118 | {uptimeHuman}% 119 |
120 |