docs: add architecture documentation and slides
This commit is contained in:
103
docs/slides/index.html
Normal file
103
docs/slides/index.html
Normal file
@@ -0,0 +1,103 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Gapido Auth Challenge</title>
|
||||
<link rel="stylesheet" href="styles.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
<span>Gapido Backend Challenge</span>
|
||||
<div class="controls">
|
||||
<button id="theme-toggle" type="button">Toggle theme</button>
|
||||
<button id="prev" type="button">Prev</button>
|
||||
<button id="next" type="button">Next</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="deck">
|
||||
<section class="slide active">
|
||||
<p class="eyebrow">The problem</p>
|
||||
<h1>Secure OTP auth for microservices</h1>
|
||||
<p class="lede">Python • gRPC • MongoDB • Redis • RabbitMQ • Docker</p>
|
||||
</section>
|
||||
|
||||
<section class="slide split">
|
||||
<div>
|
||||
<p class="eyebrow">Constraints</p>
|
||||
<h2>What had to be proven</h2>
|
||||
</div>
|
||||
<ul class="tiles">
|
||||
<li>gRPC auth boundary</li>
|
||||
<li>secure OTP</li>
|
||||
<li>refresh rotation</li>
|
||||
<li>role-based access</li>
|
||||
<li>async SMS delivery</li>
|
||||
<li>production deployment path</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="slide diagram">
|
||||
<p class="eyebrow">Solution shape</p>
|
||||
<h2>Service architecture</h2>
|
||||
<img src="../assets/diagrams/service_architecture.png" alt="Service architecture" />
|
||||
</section>
|
||||
|
||||
<section class="slide diagram">
|
||||
<p class="eyebrow">Code organization</p>
|
||||
<h2>Clean architecture layers</h2>
|
||||
<img src="../assets/diagrams/clean_architecture.png" alt="Clean architecture layers" />
|
||||
</section>
|
||||
|
||||
<section class="slide diagram">
|
||||
<p class="eyebrow">Auth flow</p>
|
||||
<h2>OTP without storing plaintext codes</h2>
|
||||
<img src="../assets/diagrams/otp_login_flow.png" alt="OTP login flow" />
|
||||
</section>
|
||||
|
||||
<section class="slide diagram">
|
||||
<p class="eyebrow">Token safety</p>
|
||||
<h2>Refresh token rotation</h2>
|
||||
<img src="../assets/diagrams/refresh_rotation_flow.png" alt="Refresh token rotation" />
|
||||
</section>
|
||||
|
||||
<section class="slide diagram">
|
||||
<p class="eyebrow">Extensibility</p>
|
||||
<h2>Selectable SMS providers</h2>
|
||||
<img src="../assets/diagrams/sms_provider_strategy.png" alt="SMS provider strategy" />
|
||||
</section>
|
||||
|
||||
<section class="slide diagram">
|
||||
<p class="eyebrow">Deployment</p>
|
||||
<h2>Only Caddy is public</h2>
|
||||
<img src="../assets/diagrams/production_deployment.png" alt="Production deployment" />
|
||||
</section>
|
||||
|
||||
<section class="slide split">
|
||||
<div>
|
||||
<p class="eyebrow">Reliability</p>
|
||||
<h2>What makes it reviewable</h2>
|
||||
</div>
|
||||
<ul class="tiles">
|
||||
<li>Mocked SMS providers</li>
|
||||
<li>gRPC tests</li>
|
||||
<li>RBAC coverage</li>
|
||||
<li>Compose validation</li>
|
||||
<li>Health checks</li>
|
||||
<li>Postman guide</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="slide">
|
||||
<p class="eyebrow">Outcome</p>
|
||||
<h2>Interview-ready microservice demo</h2>
|
||||
<p class="lede">A focused auth service with clean boundaries, secure OTP, async messaging, provider strategy, and production deployment posture.</p>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="progress"><span id="counter">1 / 10</span></footer>
|
||||
<script src="slides.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
28
docs/slides/slides.js
Normal file
28
docs/slides/slides.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const slides = [...document.querySelectorAll(".slide")];
|
||||
const counter = document.querySelector("#counter");
|
||||
const root = document.documentElement;
|
||||
let index = 0;
|
||||
|
||||
function render() {
|
||||
slides.forEach((slide, current) => slide.classList.toggle("active", current === index));
|
||||
counter.textContent = `${index + 1} / ${slides.length}`;
|
||||
}
|
||||
|
||||
function move(delta) {
|
||||
index = (index + delta + slides.length) % slides.length;
|
||||
render();
|
||||
}
|
||||
|
||||
document.querySelector("#next").addEventListener("click", () => move(1));
|
||||
document.querySelector("#prev").addEventListener("click", () => move(-1));
|
||||
document.querySelector("#theme-toggle").addEventListener("click", () => {
|
||||
root.classList.toggle("light");
|
||||
});
|
||||
|
||||
document.addEventListener("keydown", (event) => {
|
||||
if (event.key === "ArrowRight" || event.key === " ") move(1);
|
||||
if (event.key === "ArrowLeft") move(-1);
|
||||
});
|
||||
|
||||
render();
|
||||
|
||||
178
docs/slides/styles.css
Normal file
178
docs/slides/styles.css
Normal file
@@ -0,0 +1,178 @@
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--bg: #070b14;
|
||||
--panel: #101827;
|
||||
--text: #e6edf7;
|
||||
--muted: #93a4bc;
|
||||
--accent: #34d399;
|
||||
--border: #223149;
|
||||
}
|
||||
|
||||
:root.light {
|
||||
color-scheme: light;
|
||||
--bg: #f7fafc;
|
||||
--panel: #ffffff;
|
||||
--text: #172033;
|
||||
--muted: #5f7088;
|
||||
--accent: #0f766e;
|
||||
--border: #d8e1ee;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.topbar,
|
||||
.progress {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16px 24px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.topbar {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.progress {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
button {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
background: var(--panel);
|
||||
color: var(--text);
|
||||
padding: 8px 12px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.deck {
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 72px 5vw;
|
||||
}
|
||||
|
||||
.slide {
|
||||
display: none;
|
||||
width: min(1120px, 100%);
|
||||
min-height: 620px;
|
||||
padding: 48px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
background: var(--panel);
|
||||
box-shadow: 0 24px 80px rgb(0 0 0 / 24%);
|
||||
}
|
||||
|
||||
.slide.active {
|
||||
display: grid;
|
||||
align-content: center;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.split.active {
|
||||
grid-template-columns: 0.9fr 1.1fr;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.diagram.active {
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0;
|
||||
color: var(--accent);
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2 {
|
||||
margin: 0;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
max-width: 900px;
|
||||
font-size: clamp(54px, 7vw, 92px);
|
||||
line-height: 0.95;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: clamp(36px, 5vw, 62px);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.lede {
|
||||
max-width: 820px;
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 24px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.tiles {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.tiles li {
|
||||
min-height: 96px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 18px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
color: var(--text);
|
||||
background: color-mix(in srgb, var(--panel), var(--accent) 6%);
|
||||
font-size: 20px;
|
||||
font-weight: 800;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
max-height: 460px;
|
||||
object-fit: contain;
|
||||
border-radius: 8px;
|
||||
background: #ffffff;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 820px) {
|
||||
.slide {
|
||||
min-height: 620px;
|
||||
padding: 28px;
|
||||
}
|
||||
|
||||
.split.active,
|
||||
.tiles {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user