mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
Compare commits
13 Commits
8edaaee117
...
3a6ee3dace
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a6ee3dace | |||
| d58d553945 | |||
| 291305c2e5 | |||
| 9cbe121b11 | |||
| 145565b542 | |||
| 9a436d3c70 | |||
| 49efd88f29 | |||
| 3e809782a6 | |||
| 7cd96c830d | |||
| 233a331cba | |||
| a0bc94d7ec | |||
| e31ec199c0 | |||
| 6d8b760a7d |
40
.github/workflows/workflow.yml
vendored
40
.github/workflows/workflow.yml
vendored
@@ -4,12 +4,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
paths:
|
paths:
|
||||||
- 'backend/**'
|
- '7project/backend/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-update:
|
build-and-update:
|
||||||
runs-on: kbctl
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
packages: write
|
packages: write
|
||||||
@@ -28,27 +28,27 @@ jobs:
|
|||||||
id: build
|
id: build
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./backend
|
context: ./7project/backend
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ secrets.DOCKER_USER }}/cc-app-demo:latest
|
tags: ${{ secrets.DOCKER_USER }}/cc-app-demo:latest
|
||||||
|
|
||||||
- name: Get image digest
|
- name: Get image digest
|
||||||
run: echo "IMAGE_DIGEST=${{ steps.build.outputs.digest }}" >> $GITHUB_ENV
|
run: echo "IMAGE_DIGEST=${{ steps.build.outputs.digest }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Update manifests with new image digest
|
#- name: Update manifests with new image digest
|
||||||
uses: OpsVerseIO/image-updater-action@0.1.0
|
# uses: OpsVerseIO/image-updater-action@0.1.0
|
||||||
with:
|
# with:
|
||||||
branch: main
|
# branch: main
|
||||||
targetBranch: main
|
# targetBranch: main
|
||||||
createPR: 'false'
|
# createPR: 'false'
|
||||||
message: "${{ github.event.head_commit.message }}"
|
# message: "${{ github.event.head_commit.message }}"
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
changes: |
|
# changes: |
|
||||||
{
|
# {
|
||||||
"deployment/app-demo-deployment.yaml": {
|
# "deployment/app-demo-deployment.yaml": {
|
||||||
"spec.template.spec.containers[0].image": "${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}"
|
# "spec.template.spec.containers[0].image": "${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}"
|
||||||
},
|
# },
|
||||||
"deployment/app-demo-worker-deployment.yaml": {
|
# "deployment/app-demo-worker-deployment.yaml": {
|
||||||
"spec.template.spec.containers[0].image": "${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}"
|
# "spec.template.spec.containers[0].image": "${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}"
|
||||||
}
|
# }
|
||||||
}
|
# }
|
||||||
|
|||||||
0
.gitignore → 7project/.gitignore
vendored
0
.gitignore → 7project/.gitignore
vendored
50
7project/backend/app/celery_app.py
Normal file
50
7project/backend/app/celery_app.py
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import os
|
||||||
|
from celery import Celery
|
||||||
|
|
||||||
|
if os.getenv("RABBITMQ_URL"):
|
||||||
|
RABBITMQ_URL = os.getenv("RABBITMQ_URL") # type: ignore
|
||||||
|
else:
|
||||||
|
from urllib.parse import quote
|
||||||
|
|
||||||
|
username = os.getenv("RABBITMQ_USERNAME", "user")
|
||||||
|
password = os.getenv("RABBITMQ_PASSWORD", "bitnami123")
|
||||||
|
host = os.getenv("RABBITMQ_HOST", "localhost")
|
||||||
|
port = os.getenv("RABBITMQ_PORT", "5672")
|
||||||
|
vhost = os.getenv("RABBITMQ_VHOST", "/")
|
||||||
|
use_ssl = os.getenv("RABBITMQ_USE_SSL", "0").lower() in {"1", "true", "yes"}
|
||||||
|
scheme = "amqps" if use_ssl else "amqp"
|
||||||
|
|
||||||
|
# Kombu uses '//' to denote the default '/' vhost. For custom vhosts, URL-encode them.
|
||||||
|
if vhost in ("/", ""):
|
||||||
|
vhost_path = "/" # will become '//' after concatenation below
|
||||||
|
else:
|
||||||
|
vhost_path = f"/{quote(vhost, safe='')}"
|
||||||
|
|
||||||
|
# Ensure we end up with e.g. amqp://user:pass@host:5672// (for '/')
|
||||||
|
RABBITMQ_URL = f"{scheme}://{username}:{password}@{host}:{port}{vhost_path}"
|
||||||
|
if vhost in ("/", "") and not RABBITMQ_URL.endswith("//"):
|
||||||
|
RABBITMQ_URL += "/"
|
||||||
|
|
||||||
|
DEFAULT_QUEUE = os.getenv("MAIL_QUEUE", "mail_queue")
|
||||||
|
|
||||||
|
CELERY_BACKEND = os.getenv("CELERY_BACKEND", "rpc://")
|
||||||
|
|
||||||
|
celery_app = Celery(
|
||||||
|
"app",
|
||||||
|
broker=RABBITMQ_URL,
|
||||||
|
# backend=CELERY_BACKEND,
|
||||||
|
)
|
||||||
|
celery_app.autodiscover_tasks(["app.workers"], related_name="celery_tasks") # discover app.workers.celery_tasks
|
||||||
|
|
||||||
|
celery_app.set_default()
|
||||||
|
|
||||||
|
celery_app.conf.update(
|
||||||
|
task_default_queue=DEFAULT_QUEUE,
|
||||||
|
task_acks_late=True,
|
||||||
|
worker_prefetch_multiplier=int(os.getenv("CELERY_PREFETCH", "1")),
|
||||||
|
task_serializer="json",
|
||||||
|
result_serializer="json",
|
||||||
|
accept_content=["json"],
|
||||||
|
)
|
||||||
|
|
||||||
|
__all__ = ["celery_app"]
|
||||||
6
7project/backend/app/core/queue.py
Normal file
6
7project/backend/app/core/queue.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import app.celery_app # noqa: F401
|
||||||
|
from app.workers.celery_tasks import send_email
|
||||||
|
|
||||||
|
|
||||||
|
def enqueue_email(to: str, subject: str, body: str) -> None:
|
||||||
|
send_email.delay(to, subject, body)
|
||||||
@@ -7,8 +7,8 @@ from fastapi_users import BaseUserManager, FastAPIUsers, UUIDIDMixin
|
|||||||
from fastapi_users.authentication import (
|
from fastapi_users.authentication import (
|
||||||
AuthenticationBackend,
|
AuthenticationBackend,
|
||||||
BearerTransport,
|
BearerTransport,
|
||||||
JWTStrategy,
|
|
||||||
)
|
)
|
||||||
|
from fastapi_users.authentication.strategy.jwt import JWTStrategy
|
||||||
from fastapi_users.db import SQLAlchemyUserDatabase
|
from fastapi_users.db import SQLAlchemyUserDatabase
|
||||||
|
|
||||||
from app.models.user import User
|
from app.models.user import User
|
||||||
@@ -47,7 +47,7 @@ class UserManager(UUIDIDMixin, BaseUserManager[User, uuid.UUID]):
|
|||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
enqueue_email(to=user.email, subject=subject, body=body)
|
enqueue_email(to=user.email, subject=subject, body=body)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
print("[Email Fallback] To:", user.email)
|
print("[Email Fallback] To:", user.email)
|
||||||
print("[Email Fallback] Subject:", subject)
|
print("[Email Fallback] Subject:", subject)
|
||||||
print("[Email Fallback] Body:\n", body)
|
print("[Email Fallback] Body:\n", body)
|
||||||
19
7project/backend/app/workers/celery_tasks.py
Normal file
19
7project/backend/app/workers/celery_tasks.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
|
from celery import shared_task
|
||||||
|
|
||||||
|
logger = logging.getLogger("celery_tasks")
|
||||||
|
if not logger.handlers:
|
||||||
|
_h = logging.StreamHandler()
|
||||||
|
logger.addHandler(_h)
|
||||||
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
|
@shared_task(name="workers.send_email")
|
||||||
|
def send_email(to: str, subject: str, body: str) -> None:
|
||||||
|
if not (to and subject and body):
|
||||||
|
logger.error("Email task missing fields. to=%r subject=%r body_len=%r", to, subject, len(body) if body else 0)
|
||||||
|
return
|
||||||
|
|
||||||
|
# Placeholder for real email sending logic
|
||||||
|
logger.info("[Celery] Email sent | to=%s | subject=%s | body_len=%d", to, subject, len(body))
|
||||||
@@ -2,14 +2,20 @@ aio-pika==9.5.6
|
|||||||
aiormq==6.8.1
|
aiormq==6.8.1
|
||||||
aiosqlite==0.21.0
|
aiosqlite==0.21.0
|
||||||
alembic==1.16.5
|
alembic==1.16.5
|
||||||
|
amqp==5.3.1
|
||||||
annotated-types==0.7.0
|
annotated-types==0.7.0
|
||||||
anyio==4.11.0
|
anyio==4.11.0
|
||||||
argon2-cffi==23.1.0
|
argon2-cffi==23.1.0
|
||||||
argon2-cffi-bindings==25.1.0
|
argon2-cffi-bindings==25.1.0
|
||||||
asyncmy==0.2.9
|
asyncmy==0.2.9
|
||||||
bcrypt==4.3.0
|
bcrypt==4.3.0
|
||||||
|
billiard==4.2.2
|
||||||
|
celery==5.5.3
|
||||||
cffi==2.0.0
|
cffi==2.0.0
|
||||||
click==8.1.8
|
click==8.1.8
|
||||||
|
click-didyoumean==0.3.1
|
||||||
|
click-plugins==1.1.1.2
|
||||||
|
click-repl==0.3.0
|
||||||
cryptography==46.0.1
|
cryptography==46.0.1
|
||||||
dnspython==2.7.0
|
dnspython==2.7.0
|
||||||
email_validator==2.2.0
|
email_validator==2.2.0
|
||||||
@@ -21,11 +27,14 @@ greenlet==3.2.4
|
|||||||
h11==0.16.0
|
h11==0.16.0
|
||||||
httptools==0.6.4
|
httptools==0.6.4
|
||||||
idna==3.10
|
idna==3.10
|
||||||
|
kombu==5.5.4
|
||||||
makefun==1.16.0
|
makefun==1.16.0
|
||||||
Mako==1.3.10
|
Mako==1.3.10
|
||||||
MarkupSafe==3.0.2
|
MarkupSafe==3.0.2
|
||||||
multidict==6.6.4
|
multidict==6.6.4
|
||||||
|
packaging==25.0
|
||||||
pamqp==3.3.0
|
pamqp==3.3.0
|
||||||
|
prompt_toolkit==3.0.52
|
||||||
propcache==0.3.2
|
propcache==0.3.2
|
||||||
pwdlib==0.2.1
|
pwdlib==0.2.1
|
||||||
pycparser==2.23
|
pycparser==2.23
|
||||||
@@ -33,17 +42,22 @@ pydantic==2.11.9
|
|||||||
pydantic_core==2.33.2
|
pydantic_core==2.33.2
|
||||||
PyJWT==2.10.1
|
PyJWT==2.10.1
|
||||||
PyMySQL==1.1.2
|
PyMySQL==1.1.2
|
||||||
|
python-dateutil==2.9.0.post0
|
||||||
python-dotenv==1.1.1
|
python-dotenv==1.1.1
|
||||||
python-multipart==0.0.20
|
python-multipart==0.0.20
|
||||||
PyYAML==6.0.2
|
PyYAML==6.0.2
|
||||||
|
six==1.17.0
|
||||||
sniffio==1.3.1
|
sniffio==1.3.1
|
||||||
SQLAlchemy==2.0.43
|
SQLAlchemy==2.0.43
|
||||||
starlette==0.48.0
|
starlette==0.48.0
|
||||||
tomli==2.2.1
|
tomli==2.2.1
|
||||||
typing-inspection==0.4.1
|
typing-inspection==0.4.1
|
||||||
typing_extensions==4.15.0
|
typing_extensions==4.15.0
|
||||||
|
tzdata==2025.2
|
||||||
uvicorn==0.37.0
|
uvicorn==0.37.0
|
||||||
uvloop==0.21.0
|
uvloop==0.21.0
|
||||||
|
vine==5.1.0
|
||||||
watchfiles==1.1.0
|
watchfiles==1.1.0
|
||||||
|
wcwidth==0.2.14
|
||||||
websockets==15.0.1
|
websockets==15.0.1
|
||||||
yarl==1.20.1
|
yarl==1.20.1
|
||||||
@@ -17,8 +17,14 @@ spec:
|
|||||||
- image: lukastrkan/cc-app-demo@sha256:75634b4d97282b6b8424fe17767c81adf44af5f7359c1d25883073b5629b3e05
|
- image: lukastrkan/cc-app-demo@sha256:75634b4d97282b6b8424fe17767c81adf44af5f7359c1d25883073b5629b3e05
|
||||||
name: app-demo-worker
|
name: app-demo-worker
|
||||||
command:
|
command:
|
||||||
- python3
|
- celery
|
||||||
- worker/email_worker.py
|
- -A
|
||||||
|
- app.celery_app
|
||||||
|
- worker
|
||||||
|
- -Q
|
||||||
|
- $(MAIL_QUEUE)
|
||||||
|
- --loglevel
|
||||||
|
- INFO
|
||||||
env:
|
env:
|
||||||
- name: RABBITMQ_USERNAME
|
- name: RABBITMQ_USERNAME
|
||||||
value: demo-app
|
value: demo-app
|
||||||
@@ -53,7 +53,8 @@ module "loadbalancer" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module "cert-manager" {
|
module "cert-manager" {
|
||||||
source = "${path.module}/modules/cert-manager"
|
source = "${path.module}/modules/cert-manager"
|
||||||
|
depends_on = [module.loadbalancer]
|
||||||
}
|
}
|
||||||
|
|
||||||
module "cloudflare" {
|
module "cloudflare" {
|
||||||
@@ -67,10 +68,16 @@ module "cloudflare" {
|
|||||||
cloudflare_account_id = var.cloudflare_account_id
|
cloudflare_account_id = var.cloudflare_account_id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module "monitoring" {
|
||||||
|
source = "${path.module}/modules/prometheus"
|
||||||
|
depends_on = [module.cloudflare]
|
||||||
|
cloudflare_domain = var.cloudflare_domain
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
module "database" {
|
module "database" {
|
||||||
source = "${path.module}/modules/maxscale"
|
source = "${path.module}/modules/maxscale"
|
||||||
depends_on = [module.storage, module.loadbalancer, module.cloudflare]
|
depends_on = [module.monitoring]
|
||||||
|
|
||||||
mariadb_password = var.mariadb_password
|
mariadb_password = var.mariadb_password
|
||||||
mariadb_root_password = var.mariadb_root_password
|
mariadb_root_password = var.mariadb_root_password
|
||||||
@@ -87,23 +94,23 @@ module "database" {
|
|||||||
cloudflare_domain = var.cloudflare_domain
|
cloudflare_domain = var.cloudflare_domain
|
||||||
}
|
}
|
||||||
|
|
||||||
module "argocd" {
|
#module "argocd" {
|
||||||
source = "${path.module}/modules/argocd"
|
# source = "${path.module}/modules/argocd"
|
||||||
depends_on = [module.storage, module.loadbalancer, module.cloudflare]
|
# depends_on = [module.storage, module.loadbalancer, module.cloudflare]
|
||||||
|
|
||||||
argocd_admin_password = var.argocd_admin_password
|
# argocd_admin_password = var.argocd_admin_password
|
||||||
cloudflare_domain = var.cloudflare_domain
|
# cloudflare_domain = var.cloudflare_domain
|
||||||
}
|
#}
|
||||||
|
|
||||||
module "redis" {
|
#module "redis" {
|
||||||
source = "${path.module}/modules/redis"
|
# source = "${path.module}/modules/redis"
|
||||||
depends_on = [module.storage]
|
# depends_on = [module.storage]
|
||||||
cloudflare_base_domain = var.cloudflare_domain
|
# cloudflare_base_domain = var.cloudflare_domain
|
||||||
}
|
#}
|
||||||
|
|
||||||
module "rabbitmq" {
|
module "rabbitmq" {
|
||||||
source = "${path.module}/modules/rabbitmq"
|
source = "${path.module}/modules/rabbitmq"
|
||||||
depends_on = [module.storage]
|
depends_on = [module.database]
|
||||||
base_domain = var.cloudflare_domain
|
base_domain = var.cloudflare_domain
|
||||||
rabbitmq-password = var.rabbitmq-password
|
rabbitmq-password = var.rabbitmq-password
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
apiVersion: networking.cfargotunnel.com/v1alpha2
|
apiVersion: networking.cfargotunnel.com/v1alpha2
|
||||||
kind: ClusterTunnel
|
kind: ClusterTunnel
|
||||||
metadata:
|
metadata:
|
||||||
name: cluster-tunnel # The ClusterTunnel Custom Resource Name
|
name: cluster-tunnel
|
||||||
spec:
|
spec:
|
||||||
newTunnel:
|
newTunnel:
|
||||||
name: ${cloudflare_tunnel_name} # Name of your new tunnel on Cloudflare
|
name: ${cloudflare_tunnel_name}
|
||||||
cloudflare:
|
cloudflare:
|
||||||
email: ${cloudflare_email}
|
email: ${cloudflare_email}
|
||||||
domain: ${cloudflare_domain}
|
domain: ${cloudflare_domain}
|
||||||
@@ -41,10 +41,10 @@ resource "kubectl_manifest" "cloudflare-api-token" {
|
|||||||
resource "kubectl_manifest" "cloudflare-tunnel" {
|
resource "kubectl_manifest" "cloudflare-tunnel" {
|
||||||
yaml_body = templatefile("${path.module}/cluster-tunnel.yaml", {
|
yaml_body = templatefile("${path.module}/cluster-tunnel.yaml", {
|
||||||
cloudflare_tunnel_name = var.cloudflare_tunnel_name
|
cloudflare_tunnel_name = var.cloudflare_tunnel_name
|
||||||
cloudflare_email = var.cloudflare_email
|
cloudflare_email = var.cloudflare_email
|
||||||
cloudflare_domain = var.cloudflare_domain
|
cloudflare_domain = var.cloudflare_domain
|
||||||
cloudflare_account_id = var.cloudflare_account_id
|
cloudflare_account_id = var.cloudflare_account_id
|
||||||
})
|
})
|
||||||
|
|
||||||
depends_on = [kustomization_resource.cloudflare]
|
depends_on = [kustomization_resource.cloudflare]
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
name: maxscale-helm
|
name: maxscale-helm
|
||||||
version: 1.0.2
|
version: 1.0.7
|
||||||
description: Helm chart for MaxScale related Kubernetes manifests
|
description: Helm chart for MaxScale related Kubernetes manifests
|
||||||
@@ -54,6 +54,12 @@ spec:
|
|||||||
|
|
||||||
metrics:
|
metrics:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: true
|
||||||
|
interval: 30s
|
||||||
|
scrapeTimeout: 10s
|
||||||
|
prometheusRelease: kube-prometheus-stack
|
||||||
|
jobLabel: mariadb-monitoring
|
||||||
|
|
||||||
tls:
|
tls:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -106,7 +112,17 @@ spec:
|
|||||||
key: dsn
|
key: dsn
|
||||||
|
|
||||||
affinity:
|
affinity:
|
||||||
antiAffinityEnabled: true
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app.kubernetes.io/name
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- mariadb-repl
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|
||||||
tolerations:
|
tolerations:
|
||||||
- key: "k8s.mariadb.com/ha"
|
- key: "k8s.mariadb.com/ha"
|
||||||
@@ -149,6 +165,12 @@ spec:
|
|||||||
|
|
||||||
metrics:
|
metrics:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: true
|
||||||
|
interval: 30s
|
||||||
|
scrapeTimeout: 10s
|
||||||
|
prometheusRelease: kube-prometheus-stack
|
||||||
|
jobLabel: mariadb-monitoring
|
||||||
|
|
||||||
tls:
|
tls:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -33,7 +33,7 @@ spec:
|
|||||||
value: "3306"
|
value: "3306"
|
||||||
- name: PHPMYADMIN_ALLOW_NO_PASSWORD
|
- name: PHPMYADMIN_ALLOW_NO_PASSWORD
|
||||||
value: "false"
|
value: "false"
|
||||||
image: "docker.io/bitnami/phpmyadmin:5.2.2"
|
image: "bitnamilegacy/phpmyadmin:5.2.2"
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
@@ -58,7 +58,7 @@ resource "helm_release" "mariadb-operator" {
|
|||||||
resource "helm_release" "maxscale_helm" {
|
resource "helm_release" "maxscale_helm" {
|
||||||
name = "maxscale-helm"
|
name = "maxscale-helm"
|
||||||
chart = "${path.module}/charts/maxscale-helm"
|
chart = "${path.module}/charts/maxscale-helm"
|
||||||
version = "1.0.2"
|
version = "1.0.7"
|
||||||
depends_on = [ helm_release.mariadb-operator-crds, kubectl_manifest.secrets ]
|
depends_on = [ helm_release.mariadb-operator-crds, kubectl_manifest.secrets ]
|
||||||
timeout = 3600
|
timeout = 3600
|
||||||
|
|
||||||
14
7project/tofu/modules/prometheus/grafana-ui.yaml
Normal file
14
7project/tofu/modules/prometheus/grafana-ui.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: networking.cfargotunnel.com/v1alpha1
|
||||||
|
kind: TunnelBinding
|
||||||
|
metadata:
|
||||||
|
name: grafana-tunnel-binding
|
||||||
|
namespace: monitoring
|
||||||
|
subjects:
|
||||||
|
- name: grafana
|
||||||
|
spec:
|
||||||
|
target: http://kube-prometheus-stack-grafana.monitoring.svc.cluster.local
|
||||||
|
fqdn: grafana.${base_domain}
|
||||||
|
noTlsVerify: true
|
||||||
|
tunnelRef:
|
||||||
|
kind: ClusterTunnel
|
||||||
|
name: cluster-tunnel
|
||||||
66
7project/tofu/modules/prometheus/main.tf
Normal file
66
7project/tofu/modules/prometheus/main.tf
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
kubectl = {
|
||||||
|
source = "gavinbunney/kubectl"
|
||||||
|
version = "1.19.0"
|
||||||
|
}
|
||||||
|
helm = {
|
||||||
|
source = "hashicorp/helm"
|
||||||
|
version = "3.0.2"
|
||||||
|
}
|
||||||
|
kubernetes = {
|
||||||
|
source = "hashicorp/kubernetes"
|
||||||
|
version = "2.38.0"
|
||||||
|
}
|
||||||
|
kustomization = {
|
||||||
|
source = "kbst/kustomization"
|
||||||
|
version = "0.9.6"
|
||||||
|
}
|
||||||
|
time = {
|
||||||
|
source = "hashicorp/time"
|
||||||
|
version = "0.13.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create namespace for monitoring
|
||||||
|
resource "kubernetes_namespace" "monitoring" {
|
||||||
|
metadata {
|
||||||
|
name = "monitoring"
|
||||||
|
labels = {
|
||||||
|
"pod-security.kubernetes.io/enforce" = "privileged"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Deploy kube-prometheus-stack
|
||||||
|
resource "helm_release" "kube_prometheus_stack" {
|
||||||
|
name = "kube-prometheus-stack"
|
||||||
|
repository = "https://prometheus-community.github.io/helm-charts"
|
||||||
|
chart = "kube-prometheus-stack"
|
||||||
|
namespace = kubernetes_namespace.monitoring.metadata[0].name
|
||||||
|
version = "67.2.1" # Check for latest version
|
||||||
|
|
||||||
|
# Wait for CRDs to be created
|
||||||
|
wait = true
|
||||||
|
timeout = 600
|
||||||
|
force_update = false
|
||||||
|
recreate_pods = false
|
||||||
|
|
||||||
|
# Reference the values file
|
||||||
|
values = [
|
||||||
|
file("${path.module}/values.yaml")
|
||||||
|
]
|
||||||
|
|
||||||
|
depends_on = [
|
||||||
|
kubernetes_namespace.monitoring
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubectl_manifest" "argocd-tunnel-bind" {
|
||||||
|
depends_on = [helm_release.kube_prometheus_stack]
|
||||||
|
|
||||||
|
yaml_body = templatefile("${path.module}/grafana-ui.yaml", {
|
||||||
|
base_domain = var.cloudflare_domain
|
||||||
|
})
|
||||||
|
}
|
||||||
189
7project/tofu/modules/prometheus/values.yaml
Normal file
189
7project/tofu/modules/prometheus/values.yaml
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
# Prometheus configuration
|
||||||
|
prometheus:
|
||||||
|
prometheusSpec:
|
||||||
|
retention: 30d
|
||||||
|
retentionSize: "45GB"
|
||||||
|
|
||||||
|
# Storage configuration
|
||||||
|
storageSpec:
|
||||||
|
volumeClaimTemplate:
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 50Gi
|
||||||
|
# storageClassName: "your-storage-class" # Uncomment and specify if needed
|
||||||
|
|
||||||
|
# Resource limits
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 2Gi
|
||||||
|
limits:
|
||||||
|
cpu: 2000m
|
||||||
|
memory: 4Gi
|
||||||
|
|
||||||
|
# Scrape interval
|
||||||
|
scrapeInterval: 30s
|
||||||
|
evaluationInterval: 30s
|
||||||
|
|
||||||
|
# Service configuration
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 9090
|
||||||
|
|
||||||
|
# Ingress (disabled by default)
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
# ingressClassName: nginx
|
||||||
|
# hosts:
|
||||||
|
# - prometheus.example.com
|
||||||
|
# tls:
|
||||||
|
# - secretName: prometheus-tls
|
||||||
|
# hosts:
|
||||||
|
# - prometheus.example.com
|
||||||
|
|
||||||
|
# Grafana configuration
|
||||||
|
grafana:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# Admin credentials
|
||||||
|
adminPassword: "admin" # CHANGE THIS IN PRODUCTION!
|
||||||
|
|
||||||
|
# Persistence
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
size: 10Gi
|
||||||
|
# storageClassName: "your-storage-class" # Uncomment and specify if needed
|
||||||
|
|
||||||
|
# Resource limits
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 256Mi
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
|
||||||
|
# Service configuration
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 80
|
||||||
|
|
||||||
|
# Ingress (disabled by default)
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
# ingressClassName: nginx
|
||||||
|
# hosts:
|
||||||
|
# - grafana.example.com
|
||||||
|
# tls:
|
||||||
|
# - secretName: grafana-tls
|
||||||
|
# hosts:
|
||||||
|
# - grafana.example.com
|
||||||
|
|
||||||
|
# Default dashboards
|
||||||
|
defaultDashboardsEnabled: true
|
||||||
|
defaultDashboardsTimezone: Europe/Prague
|
||||||
|
|
||||||
|
# Alertmanager configuration
|
||||||
|
alertmanager:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
alertmanagerSpec:
|
||||||
|
# Storage configuration
|
||||||
|
storage:
|
||||||
|
volumeClaimTemplate:
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
# storageClassName: "your-storage-class" # Uncomment and specify if needed
|
||||||
|
|
||||||
|
# Resource limits
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 256Mi
|
||||||
|
|
||||||
|
# Service configuration
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 9093
|
||||||
|
|
||||||
|
# Ingress (disabled by default)
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
# ingressClassName: nginx
|
||||||
|
# hosts:
|
||||||
|
# - alertmanager.example.com
|
||||||
|
# tls:
|
||||||
|
# - secretName: alertmanager-tls
|
||||||
|
# hosts:
|
||||||
|
# - alertmanager.example.com
|
||||||
|
|
||||||
|
# Alertmanager configuration
|
||||||
|
config:
|
||||||
|
global:
|
||||||
|
resolve_timeout: 5m
|
||||||
|
|
||||||
|
route:
|
||||||
|
group_by: [ 'alertname', 'cluster', 'service' ]
|
||||||
|
group_wait: 10s
|
||||||
|
group_interval: 10s
|
||||||
|
repeat_interval: 12h
|
||||||
|
receiver: 'null'
|
||||||
|
routes:
|
||||||
|
- match:
|
||||||
|
alertname: Watchdog
|
||||||
|
receiver: 'null'
|
||||||
|
|
||||||
|
receivers:
|
||||||
|
- name: 'null'
|
||||||
|
# Add your receivers here (email, slack, pagerduty, etc.)
|
||||||
|
# - name: 'slack'
|
||||||
|
# slack_configs:
|
||||||
|
# - api_url: 'YOUR_SLACK_WEBHOOK_URL'
|
||||||
|
# channel: '#alerts'
|
||||||
|
# title: '{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}'
|
||||||
|
# text: '{{ range .Alerts }}{{ .Annotations.description }}\n{{ end }}'
|
||||||
|
|
||||||
|
# Node Exporter
|
||||||
|
nodeExporter:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# Kube State Metrics
|
||||||
|
kubeStateMetrics:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# Prometheus Operator
|
||||||
|
prometheusOperator:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 256Mi
|
||||||
|
|
||||||
|
# Service Monitors
|
||||||
|
# Automatically discover and monitor services with appropriate labels
|
||||||
|
prometheus-node-exporter:
|
||||||
|
prometheus:
|
||||||
|
monitor:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# Additional ServiceMonitors can be defined here
|
||||||
|
# additionalServiceMonitors: []
|
||||||
|
|
||||||
|
# Global settings
|
||||||
|
global:
|
||||||
|
rbac:
|
||||||
|
create: true
|
||||||
5
7project/tofu/modules/prometheus/variables.tf
Normal file
5
7project/tofu/modules/prometheus/variables.tf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
variable "cloudflare_domain" {
|
||||||
|
type = string
|
||||||
|
default = "Base cloudflare domain, e.g. example.com"
|
||||||
|
nullable = false
|
||||||
|
}
|
||||||
@@ -65,7 +65,11 @@ resource "helm_release" "rabbitmq" {
|
|||||||
{
|
{
|
||||||
name = "podAntiAffinityPreset"
|
name = "podAntiAffinityPreset"
|
||||||
value = "soft"
|
value = "soft"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
name = "image.repository"
|
||||||
|
value = "bitnamilegacy/rabbitmq"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import json
|
|
||||||
import os
|
|
||||||
from typing import Any, Dict
|
|
||||||
import asyncio
|
|
||||||
|
|
||||||
RABBITMQ_URL = os.getenv("RABBITMQ_URL") or (
|
|
||||||
f"amqp://{os.getenv('RABBITMQ_USERNAME', 'user')}:"
|
|
||||||
f"{os.getenv('RABBITMQ_PASSWORD', 'bitnami123')}@"
|
|
||||||
f"{os.getenv('RABBITMQ_HOST', 'localhost')}:"
|
|
||||||
f"{os.getenv('RABBITMQ_PORT', '5672')}"
|
|
||||||
)
|
|
||||||
QUEUE_NAME = os.getenv("MAIL_QUEUE", "mail_queue")
|
|
||||||
|
|
||||||
async def _publish_async(message: Dict[str, Any]) -> None:
|
|
||||||
import aio_pika
|
|
||||||
connection = await aio_pika.connect_robust(RABBITMQ_URL)
|
|
||||||
try:
|
|
||||||
channel = await connection.channel()
|
|
||||||
await channel.declare_queue(QUEUE_NAME, durable=True)
|
|
||||||
body = json.dumps(message).encode("utf-8")
|
|
||||||
await channel.default_exchange.publish(
|
|
||||||
aio_pika.Message(body=body, delivery_mode=aio_pika.DeliveryMode.PERSISTENT),
|
|
||||||
routing_key=QUEUE_NAME,
|
|
||||||
)
|
|
||||||
finally:
|
|
||||||
await connection.close()
|
|
||||||
|
|
||||||
def enqueue_email(to: str, subject: str, body: str) -> None:
|
|
||||||
message = {"type": "email", "to": to, "subject": subject, "body": body}
|
|
||||||
try:
|
|
||||||
loop = asyncio.get_running_loop()
|
|
||||||
loop.create_task(_publish_async(message))
|
|
||||||
except RuntimeError:
|
|
||||||
asyncio.run(_publish_async(message))
|
|
||||||
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import asyncio
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
from typing import Any, Dict
|
|
||||||
|
|
||||||
RABBITMQ_URL = os.getenv("RABBITMQ_URL") or (
|
|
||||||
f"amqp://{os.getenv('RABBITMQ_USERNAME', 'user')}:"
|
|
||||||
f"{os.getenv('RABBITMQ_PASSWORD', 'bitnami123')}@"
|
|
||||||
f"{os.getenv('RABBITMQ_HOST', 'localhost')}:"
|
|
||||||
f"{os.getenv('RABBITMQ_PORT', '5672')}"
|
|
||||||
)
|
|
||||||
QUEUE_NAME = os.getenv("MAIL_QUEUE", "mail_queue")
|
|
||||||
|
|
||||||
|
|
||||||
async def handle_message(message_body: bytes) -> None:
|
|
||||||
try:
|
|
||||||
data: Dict[str, Any] = json.loads(message_body.decode("utf-8"))
|
|
||||||
except Exception as e:
|
|
||||||
print(f"[email_worker] Failed to decode message: {e}")
|
|
||||||
return
|
|
||||||
|
|
||||||
if data.get("type") != "email":
|
|
||||||
print(f"[email_worker] Unknown message type: {data}")
|
|
||||||
return
|
|
||||||
|
|
||||||
to = data.get("to")
|
|
||||||
subject = data.get("subject")
|
|
||||||
body = data.get("body")
|
|
||||||
if not (to and subject and body):
|
|
||||||
print(f"[email_worker] Incomplete email message: {data}")
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
|
||||||
await send_email(to=to, subject=subject, body=body)
|
|
||||||
print(f"[email_worker] Sent email to {to}")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"[email_worker] Error sending email to {to}: {e}")
|
|
||||||
|
|
||||||
|
|
||||||
async def main() -> None:
|
|
||||||
import aio_pika
|
|
||||||
|
|
||||||
print(f"[email_worker] Connecting to RabbitMQ at {RABBITMQ_URL}")
|
|
||||||
connection = await aio_pika.connect_robust(RABBITMQ_URL)
|
|
||||||
channel = await connection.channel()
|
|
||||||
queue = await channel.declare_queue(QUEUE_NAME, durable=True)
|
|
||||||
print(f"[email_worker] Waiting for messages in queue '{QUEUE_NAME}' ...")
|
|
||||||
|
|
||||||
async with queue.iterator() as queue_iter:
|
|
||||||
async for message in queue_iter:
|
|
||||||
async with message.process(requeue=False):
|
|
||||||
await handle_message(message.body)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
asyncio.run(main())
|
|
||||||
24
frontend/.gitignore
vendored
24
frontend/.gitignore
vendored
@@ -1,24 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
pnpm-debug.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
|
|
||||||
node_modules
|
|
||||||
dist
|
|
||||||
dist-ssr
|
|
||||||
*.local
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/extensions.json
|
|
||||||
.idea
|
|
||||||
.DS_Store
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
*.sw?
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
# React + TypeScript + Vite
|
|
||||||
|
|
||||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
||||||
|
|
||||||
Currently, two official plugins are available:
|
|
||||||
|
|
||||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
||||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
||||||
|
|
||||||
## React Compiler
|
|
||||||
|
|
||||||
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
||||||
|
|
||||||
## Expanding the ESLint configuration
|
|
||||||
|
|
||||||
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
||||||
|
|
||||||
```js
|
|
||||||
export default defineConfig([
|
|
||||||
globalIgnores(['dist']),
|
|
||||||
{
|
|
||||||
files: ['**/*.{ts,tsx}'],
|
|
||||||
extends: [
|
|
||||||
// Other configs...
|
|
||||||
|
|
||||||
// Remove tseslint.configs.recommended and replace with this
|
|
||||||
tseslint.configs.recommendedTypeChecked,
|
|
||||||
// Alternatively, use this for stricter rules
|
|
||||||
tseslint.configs.strictTypeChecked,
|
|
||||||
// Optionally, add this for stylistic rules
|
|
||||||
tseslint.configs.stylisticTypeChecked,
|
|
||||||
|
|
||||||
// Other configs...
|
|
||||||
],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
||||||
tsconfigRootDir: import.meta.dirname,
|
|
||||||
},
|
|
||||||
// other options...
|
|
||||||
},
|
|
||||||
},
|
|
||||||
])
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
||||||
|
|
||||||
```js
|
|
||||||
// eslint.config.js
|
|
||||||
import reactX from 'eslint-plugin-react-x'
|
|
||||||
import reactDom from 'eslint-plugin-react-dom'
|
|
||||||
|
|
||||||
export default defineConfig([
|
|
||||||
globalIgnores(['dist']),
|
|
||||||
{
|
|
||||||
files: ['**/*.{ts,tsx}'],
|
|
||||||
extends: [
|
|
||||||
// Other configs...
|
|
||||||
// Enable lint rules for React
|
|
||||||
reactX.configs['recommended-typescript'],
|
|
||||||
// Enable lint rules for React DOM
|
|
||||||
reactDom.configs.recommended,
|
|
||||||
],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
||||||
tsconfigRootDir: import.meta.dirname,
|
|
||||||
},
|
|
||||||
// other options...
|
|
||||||
},
|
|
||||||
},
|
|
||||||
])
|
|
||||||
```
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import js from '@eslint/js'
|
|
||||||
import globals from 'globals'
|
|
||||||
import reactHooks from 'eslint-plugin-react-hooks'
|
|
||||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
||||||
import tseslint from 'typescript-eslint'
|
|
||||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
||||||
|
|
||||||
export default defineConfig([
|
|
||||||
globalIgnores(['dist']),
|
|
||||||
{
|
|
||||||
files: ['**/*.{ts,tsx}'],
|
|
||||||
extends: [
|
|
||||||
js.configs.recommended,
|
|
||||||
tseslint.configs.recommended,
|
|
||||||
reactHooks.configs['recommended-latest'],
|
|
||||||
reactRefresh.configs.vite,
|
|
||||||
],
|
|
||||||
languageOptions: {
|
|
||||||
ecmaVersion: 2020,
|
|
||||||
globals: globals.browser,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
])
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>frontend</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="root"></div>
|
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
3405
frontend/package-lock.json
generated
3405
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "frontend",
|
|
||||||
"private": true,
|
|
||||||
"version": "0.0.0",
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "vite",
|
|
||||||
"build": "tsc -b && vite build",
|
|
||||||
"lint": "eslint .",
|
|
||||||
"preview": "vite preview"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"react": "^19.1.1",
|
|
||||||
"react-dom": "^19.1.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@eslint/js": "^9.36.0",
|
|
||||||
"@types/react": "^19.1.13",
|
|
||||||
"@types/react-dom": "^19.1.9",
|
|
||||||
"@vitejs/plugin-react": "^5.0.3",
|
|
||||||
"eslint": "^9.36.0",
|
|
||||||
"eslint-plugin-react-hooks": "^5.2.0",
|
|
||||||
"eslint-plugin-react-refresh": "^0.4.20",
|
|
||||||
"globals": "^16.4.0",
|
|
||||||
"typescript": "~5.8.3",
|
|
||||||
"typescript-eslint": "^8.44.0",
|
|
||||||
"vite": "^7.1.7"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,42 +0,0 @@
|
|||||||
#root {
|
|
||||||
max-width: 1280px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 2rem;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
height: 6em;
|
|
||||||
padding: 1.5em;
|
|
||||||
will-change: filter;
|
|
||||||
transition: filter 300ms;
|
|
||||||
}
|
|
||||||
.logo:hover {
|
|
||||||
filter: drop-shadow(0 0 2em #646cffaa);
|
|
||||||
}
|
|
||||||
.logo.react:hover {
|
|
||||||
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes logo-spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: no-preference) {
|
|
||||||
a:nth-of-type(2) .logo {
|
|
||||||
animation: logo-spin infinite 20s linear;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
padding: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.read-the-docs {
|
|
||||||
color: #888;
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import { useState } from 'react'
|
|
||||||
import reactLogo from './assets/react.svg'
|
|
||||||
import viteLogo from '/vite.svg'
|
|
||||||
import './App.css'
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
const [count, setCount] = useState(0)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div>
|
|
||||||
<a href="https://vite.dev" target="_blank">
|
|
||||||
<img src={viteLogo} className="logo" alt="Vite logo" />
|
|
||||||
</a>
|
|
||||||
<a href="https://react.dev" target="_blank">
|
|
||||||
<img src={reactLogo} className="logo react" alt="React logo" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<h1>Vite + React</h1>
|
|
||||||
<div className="card">
|
|
||||||
<button onClick={() => setCount((count) => count + 1)}>
|
|
||||||
count is {count}
|
|
||||||
</button>
|
|
||||||
<p>
|
|
||||||
Edit <code>src/App.tsx</code> and save to test HMR
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<p className="read-the-docs">
|
|
||||||
Click on the Vite and React logos to learn more
|
|
||||||
</p>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 4.0 KiB |
@@ -1,68 +0,0 @@
|
|||||||
:root {
|
|
||||||
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 1.5;
|
|
||||||
font-weight: 400;
|
|
||||||
|
|
||||||
color-scheme: light dark;
|
|
||||||
color: rgba(255, 255, 255, 0.87);
|
|
||||||
background-color: #242424;
|
|
||||||
|
|
||||||
font-synthesis: none;
|
|
||||||
text-rendering: optimizeLegibility;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
font-weight: 500;
|
|
||||||
color: #646cff;
|
|
||||||
text-decoration: inherit;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
color: #535bf2;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
display: flex;
|
|
||||||
place-items: center;
|
|
||||||
min-width: 320px;
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 3.2em;
|
|
||||||
line-height: 1.1;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
border-radius: 8px;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
padding: 0.6em 1.2em;
|
|
||||||
font-size: 1em;
|
|
||||||
font-weight: 500;
|
|
||||||
font-family: inherit;
|
|
||||||
background-color: #1a1a1a;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: border-color 0.25s;
|
|
||||||
}
|
|
||||||
button:hover {
|
|
||||||
border-color: #646cff;
|
|
||||||
}
|
|
||||||
button:focus,
|
|
||||||
button:focus-visible {
|
|
||||||
outline: 4px auto -webkit-focus-ring-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
|
||||||
:root {
|
|
||||||
color: #213547;
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
color: #747bff;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { StrictMode } from 'react'
|
|
||||||
import { createRoot } from 'react-dom/client'
|
|
||||||
import './index.css'
|
|
||||||
import App from './App.tsx'
|
|
||||||
|
|
||||||
createRoot(document.getElementById('root')!).render(
|
|
||||||
<StrictMode>
|
|
||||||
<App />
|
|
||||||
</StrictMode>,
|
|
||||||
)
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
||||||
"target": "ES2022",
|
|
||||||
"useDefineForClassFields": true,
|
|
||||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
||||||
"module": "ESNext",
|
|
||||||
"types": ["vite/client"],
|
|
||||||
"skipLibCheck": true,
|
|
||||||
|
|
||||||
/* Bundler mode */
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"verbatimModuleSyntax": true,
|
|
||||||
"moduleDetection": "force",
|
|
||||||
"noEmit": true,
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
|
|
||||||
/* Linting */
|
|
||||||
"strict": true,
|
|
||||||
"noUnusedLocals": true,
|
|
||||||
"noUnusedParameters": true,
|
|
||||||
"erasableSyntaxOnly": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"noUncheckedSideEffectImports": true
|
|
||||||
},
|
|
||||||
"include": ["src"]
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"files": [],
|
|
||||||
"references": [
|
|
||||||
{ "path": "./tsconfig.app.json" },
|
|
||||||
{ "path": "./tsconfig.node.json" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user