An English version of this article follows below. Jump to the English version.

Egy sport-, oktatás- és egészségügyi adminisztrációs rendszer implementációs fázisának mérnöki kiértékelése. A specifikáció, az adatbázisterv és az OpenAPI-leíró előzetesen készen állt; az alábbi ~22 nap kizárólag a specifikációból kódig tartó, AI-asszisztált, gépesített kivitelezést fedi le.

  • Időszak: 22 nap (06-22 → 07-13)
  • Együttműködés: 36 session / 510 emberi utasítás
  • Kódbázis: ~66 500 sor (node_modules nélkül)
  • Kiadás: 10 minor + felmérés / egészségügy / kérdőív / GDPR / wearable
  • Teszt: 1416 eset / 100 tesztfájl
  • Statikus elemzés: SonarQube · 3 zöld Quality Gate

1. Az alkalmazáskörnyezet felépítése

A rendszer 4 konténeres, Docker Compose-orchesztrált topológiára épül, szigorúan rétegzett felelősségi körökkel. A perzisztencia, az adminisztrációs felület, az üzleti logika és a prezentáció külön konténerbe szeparált; a szolgáltatások kizárólag a belső Docker-hálózaton kommunikálnak, kifelé egyedül a frontend és a phpMyAdmin publikál, önaláírt TLS mögött. Az alkalmazás-topológia mellé — külön Compose-profil mögé — a fejlesztési fázisban SonarQube kódminőség-elemző és önálló teszt-adatbázis is bekerült.

  • Prezentáció (:9000): React 18 + CoreUI, Vite build, Express-alapú HTTPS statikus kiszolgáló, /api proxy, i18n.
  • Üzleti logika (:4000): Node.js / Express, /api/v1, JWT-auth, központi RBAC-middleware, eseménynapló, IP-szűrő, cron.
  • Perzisztencia (:3306): MariaDB, 71 tábla, utf8mb4, SQL-alapú init-seed (nincs migrációs keretrendszer).
  • DB-adminisztráció (:8080): phpMyAdmin HTTPS-en, Apache SSL, üzemeltetői hozzáférés a sémához és az adatokhoz.

