Server commit

This commit is contained in:
RIT Services
2026-08-04 06:15:58 +00:00
parent fafb8d5bce
commit 38453e7f6d
19 changed files with 6 additions and 1606 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 KiB

BIN
Ritz/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 KiB

BIN
Tillo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -1367,9 +1367,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1387,9 +1384,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1407,9 +1401,6 @@
"ppc64" "ppc64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1427,9 +1418,6 @@
"s390x" "s390x"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1447,9 +1435,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1467,9 +1452,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1974,9 +1956,9 @@
} }
}, },
"node_modules/brace-expansion": { "node_modules/brace-expansion": {
"version": "5.0.8", "version": "5.0.9",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
"integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==", "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -2864,9 +2846,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2888,9 +2867,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2912,9 +2888,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2936,9 +2909,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3182,9 +3152,9 @@
} }
}, },
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.5.22", "version": "8.5.25",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.22.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.25.tgz",
"integrity": "sha512-KBDEIpLrvpv16pp3K0Fw+UCoZfopFjjgeB+0tA/aaThfEE74kKDLrgg603YvOWJyg3+WYtyq3xYsQWsIyZlPqQ==", "integrity": "sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {

View File

@@ -1,110 +0,0 @@
from fpdf import FPDF
class DeploymentReport(FPDF):
def header(self):
self.set_fill_color(20, 40, 80) # Navy Blue
self.rect(0, 0, 210, 40, 'F')
self.set_text_color(255, 255, 255)
self.set_font('Arial', 'B', 16)
self.cell(0, 20, 'Deployment Analysis Report', ln=True, align='C')
self.set_font('Arial', '', 12)
self.cell(0, 10, 'Tillo - Canteen Automation Ecosystem', ln=True, align='C')
self.ln(20)
def footer(self):
self.set_y(-15)
self.set_font('Arial', 'I', 8)
self.set_text_color(128, 128, 128)
self.cell(0, 10, f'Page {self.page_no()} | Generated by Claude Code', align='C')
def section_title(self, title):
self.ln(5)
self.set_font('Arial', 'B', 14)
self.set_text_color(20, 40, 80)
self.cell(0, 10, title, ln=True)
self.ln(2)
self.set_draw_color(20, 40, 80)
self.line(self.get_x(), self.get_y(), self.get_x() + 190, self.get_y())
self.ln(5)
def section_body(self, text):
self.set_font('Arial', '', 11)
self.set_text_color(0, 0, 0)
self.multi_cell(0, 7, text)
self.ln(3)
def create_table(self, header, data):
self.ln(5)
self.set_font('Arial', 'B', 10)
self.set_fill_color(230, 230, 230)
col_width = 190 / len(header)
for i, h in enumerate(header):
self.cell(col_width, 10, h, 1, 0, 'C', fill=True)
self.ln()
self.set_font('Arial', '', 9)
for row in data:
for item in row:
self.cell(col_width, 10, str(item), 1)
self.ln()
self.ln(5)
pdf = DeploymentReport()
pdf.add_page()
# Section 1: Infrastructure Analysis
pdf.section_title("1. Infrastructure Analysis & Resource Requirements")
infra_text = (
"The system follows a Hub-and-Spoke architecture with a central Java backend and three React frontends.\n\n"
"Backend (Java 17 / Spring Boot):\n"
"- CPU: 4 vCPUs recommended for high-concurrency request processing.\n"
"- RAM: 8GB RAM is the critical baseline to avoid Out-Of-Memory (OOM) crashes during peak hours.\n\n"
"Database (PostgreSQL):\n"
"- High-performance NVMe SSD is essential to prevent I/O bottlenecks, especially during daily archival tasks.\n"
"- Recommended: 2 vCPUs / 4GB RAM.\n\n"
"Frontends (React/Vite):\n"
"- Purely static assets; should be served via a Global CDN for low latency."
)
pdf.section_body(infra_text)
# Section 2: Deployment Options
pdf.section_title("2. Deployment Options")
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, "Option A: The Managed Powerhouse (GCP/AWS)", ln=True)
pdf.section_body("Best for Enterprise reliability and automatic scaling. Use Cloud Run/Fargate for Backend, Managed SQL for DB, and S3/CloudFront for Frontends. Pros: Highest reliability. Cons: Highest cost.")
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, "Option B: The Developer's Balance (DigitalOcean/Railway)", ln=True)
pdf.section_body("Recommended. Best balance of cost, ease of use, and stability. Use Premium Droplets (4vCPU/8GB) and Managed PostgreSQL. Frontends on Vercel/Netlify. Pros: Predictable pricing, fast setup.")
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, "Option C: The Budget Optimizer (Hetzner/OVH)", ln=True)
pdf.section_body("Best for minimum cost. Single powerful VPS hosting both API and DB via Docker Compose. Frontends on Cloudflare Pages. Pros: Lowest cost. Cons: High maintenance burden.")
# Section 3: Comparison Matrix
pdf.section_title("3. Comparison Matrix")
header = ["Dimension", "Option A", "Option B", "Option C"]
data = [
["Monthly Cost", "High (~$150+)", "Medium (~$60-90)", "Low (~$20-40)"],
["Setup Effort", "Medium", "Low", "High"],
["Scalability", "Automatic", "Manual/Vertical", "Manual/Vertical"],
["Reliability", "99.99%", "99.9%", "Moderate"],
["Maintenance", "Near Zero", "Low", "High"]
]
pdf.create_table(header, data)
# Section 4: Operational Strategy
pdf.section_title("4. Operational Strategy")
ops_text = (
"CI/CD Flow: GitHub Actions -> Maven/Vite Build -> Docker Image -> Rolling Update.\n\n"
"Security:\n"
"- Secret Management: Use environment variable managers; never commit .env files.\n"
"- CORS Strategy: Set APP_CORS_ORIGINS to allow only the three specific production frontend domains.\n"
"- Backups: Automated daily snapshots via managed database providers.\n\n"
"Monitoring: Implement Spring Boot Actuator to monitor JVM heap and thread counts in real-time."
)
pdf.section_body(ops_text)
pdf.output("Deployment_Report_Tillo.pdf")

