Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KompMajstor

KompMajstor.eu — website and client operations portal

This repository is a curated, runnable source showcase for KompMajstor.eu: a Croatian IT consultancy website, AI-assisted needs assessment, and the Moj KompMajstor client operations portal.

The interesting part is not a static brochure. One Cloudflare Worker routes several product surfaces, serves the marketing site, runs structured AI workflows, protects an operator workspace, manages client data and files, and publishes narrowly scoped status pages.

This is a clean public mirror, not the production repository. Production history, credentials, resource identifiers, customer data, deployment routes, private operating material, and heavyweight media are intentionally absent.

Product tour

Client workspace Operator workspace Public status
Moj KompMajstor client overview KompMajstor operator overview Public service status
Plain-language health, requests, decisions, work, costs, plans, and documents. Cross-client operations, correspondence, systems, projects, renewals, work logs, and human-reviewed AI drafts. An opt-in, cache-safe view of only the systems and messages approved for public display.

What is implemented

  • Multi-surface edge application — hostname-aware routing for the public website, client portal, operator workspace, and status pages from one Worker.
  • Moj KompMajstor portal — passwordless client access, case timelines, managed-system coverage, work and cost ledger, decisions, projects, milestones, renewals, documents, monthly briefs, and correspondence.
  • Operator control room — organization-scoped CRUD workflows, monitoring intake, email composition, inbound-email threading, file handling, audit events, and an attention-oriented dashboard.
  • Human-in-the-loop AI — Cloudflare Workers AI helps clarify assessment requests and draft portal summaries; the operator remains responsible for anything published or sent.
  • Event-driven operations — D1 for relational state, R2 for files, Queues for mail work, Email Routing for inbound messages, and scheduled maintenance for stale signals and expired sessions.
  • Security as application code — Cloudflare Access JWT validation, organization scoping, HMAC-signed monitoring webhooks, single-use login links, secure cookies, rate limits, Turnstile support, security headers, and intentionally generic authentication responses.
  • Lightweight marketing frontend — semantic HTML, system fonts, reusable CSS tokens, progressive enhancement, accessible navigation, and code-native visuals instead of a large image bundle.
  • Executable quality checks — TypeScript checks, Worker tests, live local API integration tests, and Playwright coverage for desktop, tablet, mobile, accessibility basics, status pages, and theme switching.

Architecture

flowchart LR
    Browser[Browser or API client] --> Edge[Cloudflare Worker router]

    Edge --> Site[Marketing pages and CSS-native visuals]
    Edge --> Assess[AI assessment API]
    Edge --> Portal[Client and operator portal API]
    Edge --> Status[Public status pages and SVG badges]

    Site --> Assets[Workers Static Assets]
    Assess --> AI[Workers AI]
    Assess --> Turnstile[Turnstile]
    Assess --> Mail[Email transport]

    Portal --> Access[Cloudflare Access JWT verification]
    Portal --> D1[(D1 relational state)]
    Portal --> R2[(R2 documents and evidence)]
    Portal --> Queue[Queues]
    Portal --> AI
    Queue --> Mail

    EmailIn[Email Routing] --> Edge
    Monitor[Signed monitoring webhooks] --> Portal
    Cron[Scheduled trigger] --> Portal
Loading

The Worker entry point is src/worker.ts. It delegates the portal API to functions/portal, the assessment flow to functions/procjena, and all public files to Workers Static Assets.

Repository map

Path Purpose
src/worker.ts Hostname-aware Worker entry point plus fetch, queue, email, and scheduled handlers
functions/portal/ Portal authentication, authorization, API, data, files, mail, monitoring, status, and AI helpers
portal/src/ Preact client and operator interfaces
portal/migrations/ D1 schema and indexes
portal/seed.sql Fictional local demo organization and activity
functions/procjena/ Clarify, synthesize, secure, and submit the AI-assisted assessment
assets/ Shared design tokens and small progressive-enhancement modules
portal/tests/ Unit, integration, browser, responsive, and status checks
wrangler.toml Sanitized local/demo bindings with no production routes

Run it locally

Prerequisites: Node.js 22, npm, and a Chromium build supported by Playwright.

npm ci
npx playwright install chromium
npm run check
npm run db:local:migrate
npm run db:local:seed
npm run dev:portal

Open http://moj.localhost:8787 and use ana@example.test. In demo mode, the login screen displays the development link instead of sending email.

Useful commands:

npm run dev             # public website at the local Worker address
npm run dev:portal      # client + operator portal on moj.localhost
npm run dev:status      # public status pages on status.localhost
npm run test:browser    # requires dev:portal in another terminal
npm run test:integration
npm run test:status     # requires dev:status in another terminal

Wrangler stores local state in ../.wrangler-kompmajstor-public, outside this repository. The checked-in configuration uses fictional email addresses, placeholder Cloudflare identifiers, demo resource names, and no custom domains.

What the public mirror leaves out

  • Production Git history and operational runbooks.
  • Secrets, .dev.vars, Access audience IDs, account IDs, database IDs, routes, allowlists, and provider credentials.
  • Customer records, correspondence, monitoring data, portfolio material, and client-specific assets.
  • Photography, videos, custom font bundles, generated portal output, test artifacts, and other files that do not help a developer understand the system.
  • Campaign-specific code unrelated to the website and portal architecture.

Only the small brand marks and three compressed product screenshots are kept as binary assets.

Security

Please do not publish suspected vulnerabilities in an issue. See SECURITY.md for responsible reporting. The demo configuration is deliberately non-production and should not be deployed unchanged.

Copyright and reuse

This repository is public for technical inspection and portfolio purposes. It is not open-source software and no license is granted. See COPYRIGHT.md.

Hrvatski sažetak

Ovo je pročišćena javna preslika izvornog koda za KompMajstor.eu i portal Moj KompMajstor. Repozitorij prikazuje arhitekturu, sigurnosni model, AI procjenu, klijentsko i operatersko sučelje te lokalno pokretanje s izmišljenim podacima. Produkcijske tajne, identifikatori resursa, podaci klijenata, privatna povijest i nepotrebni medijski materijali nisu uključeni. Kod je javno dostupan za uvid, ali nije objavljen pod open-source licencom.

About

Public architecture showcase for KompMajstor.eu and the Moj KompMajstor client operations portal.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages