From e19886b2ea8c4cf671291af4c8df12798fd5ded5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sel=C3=A7uk=20=C3=96zkurt?= Date: Thu, 16 Jul 2026 11:53:29 +0300 Subject: [PATCH] chore: remove committed .rej patch artifacts and update .gitignore --- .gitignore | 2 + backend/src/server.ts.rej | 42 -------------- docs/ARCHITECTURE.md.rej | 115 -------------------------------------- tailwind.config.js.rej | 47 ---------------- 4 files changed, 2 insertions(+), 204 deletions(-) delete mode 100644 backend/src/server.ts.rej delete mode 100644 docs/ARCHITECTURE.md.rej delete mode 100644 tailwind.config.js.rej diff --git a/.gitignore b/.gitignore index 4f7a389..224c3eb 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ target/ tsc_output.txt scratch/ CUsersgooglAppDataLocalpnpmstorev3/ +# Block rejected patch files +*.rej diff --git a/backend/src/server.ts.rej b/backend/src/server.ts.rej deleted file mode 100644 index f3f771d..0000000 --- a/backend/src/server.ts.rej +++ /dev/null @@ -1,42 +0,0 @@ -diff a/backend/src/server.ts b/backend/src/server.ts (rejected hunks) -@@ -1,18 +1,38 @@ -+// backend/src/server.ts -+// Fastify application entry-point. -+// Registers plugins (including rate-limiting) and route handlers. -+ - import Fastify from "fastify"; -+import rateLimitPlugin from "./plugins/rate-limit.js"; - import actionLedgerRoutes from "./routes/action-ledger.js"; - import reconciliationRoutes from "./routes/reconciliation.js"; - - export async function buildApp() { -- const app = Fastify({ logger: true }); -+ const app = Fastify({ -+ logger: true, -+ trustProxy: true, // Required so @fastify/rate-limit can read X-Forwarded-For -+ }); -+ -+ // ── Plugins ────────────────────────────────────────────────────────── -+ // Global IP-based rate limit: 100 req / minute (configurable via env). -+ await app.register(rateLimitPlugin, { -+ max: Number(process.env.RATE_LIMIT_MAX ?? 100), -+ timeWindow: Number(process.env.RATE_LIMIT_WINDOW_MS ?? 60_000), -+ }); - -+ // ── Routes ─────────────────────────────────────────────────────────── - await app.register(actionLedgerRoutes, { prefix: "/action-ledger" }); - await app.register(reconciliationRoutes, { prefix: "/reconciliation" }); - -- app.get("/health", async () => ({ status: "ok" })); -+ // ── Health ─────────────────────────────────────────────────────────── -+ app.get("/health", { config: { rateLimit: { max: 300 } } }, async () => ({ -+ status: "ok", -+ })); - - return app; - } - -+// Stand-alone start (not used when imported for testing) - if (process.argv[1] === new URL(import.meta.url).pathname) { - const app = await buildApp(); - await app.listen({ port: Number(process.env.PORT ?? 3001), host: "0.0.0.0" }); diff --git a/docs/ARCHITECTURE.md.rej b/docs/ARCHITECTURE.md.rej deleted file mode 100644 index 2c67ff6..0000000 --- a/docs/ARCHITECTURE.md.rej +++ /dev/null @@ -1,115 +0,0 @@ -diff a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md (rejected hunks) -@@ -1,16 +1,104 @@ - # VaultQuest — Architecture - -+> **Note:** This document reflects the current cross-stack architecture. -+> Changes introduced by the issues tracked below are highlighted with ✅. -+ -+--- -+ - ## Stack overview - --- Frontend: Next.js 14, Tailwind CSS --- Backend: Fastify, Node.js, TypeScript --- Contracts: Soroban (Rust), Stellar -+``` -+┌─────────────────────────────────────────────────────────────────┐ -+│ Browser / Mobile (Next.js 14 · App Router · Tailwind CSS) │ -+│ • Navbar (dark-mode toggle, navConfig-driven links) ✅ #248 #249 │ -+└──────────────────────────┬──────────────────────────────────────┘ -+ │ HTTPS -+┌──────────────────────────▼──────────────────────────────────────┐ -+│ Fastify Backend (Node.js · TypeScript) │ -+│ │ -+│ ① @fastify/rate-limit ← NEW ✅ #245 │ -+│ • Global: 100 req / 60 s per IP │ -+│ • X-Forwarded-For aware (trustProxy: true) │ -+│ • Returns 429 JSON on breach │ -+│ │ -+│ ② Routes │ -+│ POST /action-ledger/record │ -+│ GET /action-ledger/list │ -+│ POST /reconciliation/run │ -+│ GET /health (relaxed limit: 300 req/min) │ -+└──────────────────────────┬──────────────────────────────────────┘ -+ │ Stellar SDK / soroban-client -+┌──────────────────────────▼──────────────────────────────────────┐ -+│ Soroban Smart Contract (Rust · Stellar / Soroban) │ -+│ │ -+│ Storage keys: │ -+│ Admin → Address │ -+│ IsPaused → bool ← NEW ✅ #246 │ -+│ Balance(addr) → i128 │ -+│ TotalDeposits → i128 │ -+│ │ -+│ Functions: │ -+│ initialize(admin) │ -+│ pause_protocol() ← admin-only ✅ #246 │ -+│ unpause_protocol() ← admin-only ✅ #246 │ -+│ get_paused() → bool │ -+│ deposit(depositor, amount) — blocked when paused ✅ #246 │ -+│ withdraw(depositor, amount) — ALWAYS active ✅ #246 │ -+│ draw_winner(winner) — blocked when paused ✅ #246 │ -+│ balance_of(addr) → i128 │ -+│ total_deposits() → i128 │ -+└─────────────────────────────────────────────────────────────────┘ -+``` -+ -+--- -+ -+## Request flow (Backend) -+ -+``` -+Client IP -+ │ -+ ▼ -+[Fastify server] (trustProxy: true) -+ │ -+ ├─ @fastify/rate-limit ──► 429 Too Many Requests (if quota exceeded) -+ │ max: 100 req / 60 s -+ │ key: X-Forwarded-For[0] ?? req.ip -+ │ -+ ├─ Route handlers -+ │ /action-ledger/* -+ │ /reconciliation/* -+ │ /health (overrides: max 300 req/min) -+ │ -+ └─ Response -+``` -+ -+--- - --## Packages -+## Dark-mode strategy (#249) - --| Path | Description | -+| Layer | Implementation | - |---|---| --| `backend/` | Fastify action-ledger and reconciliation service | --| `contracts/` | Soroban smart contracts (Rust) | --| `app/` | Next.js frontend | --| `docs/` | Architecture and design docs | -+| Tailwind config | `darkMode: "class"` — activates `dark:` variants when `` carries the `dark` class | -+| Persistence | `localStorage.setItem("theme", "dark" \| "light")` | -+| OS fallback | `window.matchMedia("(prefers-color-scheme: dark)")` on first load | -+| Toggle | `