BIN
image.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -1,7 +0,0 @@
@echo off
git init
git remote add origin https://github.com/Canteen-Automation/RIT-Canteen.git
git checkout -b Abiram
git add .
git commit -m "Pushing code to Abiram branch"
git push -u origin Abiram --force

View File

@@ -1,401 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test QR — Tillo</title>
<script src="https://cdn.jsdelivr.net/npm/qrcode@1.5.3/build/qrcode.min.js"></script>
<style>
/* ── Screen styles ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Inter', sans-serif;
background: #0f0f12;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px;
gap: 32px;
}
.screen-label {
color: #6b7280;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 0.15em;
font-weight: 600;
}
.print-btn {
background: linear-gradient(135deg, #6366f1, #8b5cf6);
color: white;
border: none;
padding: 12px 32px;
border-radius: 12px;
font-size: 15px;
font-weight: 600;
font-family: 'Inter', sans-serif;
cursor: pointer;
letter-spacing: 0.02em;
transition: opacity 0.2s, transform 0.2s;
box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}
.print-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.print-btn:active { transform: translateY(0); }
/* ── The ticket card ── */
.ticket {
background: white;
border-radius: 20px;
width: 340px;
padding: 28px 24px 24px;
display: flex;
flex-direction: column;
align-items: center;
gap: 18px;
position: relative;
box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
}
/* Notch cut-outs on the sides (visual ticket effect) */
.ticket::before,
.ticket::after {
content: '';
position: absolute;
width: 22px;
height: 22px;
background: #0f0f12;
border-radius: 50%;
top: 50%;
transform: translateY(-50%);
}
.ticket::before { left: -11px; }
.ticket::after { right: -11px; }
.ticket-header {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding-bottom: 16px;
border-bottom: 1.5px dashed #e5e7eb;
}
.logo-row {
display: flex;
align-items: center;
gap: 10px;
}
.logo-icon {
width: 36px;
height: 36px;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.logo-icon svg { color: white; }
.canteen-name {
font-size: 18px;
font-weight: 800;
color: #111827;
letter-spacing: -0.02em;
}
.subtitle {
font-size: 11px;
color: #9ca3af;
font-weight: 500;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.test-badge {
display: inline-flex;
align-items: center;
gap: 5px;
background: #fef2f2;
color: #dc2626;
border: 1px solid #fecaca;
border-radius: 6px;
padding: 4px 10px;
font-size: 10px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.qr-wrapper {
padding: 12px;
border: 2px dashed #e5e7eb;
border-radius: 14px;
background: #f9fafb;
position: relative;
}
.qr-wrapper canvas {
display: block;
border-radius: 6px;
}
.order-details {
width: 100%;
display: flex;
flex-direction: column;
gap: 8px;
}
.detail-row {
display: flex;
justify-content: space-between;
align-items: center;
}
.detail-label {
font-size: 11px;
color: #9ca3af;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.06em;
}
.detail-value {
font-size: 13px;
color: #111827;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.detail-value.order-number {
font-family: 'Courier New', monospace;
font-size: 12px;
background: #f3f4f6;
padding: 2px 8px;
border-radius: 5px;
color: #374151;
}
.divider {
width: 100%;
height: 1px;
background: repeating-linear-gradient(90deg, #e5e7eb 0, #e5e7eb 6px, transparent 6px, transparent 12px);
}
.items-section {
width: 100%;
display: flex;
flex-direction: column;
gap: 5px;
}
.item-row {
display: flex;
justify-content: space-between;
font-size: 12.5px;
color: #374151;
}
.item-row .item-name { font-weight: 500; }
.item-row .item-price { font-weight: 600; color: #111827; }
.total-row {
display: flex;
justify-content: space-between;
font-size: 14px;
font-weight: 800;
color: #111827;
padding-top: 6px;
border-top: 1.5px solid #e5e7eb;
margin-top: 2px;
}
.footer-note {
font-size: 10px;
color: #9ca3af;
text-align: center;
line-height: 1.5;
}
.never-delivered-tag {
background: linear-gradient(135deg, #fef3c7, #fde68a);
border: 1px solid #f59e0b;
border-radius: 8px;
padding: 6px 12px;
font-size: 10.5px;
font-weight: 700;
color: #92400e;
text-align: center;
width: 100%;
}
/* ── Print styles ── */
@media print {
@page {
size: 80mm auto; /* 80mm thermal receipt paper width */
margin: 4mm;
}
body {
background: white !important;
padding: 0;
margin: 0;
min-height: unset;
}
.screen-label,
.print-btn,
.hint-box {
display: none !important;
}
.ticket {
width: 100%;
max-width: 72mm;
box-shadow: none;
border-radius: 0;
padding: 4mm;
border: none;
}
.ticket::before,
.ticket::after {
display: none;
}
.canteen-name { font-size: 16px; }
.test-badge { font-size: 9px; }
.qr-wrapper { border: 1px dashed #ccc; }
.never-delivered-tag { font-size: 9px; }
}
</style>
</head>
<body>
<p class="screen-label">🖨️ Test QR — Print Preview</p>
<!-- The printable ticket -->
<div class="ticket" id="ticket">
<!-- Header -->
<div class="ticket-header">
<div class="logo-row">
<div class="logo-icon">
<svg width="20" height="20" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="2.2">
<path stroke-linecap="round" stroke-linejoin="round" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-1.5 6h11M10 21a1 1 0 100-2 1 1 0 000 2zm7 0a1 1 0 100-2 1 1 0 000 2z" />
</svg>
</div>
<span class="canteen-name">RIT Canteen</span>
</div>
<span class="subtitle">Tillo · Order Receipt</span>
<div class="test-badge">
⚠️ TEST ORDER — NOT REAL
</div>
</div>
<!-- QR Code -->
<div class="qr-wrapper">
<canvas id="qr-canvas"></canvas>
</div>
<!-- Order details -->
<div class="order-details">
<div class="detail-row">
<span class="detail-label">Order #</span>
<span class="detail-value">#TEST</span>
</div>
<div class="detail-row">
<span class="detail-label">Ref ID</span>
<span class="detail-value order-number">ORD-TESTPRINT</span>
</div>
<div class="detail-row">
<span class="detail-label">Customer</span>
<span class="detail-value">Test Customer</span>
</div>
<div class="detail-row">
<span class="detail-label">Payment</span>
<span class="detail-value">Ritz Token</span>
</div>
<div class="detail-row">
<span class="detail-label">Type</span>
<span class="detail-value">Dine-in</span>
</div>
</div>
<div class="divider"></div>
<!-- Items -->
<div class="items-section">
<div class="item-row">
<span class="item-name">Samosa × 1</span>
<span class="item-price">₹25</span>
</div>
<div class="item-row">
<span class="item-name">Masala Tea × 2</span>
<span class="item-price">₹60</span>
</div>
<div class="item-row">
<span class="item-name">Veg Burger × 1</span>
<span class="item-price">₹120</span>
</div>
<div class="total-row">
<span>Total</span>
<span>₹205</span>
</div>
</div>
<div class="divider"></div>
<!-- Never-delivered notice -->
<div class="never-delivered-tag">
🔒 This QR cannot be marked as Delivered.<br>
Use for print quality &amp; scan testing only.
</div>
<p class="footer-note">
Scan with terminal to verify scanner functionality.<br>
Order ID <strong>ORD-TESTPRINT</strong> does not exist in the database.
</p>
</div>
<button class="print-btn" onclick="window.print()">🖨️ Print This QR</button>
<p class="screen-label hint-box" style="color:#4b5563; font-size:11px; max-width:320px; text-align:center; line-height:1.6;">
The QR encodes <code style="background:#1f2937;color:#a5b4fc;padding:2px 6px;border-radius:4px;">ORD-TESTPRINT</code>.
The terminal will get a <strong style="color:#f87171;">404 — Order Not Found</strong> when it tries to look this up,
so it can never be accidentally marked as delivered.
</p>
<script>
// The QR content is the fake order number.
// The terminal controller does: orderRepository.findByOrderNumber(orderNum)
// "ORD-TESTPRINT" will never match any UUID-based real order → always 404.
const ORDER_NUMBER = 'ORD-TESTPRINT';
QRCode.toCanvas(
document.getElementById('qr-canvas'),
ORDER_NUMBER,
{
width: 200,
margin: 2,
color: {
dark: '#111827',
light: '#f9fafb',
},
errorCorrectionLevel: 'H', // Highest — handles partial damage / wear
},
function (err) {
if (err) console.error('QR generation error:', err);
}
);
</script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 MiB