feat: simplify architecture by removing cache layer and centralizing routes

- Removed over-engineered cache system for static CV data that only changes on deployment
- Extracted all route configuration to internal/routes/routes.go for better organization
- Implemented rate limiting and cache control middleware for PDF endpoint protection
This commit is contained in:
juanatsap
2025-11-12 17:53:24 +00:00
parent 927d257f2c
commit 211fd05462
18 changed files with 967 additions and 3042 deletions
-24
View File
@@ -1,24 +0,0 @@
{
"old": {},
"new": {
"badge": {
"box": {
"x": 528.046875,
"y": 173.96875,
"width": 164,
"height": 21.609375
},
"styles": {
"height": "21.6094px",
"padding": "0px",
"fontSize": "14.4px",
"fontWeight": "400",
"color": "rgb(204, 204, 204)",
"backgroundColor": "rgba(0, 0, 0, 0)",
"borderRadius": "0px",
"display": "block",
"alignItems": "normal"
}
}
}
}
-91
View File
@@ -1,91 +0,0 @@
{
"timestamp": "2025-10-31T15:52:05.485Z",
"oldSite": {
"url": "http://localhost:3000",
"hasContent": true,
"classesFound": 0,
"dimensions": {
"width": 1920,
"height": 1080
},
"badges": null
},
"newSite": {
"url": "http://localhost:1999",
"dimensions": {
"width": 1920,
"height": 2195
},
"badges": [
{
"tag": "SPAN",
"class": "title-badge",
"text": "ANALYST PROGRAMMER",
"styles": {
"fontSize": "14.4px",
"fontWeight": "400",
"color": "rgb(204, 204, 204)",
"backgroundColor": "rgba(0, 0, 0, 0)",
"padding": "0px",
"height": "21.6094px"
}
},
{
"tag": "SPAN",
"class": "title-badge",
"text": "NODEJS + REACTJS DEVELOPER",
"styles": {
"fontSize": "14.4px",
"fontWeight": "400",
"color": "rgb(204, 204, 204)",
"backgroundColor": "rgba(0, 0, 0, 0)",
"padding": "0px",
"height": "21.6094px"
}
},
{
"tag": "SPAN",
"class": "title-badge",
"text": "WEB DEVELOPER",
"styles": {
"fontSize": "14.4px",
"fontWeight": "400",
"color": "rgb(204, 204, 204)",
"backgroundColor": "rgba(0, 0, 0, 0)",
"padding": "0px",
"height": "21.6094px"
}
},
{
"tag": "SPAN",
"class": "title-badge",
"text": "JAVA DEVELOPER",
"styles": {
"fontSize": "14.4px",
"fontWeight": "400",
"color": "rgb(204, 204, 204)",
"backgroundColor": "rgba(0, 0, 0, 0)",
"padding": "0px",
"height": "21.6094px"
}
},
{
"tag": "SPAN",
"class": "title-badge",
"text": "PHP DEVELOPER",
"styles": {
"fontSize": "14.4px",
"fontWeight": "400",
"color": "rgb(204, 204, 204)",
"backgroundColor": "rgba(0, 0, 0, 0)",
"padding": "0px",
"height": "21.6094px"
}
}
]
},
"comparison": {
"dimensionsMatch": false,
"pixelPerfect": null
}
}
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

