How pwachara/life-outreach-church works
1. This repo is a split SvelteKit + PocketBase application. The SvelteKit side provides the user-facing site and the custom admin dashboard, while PocketBase provides the backend API, authentication, database, file storage, and built-in admin/runtime.
2. The public-facing SvelteKit routes are centered around church content: a homepage, a videos listing page, and event detail pages under src/routes/events/[id]. These pages are likely read-only consumers of PocketBase collections.
3. The admin area is separated by route structure: src/routes/(admin)/login for sign-in, and src/routes/dashboard for the authenticated management UI. The dashboard contains CRUD flows for banners, events, and videos, plus a change-password screen.
4. Data access is centralized through src/lib/pocketbase.js, which is the main client boundary between the SvelteKit app and the backend. Route +page.js files likely load records from PocketBase and pass them into Svelte components for rendering and editing.
5. PocketBase is the system of record. The presence of pocketbase.exe, pb_data/data.db, and pb_data/logs.db indicates an embedded PocketBase runtime with SQLite storage. Uploaded media is persisted under pb_data/storage, so file assets are part of the backend state, not just the frontend build.
6. The data model is evolved through PocketBase migrations in pb_migrations. The migration names show three primary content collections: banners, events, and videos. That means the app’s architecture is content-management oriented rather than generic CRUD.
7. pb_public contains generated PocketBase web assets, including the built admin UI and immutable bundles. This is runtime/static output, not application source, and it supports the PocketBase server’s built-in browser interface.
8. The frontend is a standard SvelteKit app using Vite, Tailwind, and PostCSS. src/app.html, src/app.css, src/routes, and src/lib are the main source boundaries; src/fonts and static/robots.txt indicate additional asset and SEO handling.
9. Authentication and authorization are handled at the application boundary, not by a separate service. The login route and dashboard layout suggest the app gates admin pages in SvelteKit, while PocketBase likely supplies the auth session and user identity used by the admin UI.
10. Deployment is containerized and production-oriented. Dockerfile, fly.toml, and .github/workflows/fly-deploy.yml show the app is designed to run on Fly.io, probably as a single deployable unit that serves both the SvelteKit frontend and the PocketBase backend with persistent data volume attached.
11. From an architecture-diagram perspective, the key request flow is: browser → SvelteKit route/component → PocketBase client → PocketBase API/database/storage. For admin content updates, the same path writes back to PocketBase, which persists records in SQLite and files in the storage directory.
12. The important boundaries are: public site vs authenticated dashboard, frontend code vs PocketBase backend, and source code vs generated/runtime artifacts (pb_public, pb_data). Those boundaries are the main ones to show if you are drawing the system diagram.
Main entry points: pocketbase.js PocketBase client · pocketbase.exe PocketBase API · Dockerfile Container image · +page.svelte Public site
Components 19
SvelteKit app
User-facing site and authenticated admin UI
- Public site · Homepage and content browsing routes
src/routes/+page.svelte - Videos page · Public videos listing
src/routes/videos/+page.svelte - Event detail · Public event detail view
src/routes/events/[id]/+page.svelte - Admin login · Authenticated sign-in entry
src/routes/(admin)/login/+page.svelte - Dashboard shell · Authenticated management layout and access boundary
src/routes/dashboard/+layout.svelte - Content CRUD · Banner, event, and video management screens
src/routes/dashboard/banners/+page.svelte - Password change · Account password update screen
src/routes/dashboard/change-password/+page.svelte - PocketBase client · Shared frontend client for API access
src/lib/pocketbase.js - Route loaders · +page.js data fetch and mutation preparation
src/routes/+page.js
PocketBase runtime
Embedded backend, data, storage, and generated admin assets
- PocketBase API · Auth, records, and file operations
pocketbase.exe - SQLite data · PocketBase record persistence
pb_data/data.db - Media storage · Uploaded files and images
pb_data/storage - Admin runtime · Built PocketBase browser admin assets
pb_public/index.html - Migrations · Collection and schema changes for banners, events, and videos
pb_migrations/1721533215_created_videos.js - Generated types · PocketBase-generated TypeScript declarations
pb_data/types.d.ts
Deployment
Container and Fly.io release setup
- Container image · Production container build
Dockerfile - Fly config · Fly.io deployment configuration
fly.toml - Deploy workflow · Automated Fly deployment pipeline
.github/workflows/fly-deploy.yml
Other components
- Browser · End users and admins accessing the app
Connections 23
- Browser → Public site: read · Visitors load the public homepage
- Browser → Videos page: browse · Visitors open the videos listing
- Browser → Event detail: view · Visitors open event details
- Browser → Admin login: sign in · Admins authenticate through the login route
- Browser → Dashboard shell: manage · Authenticated users enter the dashboard
- Public site → PocketBase client: fetch data · Public routes load content from PocketBase
- Videos page → PocketBase client: fetch data · Videos listing reads content records
- Event detail → PocketBase client: fetch data · Event detail reads a single record
- Admin login → PocketBase client: auth · Login exchanges credentials with PocketBase
- Dashboard shell → PocketBase client: session · Dashboard uses shared backend client and session state
- Content CRUD → PocketBase client: write data · CRUD screens create and update content records
- Password change → PocketBase client: update auth · Password change submits authenticated account updates
- Route loaders → PocketBase client: load records · Route loaders prepare data from PocketBase
- PocketBase client → PocketBase API: requests · Frontend talks to the embedded backend API
- PocketBase API → SQLite data: persist · Records are stored in SQLite
- PocketBase API → Media storage: store files · Uploads are written to backend storage
- Migrations → SQLite data: evolve schema · Migrations define and update collections
- Admin runtime → PocketBase API: serve admin · PocketBase serves its built-in admin interface
- Container image → Public site: bundle · Container packages the SvelteKit app
- Container image → PocketBase API: run · Container includes the PocketBase executable
- Fly config → Container image: deploy · Fly runs the containerized app
- Deploy workflow → Fly config: publish · CI automates Fly deployment
- Generated types → PocketBase client: types · Generated types support the shared client boundary