Skip to content
web web-development featured

Banjarsari Youth Organization Portal

Official youth organization website, rebuilt in SvelteKit and TypeScript: a citizen feedback box with no account, multi-category articles, an interactive map, an AI chatbot, and a nine-tab dashboard for members, cash, inventory, and events.

web │ live · kartabanjarsari.fun · ai-integration· firebase· full-stack· responsive
Banjarsari Youth Organization Portal
AI Integration Firebase Full Stack Responsive SvelteKit TypeScript

The official website of Karang Taruna Desa Banjarsari — a youth organisation in Kandangan, Temanggung, Central Java — live at https://kartabanjarsari.fun/. On 20 October 2026 the site moved from plain HTML and vanilla JavaScript to SvelteKit 2, Svelte 5 and strict TypeScript. Pages are prerendered to static HTML, and the organisation still edits its own content from a browser dashboard.

Highlights

  • A real rewrite, compared against the old site — every page is now a Svelte 5 component and the old runtime is deleted. A first migration attempt only wrapped the old HTML and JavaScript in {@html}, and the chatbot, comments, search and login did not work, so the pages were written again. The new build was then compared with the old one in a headless browser at 1366×768 and 390×844, element by element: position, size, text and visibility.
  • Public writes go through the server — the database rules no longer let a visitor write comments or aspirations from the browser. /api/kirim checks proof of a human (a Cloudflare Turnstile token, or a signed HMAC token from the chatbot), applies a per-IP rate limit, and then writes with the database secret. If the secret is missing it returns 503 instead of letting the request through.
  • Admin sign-ins leave a separate trail — security_events records each login, logout and failed login with the IP and city that only the server can see. Login and logout need a valid Firebase ID token. A failed login is only a browser report and can be faked, so this node stays apart from audit_logs, which the rules keep append-only.
  • Cache busting is now automatic — Vite hashes every asset name, and updated.check() runs when a page returns from bfcache. The hand-edited ?v= tokens and version.json are gone. The dashboard never reloads itself, so a half-written article is safe.

Key Features

  1. Articles and activities — the organisation's news and programme, with comments, reactions and a Quill editor in the dashboard.
  2. Gallery — photo albums and video documentation in lightGallery.
  3. Interactive map — a Leaflet map of the village with markers and boundaries.
  4. Organisation structure — an interactive chart with a detail view for each committee member.
  5. Aspiration box — residents send suggestions with no account, and others can like and reply.
  6. AI chatbot — answers from organisation data bundled at build time plus live testimonials, and has a mode to file an aspiration from the chat.
  7. Admin dashboard — nine tabs behind Firebase Auth: members, organisation structure, cash records, inventory with lending records, events, gallery, articles, testimonials and the system log.
  8. Search and FAQ — a site-wide search page and an FAQ on the homepage.

Tech Stack

  • SvelteKit 2 + Svelte 5 (runes), TypeScript (strict)
  • Bun (package manager) + Vite 6
  • Firebase Realtime Database + Firebase Auth (modular SDK v11)
  • SvelteKit server routes: chat, kirim, verify-human, log-visit, security-event
  • OpenAI Chat Completions, gpt-6.1-sol (server-side only)
  • Cloudflare Turnstile (checks a human at the moment of action)
  • Leaflet, lightGallery, Quill and Chart.js (CDN, loaded only where a page needs them)
  • Vercel (adapter-vercel, Node 22) on a custom domain

Status & Maturity

Active and serving a real organisation. Content and UI are Indonesian only — <html lang="id">, with no language switcher — which fits the audience. There is no automated test suite. Each change is checked with svelte-check, a production build and a manual browser pass. Two things are still not verified: the chatbot end to end in production, because a headless browser cannot pass a real Turnstile challenge, and how the animations feel on a real phone. The companion Android app and an unfinished shop feature were removed rather than left half-wired.

The rewrite did not make every page lighter. Measured locally at 390×844 with the cache off, median of three runs: /login fell from 1,449 to 355 KB, /search fell from 523 to 252 KB, and the homepage rose from 288 to 321 KB. Localhost hides network latency.

Measured Metrics

Commits 301
Date Range 14 Apr 2026 – 31 Oct 2026
Lines of code 74,132 including tracked static media; 30,448 text lines
TypeScript + Svelte 14,960 lines
CSS 12,199 lines
Automated tests none