@@ -1,9 +0,0 @@
{
"old": {},
"new": {
"backgroundColor": "rgb(209, 212, 210)",
"padding": "32px 24px",
"width": "300px",
"minWidth": "auto"
}
}
@@ -1,37 +0,0 @@
{
"old": {},
"new": {
"name": {
"fontFamily": "Quicksand, sans-serif",
"fontSize": "35.2px",
"fontWeight": "400",
"lineHeight": "38.72px",
"color": "rgb(0, 0, 0)",
"letterSpacing": "normal"
},
"sidebarTitle": {
"fontFamily": "Quicksand, sans-serif",
"fontSize": "18.72px",
"fontWeight": "500",
"lineHeight": "22.464px",
"color": "rgb(51, 51, 51)",
"letterSpacing": "normal"
},
"sectionTitle": {
"fontFamily": "Quicksand, sans-serif",
"fontSize": "20.8px",
"fontWeight": "500",
"lineHeight": "24.96px",
"color": "rgb(51, 51, 51)",
"letterSpacing": "normal"
},
"badge": {
"fontFamily": "Quicksand, \"Source Sans Pro\", -apple-system, system-ui, sans-serif",
"fontSize": "14.4px",
"fontWeight": "400",
"lineHeight": "21.6px",
"color": "rgb(204, 204, 204)",
"letterSpacing": "normal"
}
}
}
+216
View File
@@ -0,0 +1,216 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bottom Buttons Test</title>
<style>
body {
margin: 0;
padding: 20px;
font-family: Arial, sans-serif;
min-height: 300vh; /* Make page scrollable */
background: linear-gradient(to bottom, #f0f0f0 0%, #e0e0e0 100%);
}
.test-info {
position: fixed;
top: 20px;
left: 20px;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
z-index: 1000;
max-width: 400px;
}
.test-info h2 {
margin-top: 0;
color: #333;
}
.status {
margin: 10px 0;
padding: 10px;
border-radius: 4px;
font-family: monospace;
}
.status.at-bottom {
background: #27ae60;
color: white;
}
.status.not-bottom {
background: #e0e0e0;
color: #333;
}
/* Copy styles from main.css */
.back-to-top {
position: fixed;
bottom: 2rem;
right: 2rem;
width: 35px;
height: 35px;
background: #2a2a2a;
color: white;
border: none;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
z-index: 99;
transition: all 0.3s ease;
opacity: 0.2;
font-size: 20px;
}
.back-to-top:hover {
opacity: 1;
transform: translateY(-3px) scale(1.43);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
background: #3a3a3a;
}
.back-to-top.at-bottom {
opacity: 1;
background: #27ae60;
}
.info-button {
position: fixed;
bottom: 2rem;
left: 2rem;
width: 50px;
height: 50px;
background: #2a2a2a;
color: white;
border: none;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
z-index: 99;
transition: all 0.3s ease;
opacity: 0.2;
font-size: 24px;
}
.info-button:hover {
opacity: 1;
transform: translateY(-3px);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
background: #3a3a3a;
}
.info-button.at-bottom {
opacity: 1;
background: #27ae60;
}
.content-marker {
padding: 20px;
margin: 50px 0;
background: white;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
</style>
</head>
<body>
<div class="test-info">
<h2>🧪 Bottom Buttons Test</h2>
<p>Scroll to the bottom to see the buttons turn green!</p>
<div id="status" class="status not-bottom">
Not at bottom
</div>
<div style="margin-top: 15px;">
<strong>Current Scroll:</strong> <span id="scroll-pos">0</span>px<br>
<strong>Distance from Bottom:</strong> <span id="distance">0</span>px
</div>
</div>
<div class="content-marker">
<h1>Top of Page</h1>
<p>Start scrolling down to test the bottom detection...</p>
</div>
<div class="content-marker" style="margin-top: 100vh;">
<h2>Middle Section</h2>
<p>Keep scrolling...</p>
</div>
<div class="content-marker" style="margin-top: 100vh;">
<h2>Almost There...</h2>
<p>Just a bit more...</p>
</div>
<div class="content-marker" style="margin-top: 50vh; margin-bottom: 100px;">
<h2>🎯 Bottom of Page</h2>
<p>You should see the buttons turn green now!</p>
<p><strong>The info button (️ bottom-left) and back-to-top button (↑ bottom-right) should both be GREEN when you're at the bottom.</strong></p>
</div>
<!-- Test buttons -->
<button class="info-button" onclick="alert('Info button clicked!')"></button>
<button class="back-to-top" onclick="window.scrollTo({top: 0, behavior: 'smooth'})"></button>
<script>
// Test implementation matching the actual code
function updateBottomStatus() {
const currentScroll = window.pageYOffset || document.documentElement.scrollTop;
const scrollHeight = document.documentElement.scrollHeight;
const clientHeight = document.documentElement.clientHeight;
const distanceFromBottom = scrollHeight - currentScroll - clientHeight;
const isAtBottom = distanceFromBottom < 50;
// Update test info
const statusDiv = document.getElementById('status');
const scrollPos = document.getElementById('scroll-pos');
const distance = document.getElementById('distance');
scrollPos.textContent = Math.round(currentScroll);
distance.textContent = Math.round(distanceFromBottom);
if (isAtBottom) {
statusDiv.textContent = '✅ AT BOTTOM - Buttons should be GREEN!';
statusDiv.className = 'status at-bottom';
} else {
statusDiv.textContent = '❌ Not at bottom yet';
statusDiv.className = 'status not-bottom';
}
// Update button states
const backToTopBtn = document.querySelector('.back-to-top');
const infoBtn = document.querySelector('.info-button');
if (isAtBottom) {
backToTopBtn.classList.add('at-bottom');
infoBtn.classList.add('at-bottom');
} else {
backToTopBtn.classList.remove('at-bottom');
infoBtn.classList.remove('at-bottom');
}
// Show back-to-top button when scrolled down
if (currentScroll > 300) {
backToTopBtn.style.display = 'flex';
} else {
backToTopBtn.style.display = 'none';
}
}
// Update on scroll
window.addEventListener('scroll', updateBottomStatus);
// Initial update
updateBottomStatus();
</script>
</body>
</html>