A backend tiszta rétegzést követ: 21 route-domain → repository → adatréteg (a sport-domain almodulokra bontva; összesen 34 route-fájl), a crossfunctional funkciók (autentikáció, jogosultság, naplózás, IP-szűrés) middleware-ekbe emelve. A jogosultságkezelés architekturálisan a rendszer gerince: egy központi accessControl döntéspont fail-closed logikával, a core_rights / core_permissions mátrixból minden /api/v1/* hívást kiértékelve — a szerepkörök a JWT-ben utaznak. A frontend React-context réteget (auth / nyelv / alkalmazásbeállítás / diák-állapot) és újrahasznosított hook- és komponenskészletet használ. A kódbázis nagyságrendje ~66 500 sor (js/jsx/sql), a struktúra a 23 fejezetes specifikációt tükrözi mérvadó forrásként.

2. Az elvégzett főbb lépések

A kivitelezés iteratív, semver-fegyelmezett ütemben haladt: a törzs 10 minor kiadás, mindegyik a CHANGELOG.md-ben tételesen dokumentálva; a fázis végén a felmérés-modul, a statikus elemzés és a teljes egészségügyi vertikum még nem-taggelt ([Unreleased]) állapotban. A munka a platform alapoktól a vertikális üzleti modulokig, majd a minőségbiztosításig, a statikus kódelemzésig, a jogosultsági finomhangolásig és az egészségügyi modul teljes kiépítéséig ívelt.

  • 1.0 — Platform: 4 konténeres környezet, TLS, healthcheck-ek, teljes OpenAPI/Swagger-leíró (v3.0.3) mint API-kontraktus.
  • 1.1–1.2 — Mag: JWT-auth (login, jelszócsere, elfelejtett jelszó), felhasználó- és csoportkezelés, GDPR-anonimizáció, rendszerbeállítások, teljes eseménynapló-middleware, az RBAC jogmátrix bevezetése.
  • 1.3–1.4 — Adminisztráció: ütemezett feladatok futástörténettel, SMTP-konfiguráció, dummy adatállomány a végponti teszteléshez.
  • Teszt-infra: Jest-alapú backend teszt-infra kiépítése és a meglévő kódra visszamenőleges tesztírás, riportolással.
  • 1.5–1.9 — Sport-modul: edzések és kiértékelésük, mérkőzések, mérkőzés- és játékosstatisztikák, felmérés-sablonok — a domain-logika párhuzamos tesztbővítéssel.
  • Konszolidáció: értesítés-rendszer, eseménynapló rekord-ID-vel, Vitest-alapú frontend teszt-suite lefedettségmérővel, végül a teljes RBAC: adat-szintű szűkítés (diák csak saját edzését/mérkőzését látja) és szerepkörválasztó.
  • Statikus elemzés: a backend, a frontend és a db forráskódja három külön SonarQube-projektként elemezve, a Jest/Vitest lefedettség importjával; a scanner által jelzett eltérések javítása.
  • Felmérés-modul: a felmérés-elemek, -sablonok és -felmérések teljes CRUD-ja + kiértékelése (min/max/átlag statisztikával), ownership-alapú szűréssel; napi határidő-figyelő ütemezett feladat e-mail + in-app értesítéssel.
  • Egészségügyi vertikum: két új szerepkör (Szakorvos, Ápoló); Egészségügyi kartonok (5.6.1); Ambuláns lapok (5.6.5) teljes CRUD-ja logikai törléssel, PDF/JPG/PNG csatolmányokkal, BNO-kódból származtatott diagnózissal, szülői e-mail értesítéssel; Sérülésnapló (5.6.4) metódus-specifikus jogokkal (101–104); a diák sportorvosi állapotának rendszerszintű kezelése (write-through + éjféli cron, állapotjelző ikon).
  • Sport-kiegészítés: Szezon statisztika (5.5.4) — szezononként egy összesített, kézilabda-specifikus kimutatás, kizárólag olvasható; új GET /sport/seasons/:id/statistics végpont (jog 105).
  • Egészségügyi kiegészítés: Sportorvosi vizsgálati kérdőívek (5.6.3) — a ~50 kérdéses jogszabályi adatlap teljes CRUD-ja rugalmas elem/érték adatmodellen, rögzítéskori kérdés-snapshottal; plusz egy admin-only katalógus-kezelő (jogok 106–114). 30 minta-kérdőív az éles DB-ben.
  • Kérdőív-modulok: Táplálkozásnapló (5.6.6, jogok 115–118) és Napi kérdőív (5.3.6, jogok 119–122) — két általános, űrlap-alapú modul közös szerkezettel, hatféle kérdéstípussal; a napi kérdőív puha belépési-kapuval. 40+40 visszamenőleg kitöltött mintaadat az éles DB-ben.
  • Minőségi konszolidáció: a SonarQube összes észrevétele rendezve (kognitív komplexitás, beágyazott ternary/template, elavult document.write, ReDoS-hotspotok) — eredmény: mindhárom projekt zöld Quality Gate, viselkedés-őrző refaktorokkal.
  • Karbantartás & UX: jog-alapú (nem hardcode-olt) menü- és útvonal-láthatóság; per-futás izolált teszt-adatbázis; BNO-törzsadat bővítése.
  • Biztonsági megerősítés & architektúra-refaktor: sebességkorlátozás a login végponton; rotáló JWT refresh token httpOnly sütiben (access token 24h→1h, új core_refresh_tokens tábla); fiók-enumeráció elleni védelem; belső TLS-ellenőrzés; a redundáns per-route auth-middleware kivezetése (egyetlen központi accessControl); a ~2850 soros sport.js domén-almodulokra bontva bitre változatlan API-val.
  • GDPR adatvédelmi csomag: adatfeldolgozói szerződés minta (28. cikk), DPIA-segédlet, Art. 30 adatkezelési nyilvántartás, adatkezelési tájékoztató sablon (13–14. cikk), felelősségi mátrix és a rendszer ismert adatvédelmi hiányosságainak tételes listája.
  • Wearable integráció — 1. etap: a diákokhoz okosóra/pulzuspánt párosítható (Garmin · Polar · Whoop · Fitbit), napi granularitású fiziológiai/terhelési metrikákkal. Ez az etap az adatmodellt (4 új tábla, „egy diák = egy vendor" generált oszlopos UNIQUE indexszel), a jogosultságokat, a GDPR-hozzájárulás kezelést, a teljes felületet és a gyártói illesztés interfész-kontraktusát szállítja; a tokenek AES-256-GCM titkosítással tárolódnak. A valós OAuth2-bekötés a 2. etap.
  • Mért adatok a meglévő képernyőkön: a wearable adat kulcsa a (diák, nap) pár, ezért minden azonos kulcsú képernyőn megjeleníthető — legerősebben a napi kérdőívvel párosítva a szubjektív és objektív adat egymás mellett (pl. bevallott 10 óra alvás vs. mért 7 ó 23 p).
  • Örökölt hibák javítása: a fázis három, a munkától független, meglévő hibát is felszínre hozott és rendezett — nem futtatható init-séma-források, olvashatatlan irat-lejárati értesítés, és a minden oldalszámot kirajzoló, oldalt szétfeszítő lapozó (ablakozást kapott).

Módszertani jegy: a tesztelés nem utólagos ráaggatás maradt — a teszt-infra felállítása után minden újabb üzleti modul tesztbővítéssel együtt érkezett, a lefedettség pedig regressziós küszöbökkel van bebiztosítva. A fázis végén ezt a statikus kódelemzés (SonarQube) egészítette ki: futásidőtől független, biztonsági- és karbantarthatósági szempontú átvizsgálás.

3. Teszt-lefedettség

Kétszintű, automatizált tesztpiramis épült ki: Jest a backendre, Vitest + Testing Library + MSW a frontendre. Összesen 1416 teszteset / 100 tesztfájl — a wearable-fázis +149 esettel (backend +136, frontend +13) 1267-ről 1416-ra emelte a tesztszámot, a lefedettségi küszöböket regresszió nélkül tartva; a backend branch-mutató 84,4%-ról 87,0%-ra javult. A frontend nevezője tudatosan a ténylegesen egységként tesztelhető rétegre (utils / hooks / context / api / megosztott komponensek + célzottan tesztelt nézetek) van szűkítve, az e2e-jellegű, űrlap-nehéz oldalak kihagyásával.

RétegStatementsBranchesFunctionsLines
Backend · Jest (1130 eset / 52 fájl)94,9%87,0%97,5%96,0%
Frontend · Vitest (286 eset / 48 fájl)97,9%87,2%85,5%97,9%

A gyengébb (~87%) branch-mutató mindkét rétegen a szokásos, elvárt jelenség: a ritka hibaágak és defenzív elágazások lefedetlensége — a döntési logika és a statement/line lefedettség (95–98%) ellenben erős.

Őszinte megjegyzés: a backend teljes futásaiban kb. minden második alkalommal elbukik pontosan egy teszt — mindig másik, és izoláltan újrafuttatva mindig zöld. Ez a projekt ismert, terhelés-alatti flakisége (per-worker izolált teszt-DB mellett is); az 5 új backend teszt-fájl megnövelte a párhuzamos terhelést, ami gyakoribbá tehette. A kód rendben van — de ez a zaj rontja a futások megbízhatóságát.

4. Statikus elemzés és biztonság — SonarQube

A fejlesztési fázisban a projekt SonarQube (Community Build) statikus kódelemzőt kapott, önálló konténerként, igény szerint futtatható scannerrel. A forráskód három külön projektként elemzett — backend (Node/Express, Jest-lefedettséggel), frontend (React SPA, Vitest-lefedettséggel) és db (MariaDB init-szkriptek) —, így a biztonsági, megbízhatósági és karbantarthatósági mérőszámok rétegenként külön követhetők.

ProjektSebezh.HotspotBugCode smellS/R/MGate
backend0000A/A/AOK
frontend0000A/A/AOK
db0000A/A/AOK

S/R/M = Security / Reliability / Maintainability rating · újraszkennelés: 2026-07-13 (a wearable-integráció és a mért adatok kivezetése után) · coverage: backend 91,2% · frontend 77,3% · duplikáció: backend 9,5% · frontend 8,7%

Zárt kör. A statikus elemzés itt nem csupán mérés, hanem visszacsatolás is volt: a korábbi elemzésben nyitva volt néhány karbantarthatósági észrevétel (kognitív komplexitás, beágyazott ternary/template, elavult API) és két „super-lineáris backtracking → DoS?" jelölésű security hotspot ugyanazon bejelentő-e-mail regex körül — ezeket egy célzott konszolidációs kör mind rendezte: a komplex validációk beszédes helper-függvényekre bomlottak, a regexet lineáris, index-alapú e-mail-ellenőrzés váltotta, a document.write Blob-URL-re cserélődött. Ugyanez megismétlődött a két új kérdőív-modulnál (20 új code smell → viselkedés-őrző refaktor), a biztonsági megerősítő körnél (4 code smell) és a wearable-modulnál is (8 új eltérés, köztük egy BUG: a lapozó kihagyás-jelölője sztringként került egy szám-tömbbe, és egy akadálymentesítési észrevétel). Mind javítva; az újraszkennelés igazolta a három zöld gate-et, a teljes teszt-suite regresszió nélkül zöld maradt.

Megjegyzés a lefedettséghez: a SonarQube a teljes forrásfára méri a lefedettséget (frontend 77,3%), az űrlap-/megjelenítés-nehéz nézetekkel együtt; ez nem azonos a Vitest célzott hatókörén mért értékkel, hanem annak tágabb, teljes-fa vetülete. A backend Sonar-lefedettsége 91,2%, összhangban a Jest-értékekkel.

5. Szerepkörök és funkciók számossága

A rendszer funkcionális felülete és biztonsági modellje jól mérhető. A jogosultsági granularitás a figyelemre méltó: 134 diszkrét jog és 340 szerepkör–jog összerendelés alkotja az élő hozzáférési mátrixot — ez finomszemcsés, nem pusztán „admin/nem-admin" szintű kontroll. A felmérés-modul 16 joggal (74–89), az egészségügyi vertikum további 15 joggal (90–104), a szezon-statisztika 1 (105), a sportorvosi vizsgálatok 9 joggal (106–114), a táplálkozásnapló 4 (115–118), a napi kérdőív 4 (119–122), legutóbb pedig a wearable-integráció 11 joggal (123–133) és a mért adatok kivezetése 1 joggal (134) bővítette a mátrixot; a menü- és útvonal-láthatóság mostantól általánosan ebből dől el (nincs hardcode-olt szerep→menü leképezés).

A wearable jogkiosztása jól szemlélteti a mátrix finomságát: a Diák csak a saját eszközét és metrikáit látja (erőforrás-szintű szűkítéssel), az Edző a csapata eszközeit kezeli és a GDPR-hozzájárulásokat rögzíti, a Szakorvos/Ápoló kizárólag olvassa a metrikákat, a szinkron-napló és a kézi indítás pedig kizárólag az adminé.

  • 6 szerepkör — admin · user · Diák · Edző · Szakorvos · Ápoló
  • 134 jog (core_rights) az élő adatbázisban
  • 340 permission — szerepkör × jog összerendelés
  • 173 REST végpont 21 route-domainben
  • 71 adatbázistábla (mag + domain)
  • 7 ütemezett feladat (core_cron_jobs)

A 21 funkcionális domain lefedi az auth-ot, felhasználó- és csoportkezelést, szerepköröket, jogosultságokat, rendszerbeállításokat, eseménynaplót, ütemezőt, értesítéseket, valamint a sport- és egészségügyi vertikumot; az oktatási vertikum (tudástár) marad a Tervezett szekcióban.

6. A kommunikáció szintje és minősége

Az együttműködés specifikáció-vezérelt, feladat-szintű delegálás volt — nem sor-szintű diktálás. A 36 munkamenetben 510 valós emberi utasítás 17 394 asszisztensi lépést és 8 837 eszköz-eredményt generált: ~28–34 gépi művelet jutott egy utasításra (becsült). Ez magas autonómiafok mellett szoros felügyeletet jelez: a fejlesztő intencionális szinten irányított (mit és miért), a megvalósítás (hogyan) delegált maradt.

A kommunikáció minőségét a mérvadó artefaktumok emelték: a 23 fejezetes specifikáció, az adatbázisterv és az OpenAPI-kontraktus stabil közös referenciát adott, így a félreértési felület minimális volt. Az irányítás nyelve tömör, domain-pontos, verzió- és spec-hivatkozásokkal operáló magyar szakmai nyelv.

A tudásátadás tartós is volt: a projekt konvenciói (RBAC fail-closed elve, a migráció nélküli, idempotens SQL-patch alapú DB-workflow) explicit, visszakereshető formában rögzültek — így az iterációk között a kontextus nem veszett el, hanem akkumulálódott.

Összegző értékelés

~22 nap, ~66 500 sor, 173 végpont, 71 tábla és 1416 teszt egy termelési igényű, biztonsági-tudatos full-stack rendszert eredményezett, konzisztens architektúrával és mérhető minőségi kapukkal. A biztonsági és minőségi képet a SonarQube statikus elemzés adja: mindhárom rétegben zöld Quality Gate — 0 sebezhetőség / 0 bug / 0 security hotspot / 0 code smell —, végig A biztonsági, megbízhatósági és karbantarthatósági minősítéssel (a scanner minden észrevétele javításra és újraszkenneléssel igazolásra került, viselkedés-őrző refaktorokkal).

A kritikus sikertényező nem a sebesség önmagában, hanem a fegyelmezett előkészítés volt: az előzetes specifikáció, DB-terv és API-kontraktus tette lehetővé, hogy a gépesített kivitelezés alacsony félreértési rátával, iteratív semver-ütemben, folyamatos tesztlefedettséggel haladjon.

Van kérdésed, vagy beszélgetnél a témáról? Írj emailben: info@jonasgergo.hu, vagy keress meg LinkedInen.


Back to the articles

English version

Author: Jónás Gergő | Date: 8 July 2026 | Source: Own developer evaluation

An engineering evaluation of the implementation phase of a sports, education and healthcare administration system. The specification, the database design and the OpenAPI description were already in place; the roughly 22 days below cover only the AI-assisted implementation, from specification to code.

  • Period: 22 days (22 June to 13 July)
  • Collaboration: 36 sessions / 510 human instructions
  • Codebase: ~66,500 lines (without node_modules)
  • Releases: 10 minor releases, plus the survey, healthcare, questionnaire, GDPR and wearable work
  • Tests: 1,416 cases / 100 test files
  • Static analysis: SonarQube · 3 green Quality Gates

1. How the application environment is built

The system is built on a 4-container topology orchestrated by Docker Compose, with strictly layered responsibilities. Persistence, the administration interface, the business logic and the presentation are separated into their own containers; the services communicate only on the internal Docker network, and only the frontend and phpMyAdmin are exposed externally, behind self-signed TLS. In the development phase, a SonarQube code-quality analyser and a standalone test database were added alongside the application topology, behind a separate Compose profile.

  • Presentation (:9000): React 18 + CoreUI, Vite build, an Express-based HTTPS static server, an /api proxy, i18n.
  • Business logic (:4000): Node.js / Express, /api/v1, JSON Web Token (JWT) authentication, a central RBAC middleware, an event log, an IP filter, cron.
  • Persistence (:3306): MariaDB, 71 tables, utf8mb4, SQL-based init seed (no migration framework).
  • DB administration (:8080): phpMyAdmin over HTTPS, Apache SSL, operator access to the schema and the data.

The backend follows a clean layering: 21 route domains → repository → data layer (the sport domain split into submodules; 34 route files in total), with the cross-cutting concerns (authentication, authorisation, logging, IP filtering) lifted into middleware. Architecturally, access control is the backbone of the system: a central accessControl decision point with fail-closed logic that evaluates every /api/v1/* call against the core_rights / core_permissions matrix, with the roles carried in the JWT. The frontend uses a React context layer (auth / language / application settings / student state) and a set of reusable hooks and components. The codebase is about 66,500 lines (js/jsx/sql), and its structure follows the 23-chapter specification, which served as the authoritative source.

2. The main steps carried out

The work proceeded at an iterative pace disciplined by semantic versioning (semver): the core is 10 minor releases, each documented item by item in CHANGELOG.md; at the end of the phase the survey module, the static analysis and the whole healthcare vertical were still in an untagged ([Unreleased]) state. The work ranged from the platform foundations through the vertical business modules to quality assurance, static code analysis, the fine-tuning of permissions and the full build-out of the healthcare module.

  • 1.0 - Platform: a 4-container environment, TLS, healthchecks, a complete OpenAPI/Swagger description (v3.0.3) as the API contract.
  • 1.1-1.2 - Core: JWT authentication (login, password change, password reset), user and group management, GDPR anonymisation, system settings, a complete event-log middleware, the introduction of the RBAC rights matrix.
  • 1.3-1.4 - Administration: scheduled tasks with run history, SMTP configuration, a dummy data set for endpoint testing.
  • Test infrastructure: setting up a Jest-based backend test infrastructure and retroactively writing tests for the existing code, with reporting.
  • 1.5-1.9 - Sport module: training sessions and their evaluation, matches, match and player statistics, survey templates, with the domain logic and its tests expanded in parallel.
  • Consolidation: a notification system, an event log with record IDs, a Vitest-based frontend test suite with coverage measurement, and finally the full RBAC: data-level scoping (a student sees only their own training sessions and matches) and a role selector.
  • Static analysis: the source code of the backend, the frontend and the database analysed as three separate SonarQube projects, with the Jest/Vitest coverage imported; fixing the issues reported by the scanner.
  • Survey module: full CRUD of the survey items, templates and surveys, plus their evaluation (with min/max/average statistics), with ownership-based filtering; a daily deadline-monitoring scheduled task with email and in-app notifications.
  • Healthcare vertical: two new roles (Specialist doctor, Nurse); Health records (specification section 5.6.1); full CRUD of Outpatient sheets (5.6.5) with soft deletion, PDF/JPG/PNG attachments, a diagnosis derived from the ICD code, and email notification to parents; an Injury log (5.6.4) with rights specific to each HTTP method (101-104); system-level handling of the student's sports-medical status (write-through + a midnight cron, a status icon).
  • Sport supplement: Season statistics (5.5.4): one aggregated, handball-specific report per season, read-only; a new GET /sport/seasons/:id/statistics endpoint (right 105).
  • Healthcare supplement: Sports-medical examination questionnaires (5.6.3): full CRUD of the roughly 50-question statutory form on a flexible item/value data model, with a snapshot of the questions taken at the time of recording; plus an admin-only catalogue manager (rights 106-114). 30 sample questionnaires in the live database.
  • Questionnaire modules: the Nutrition diary (5.6.6, rights 115-118) and the Daily questionnaire (5.3.6, rights 119-122): two generic, form-based modules sharing a common structure and six question types; the daily questionnaire with a soft entry gate. 40+40 backfilled sample records in the live database.
  • Quality consolidation: all SonarQube findings resolved (cognitive complexity, nested ternary and template expressions, the deprecated document.write, regular-expression denial-of-service (ReDoS) hotspots) through behaviour-preserving refactorings, so that all three projects now have a green Quality Gate.
  • Maintenance & UX: rights-based (not hard-coded) menu and route visibility; a per-run isolated test database; an expansion of the ICD reference data.
  • Security hardening & architecture refactoring: rate limiting on the login endpoint; rotating JWT refresh tokens in an httpOnly cookie (access token 24h→1h, a new core_refresh_tokens table); protection against account enumeration; internal TLS verification; removal of the redundant per-route auth middleware (a single central accessControl); the roughly 2,850-line sport.js split into domain submodules with the API unchanged, bit for bit.
  • GDPR data-protection package: a sample data processing agreement (GDPR Article 28), a data protection impact assessment (DPIA) guide, an Article 30 record of processing activities, a privacy notice template (Articles 13-14), a responsibility matrix and an itemised list of the known data-protection shortcomings of the system.
  • Wearable integration, stage 1: a smartwatch or heart-rate strap can be paired with students (Garmin · Polar · Whoop · Fitbit), with physiological and load metrics at daily granularity. This stage delivers the data model (4 new tables, a "one student = one vendor" UNIQUE index on a generated column), the permissions, GDPR consent handling, the full user interface and the interface contract for the vendor integration; the tokens are stored encrypted with AES-256-GCM. The actual OAuth2 connection comes in stage 2.
  • Measured data on the existing screens: the key of the wearable data is the (student, day) pair, so it can be shown on every screen with the same key, most powerful when paired with the daily questionnaire, which puts subjective and objective data side by side (for example a self-reported 10 hours of sleep vs. a measured 7 h 23 min).
  • Fixing inherited bugs: the phase also surfaced and resolved three pre-existing bugs unrelated to the new work: init schema scripts that could not run, an unreadable document-expiry notification, and a pager that rendered every page number and stretched the layout (it now shows a window of page numbers).

Methodological note: testing was never an afterthought. After the test infrastructure was set up, every new business module arrived together with its tests, and coverage is protected by regression thresholds. At the end of the phase this was complemented by static code analysis (SonarQube): a review that does not depend on running the code, focused on security and maintainability.

3. Test coverage

A two-level, automated test pyramid was built: Jest for the backend, Vitest + Testing Library + MSW for the frontend. In total there are 1,416 test cases in 100 test files: the wearable phase added 149 cases (backend +136, frontend +13), raising the total from 1,267 to 1,416 while the coverage thresholds held with no regression; backend branch coverage improved from 84.4% to 87.0%. Frontend coverage is deliberately measured only on the layer that can meaningfully be unit-tested (utils / hooks / context / api / shared components + selected views), leaving out the e2e-style, form-heavy pages.

LayerStatementsBranchesFunctionsLines
Backend · Jest (1,130 cases / 52 files)94.9%87.0%97.5%96.0%
Frontend · Vitest (286 cases / 48 files)97.9%87.2%85.5%97.9%

The weaker (~87%) branch figure in both layers is the usual, expected pattern: rare error paths and defensive conditionals go uncovered. By contrast, the decision logic and the statement and line coverage (95-98%) are strong.

A candid note: in full backend runs, roughly every other run has exactly one failing test, a different one each time, and it always passes when re-run in isolation. This is the project's known flakiness under load (even with a per-worker isolated test database); the 5 new backend test files increased the parallel load, which may have made it more frequent. The code is fine, but this noise reduces the reliability of the test runs.

4. Static analysis and security: SonarQube

In the development phase the project received the SonarQube (Community Build) static code analyser, as a standalone container, with a scanner that can be run on demand. The source code is analysed as three separate projects: backend (Node/Express, with Jest coverage), frontend (a React SPA, with Vitest coverage) and db (MariaDB init scripts), so that the security, reliability and maintainability metrics can be followed separately by layer.

ProjectVulnerabilitiesHotspotBugCode smellS/R/MGate
backend0000A/A/AOK
frontend0000A/A/AOK
db0000A/A/AOK

S/R/M = Security / Reliability / Maintainability rating · rescan: 2026-07-13 (after the wearable integration and the display of the measured data on the existing screens) · coverage: backend 91.2% · frontend 77.3% · duplication: backend 9.5% · frontend 8.7%

Closing the loop. The static analysis here was not only a measurement but also feedback: in the earlier analysis a few maintainability findings were open (cognitive complexity, nested ternary/template, a deprecated API) and two security hotspots flagged "super-linear backtracking → DoS?" on the same reporter email regex. A targeted consolidation round resolved all of these: the complex validations were broken down into small, descriptively named helper functions, the regex was replaced by a linear, index-based email check, and document.write was replaced by a Blob URL. The same happened again with the two new questionnaire modules (20 new code smells → a behaviour-preserving refactoring), with the security-hardening round (4 code smells) and with the wearable module (8 new findings, among them a BUG, where the pager's ellipsis marker had been put into a numeric array as a string, and one accessibility finding). All were fixed; the re-scan confirmed the three green gates, and the whole test suite stayed green with no regressions.

A note on coverage: SonarQube measures coverage on the whole source tree (frontend 77.3%), including the form-heavy and presentation-heavy views; this is not the same as the value measured on the targeted scope of Vitest, but the same measure taken over a wider scope, the whole source tree. The Sonar coverage of the backend is 91.2%, in line with the Jest values.

5. Roles and functions by the numbers

The system's functional surface and security model are easy to quantify. What stands out is the granularity of permissions: 134 discrete rights and 340 role-right assignments make up the live access matrix, which is fine-grained control, not just an "admin / non-admin" split. The survey module extended the matrix with 16 rights (74-89), the healthcare vertical with a further 15 (90-104), the season statistics with 1 (105), the sports-medical examinations with 9 (106-114), the nutrition diary with 4 (115-118), the daily questionnaire with 4 (119-122), and most recently the wearable integration with 11 rights (123-133) and the display of the measured data with 1 right (134); menu and route visibility is now generally decided from this (there is no hard-coded role-to-menu mapping).

The wearable permissions illustrate the fine granularity of the matrix well: the Student sees only their own device and metrics (with resource-level restriction), the Coach manages the devices of their team and records the GDPR consents, the Specialist doctor and the Nurse have read-only access to the metrics, and the sync log and the manual trigger are restricted to the admin.

  • 6 roles: admin · user · Student · Coach · Specialist doctor · Nurse
  • 134 rights (core_rights) in the live database
  • 340 permissions: role × right assignments
  • 173 REST endpoints in 21 route domains
  • 71 database tables (core + domain)
  • 7 scheduled tasks (core_cron_jobs)

The 21 functional domains cover auth, user and group management, roles, permissions, system settings, the event log, the scheduler, notifications, and the sport and healthcare verticals; the education vertical (the knowledge base) remains in the Planned section.

6. The level and quality of communication

The collaboration took the form of specification-driven, task-level delegation, not line-level dictation. Across the 36 sessions, 510 genuine human instructions generated 17,394 assistant steps and 8,837 tool results: roughly 28 to 34 machine operations per instruction (estimated). This points to a high degree of autonomy combined with close supervision: the developer steered at the level of intent (what and why), while the implementation (how) stayed delegated.

The quality of the communication rested on the reference artefacts: the 23-chapter specification, the database design and the OpenAPI contract gave a stable common reference, so there was very little room for misunderstanding. The language used to steer the work was concise, domain-precise Hungarian that relies on version and specification references.

Knowledge transfer was durable too: the project's conventions (the RBAC fail-closed principle, the DB workflow based on idempotent SQL patches without migrations) were recorded in an explicit, searchable form, so between iterations the context was not lost but accumulated.

Overall assessment

About 22 days, about 66,500 lines, 173 endpoints, 71 tables and 1,416 tests resulted in a production-grade, security-conscious full-stack system, with a consistent architecture and measurable quality gates. The security and quality picture is given by the SonarQube static analysis: a green Quality Gate in all three layers, with 0 vulnerabilities / 0 bugs / 0 security hotspots / 0 code smells, and an A security, reliability and maintainability rating throughout (every finding of the scanner was fixed and confirmed by a rescan, with behaviour-preserving refactorings).

The key success factor was not speed in itself but disciplined preparation: the prior specification, DB design and API contract made it possible for the AI-driven implementation to proceed with few misunderstandings, in iterative semver steps, with tests written continuously alongside.

Do you have a question, or would you like to talk about the topic? Write to me by email: info@jonasgergo.hu, or find me on LinkedIn.