feat: initialize microservice architecture with auth, api, realtime, copernicus, ml, and console modules

This commit is contained in:
Giuseppe Raffa
2026-03-28 15:29:34 +01:00
commit bcfce32adb
89 changed files with 12025 additions and 0 deletions

1
ml/.dockerignore Normal file
View File

@@ -0,0 +1 @@
__pycache__

0
ml/.env.example Normal file
View File

13
ml/Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM python:3.11-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1
COPY ./requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app
EXPOSE 3007
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3007"]

19
ml/main.py Normal file
View File

@@ -0,0 +1,19 @@
from fastapi import FastAPI, Request, Response, Header
from fastapi.responses import HTMLResponse, JSONResponse
import time
app = FastAPI()
@app.get("/health")
def health():
return {
"status": "ok",
"service": "ml",
"version": "1.0.0",
"build_number": "1",
"version_state": "dev"
}
@app.get("/")
def root():
return {"message": "ML Service"}

2
ml/requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
fastapi
uvicorn

Binary file not shown.

201
ml/static/styles/style.css Normal file
View File

@@ -0,0 +1,201 @@
:root {
--accent-color: #2563eb;
--accent-hover: #1d4ed8;
--accent-light: #eff6ff;
--accent-border: #bfdbfe;
--text-primary: #0f172a;
--text-secondary: #4755698f;
--text-tertiary: #94a3b8c0;
--surface: #f8fafc;
--header-bg: rgba(255, 255, 255, 0.85);
/* For Glassmorphism */
--header-border: #e2e8f0;
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
--radius-md: 8px;
--radius-lg: 12px;
}
* {
margin: 0;
padding: 0;
}
@font-face {
font-family: 'Normal';
src: url('../font/Quicksand-VariableFont_wght.ttf');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Bold';
src: url('../font/Quicksand-VariableFont_wght.ttf');
font-weight: 700;
font-style: normal;
}
body {
font-family: 'Normal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
color: var(--text-primary);
-webkit-font-smoothing: antialiased;
}
button {
padding: 10px 24px;
border-radius: var(--radius-lg);
border: 1px solid var(--header-border);
background-color: var(--bg-surface);
color: var(--text-primary);
font-size: 14px;
font-weight: 600;
font-family: 'Bold', inherit;
cursor: pointer;
transition: all 0.5s cubic-bezier(0.8, 0, 0.2, 1);
white-space: nowrap;
flex-shrink: 0;
}
button:hover {
background-color: var(--accent-light);
color: var(--accent-color);
border-color: var(--accent-border);
}
button.prominent {
background-color: var(--accent-color);
color: #ffffff;
border: 1px solid transparent;
box-shadow: var(--shadow-sm);
}
button.prominent:hover {
background-color: var(--accent-hover);
transform: translateY(-1px);
box-shadow: var(--shadow-md);
}
button.prominent:active {
transform: translateY(1px);
box-shadow: var(--shadow-sm);
}
/* INFO PANEL */
.info-panel {
display: block;
text-align: center;
align-content: center;
padding: 60px 20px;
user-select: none;
}
.info-panel h3 {
margin-bottom: 10px;
}
.info-panel p {
margin-bottom: 25px;
}
.info-panel .icon {
font-size: 48px;
margin-bottom: 20px;
align-self: center;
transition: transform 0.12s ease;
}
/* GRID & CARD ITEMS */
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1.5rem;
margin-inline: 30px;
}
.card {
display: flex;
gap: 0.75rem;
align-items: center;
padding: 1rem;
border: 1px solid var(--header-border);
border-radius: 20px;
text-decoration: none;
color: var(--text-primary);
transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card h3 {
margin: 0;
font-size: 1rem;
text-align: left;
}
.card p {
margin: 0.25rem 0 0;
color: var(--text-secondary);
opacity: 0.4;
font-size: 0.8rem;
text-align: left;
}
.card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 30px #bfdbfe30;
}
.card.standalone {
grid-column: 1 / -1;
}
/* HEADER */
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 24px;
background-color: var(--header-bg);
border-bottom: 1px solid var(--header-border);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
position: sticky;
top: 0;
z-index: 10;
user-select: none;
}
.header h1 {
color: var(--text-primary);
font-size: 1.25rem;
font-weight: 700;
letter-spacing: -0.025em;
}
.header .profile {
display: flex;
align-items: center;
gap: 16px;
}
.header .profile p {
font-size: 0.875rem;
font-weight: 500;
color: var(--text-secondary);
padding-inline: 5px;
}

28
ml/templates/console.html Normal file
View File

@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<title>ML</title>
<link href="../static/styles/style.css" rel="stylesheet">
</head>
<body>
<div class="header">
<h1>Modelli ML</h1>
<div class="profile">
<p>Utente</p>
<button>Logout</button>
</div>
</div>
<div class="container">
</div>
</body>
<script>
</script>
</html>

View File

89
ml/templates/results.html Normal file
View File

@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html>
<head>
<title>Risultati</title>
<link href="../static/styles/style.css" rel="stylesheet">
<style>
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.picker {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.picker .header {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
</head>
<body>
<div class="header">
<h1>Risultati</h1>
<div class="profile">
<p>Utente</p>
<button>Logout</button>
</div>
</div>
<div class="container">
<div class="picker">
<div class="header">
<h2>
Seleziona
</h2>
<p>
una sessione di training eseguita per visualizzarne i risultati
</p>
</div>
<div class="grid">
<div class="card">
<h3>sessione 1</h3>
<div class="train-info">
<p>24/03/2026</p>
<p>12:00</p>
<p>dataset: d-1</p>
</div>
</div>
<div class="card">
<h3>sessione 2</h3>
<p>24/03/2026</p>
</div>
</div>
</div>
</div>
</body>
<script>
</script>
</html>

0
ml/templates/test.html Normal file
View File

0
ml/templates/train.html Normal file
View File