ShiftCircle

ShiftCircle documentation

ShiftCircle is a shift-scheduling prototype for a fictional 24/7 correctional centre. It is built with a configurable rules engine, a whole-quarter planner, time and attendance, and a simulated payroll export.

All data is synthetic, and sign-in and payroll are simulated.

This page is plain Markdown with relative links. It reads on GitHub as it is. It also works on GitHub Pages with no build step, provided Pages serves the repository root, because some links point up to files beside docs/. The site then starts at /docs/.

Architecture at a glance

Three containers on one Docker network. Only the web is published to the host, on 127.0.0.1. Every change a person makes goes through the rules engine before it is saved.

flowchart LR
    B["Browser<br/>desktop · tablet · TV<br/>mock sign-in"] -->|"http://localhost:8080<br/>(127.0.0.1 only)"| W
    subgraph net["Docker Compose network"]
        W["web<br/>nginx + React SPA"]
        subgraph A["api · Java 21 + Spring Boot 4"]
            C["REST controllers<br/>/api/v1<br/>role and unit-scope checks"]
            S["Services<br/>schedule · overtime · time and payroll<br/>reports · quarter planner"]
            R["Drools rules engine<br/>editable decision tables<br/>+ Java fact builders"]
            C --> S
            S -->|"every change is<br/>checked first"| R
        end
        D[("db<br/>PostgreSQL 17<br/>Flyway V1-V13")]
        W -->|"/api/* proxy"| C
        S -->|JDBC| D
        R -.->|"published rule rows"| D
    end
    S --> P["Payroll CSV<br/>(simulated, a download)"]

How one change flows: the supervisor proposes an assignment → the API previews it through the rules engine → a Block refuses it (or asks for an emergency override with a written reason where the policy allows one), a Warn needs an acknowledgement, a Pass saves → the change is written with an append-only audit event. Rule changes go through a second person (maker/checker) and are published without a code change. The detail is in Architecture, Rules engine and Deployment.

Documentation map

Which document answers which question an assessor is likely to ask:

If you want to know… Read
How to run it, and what each setting does INSTALL.md, then Deployment
What it does, screen by role User guide and the five role pages in user-guide/
A five-minute tour of the main flows Demo script
What problem it solves, and what was left out Scope and plan; what is deliberately not built is in Testing §8
What each requirement is, and which test proves it Requirements → Traceability (requirement → code → test)
How the rules work, and where the numbers come from Rules engine, Union rules (many values are marked MOCK)
How the system is built and why Architecture, Data model, API, Decisions
Who may do what, and how it is enforced Access control
How it was tested, and the current test counts Testing (“Current counts”), e2e/COVERAGE.md
How AI was used, and what was checked by whom Build record, AI development log, review rounds
What changed between releases Release notes, Progress
What is real and what is simulated, and the known limits README (“What is real and what is simulated”), Testing §8
The visual design UI specification

Use it

How it works

Doc What’s in it
Scope and plan Problem, users, outcomes, priorities, assumptions
Requirements Screens, functional and non-functional requirements, rules catalogue
Architecture Containers, feature slices, JdbcTemplate persistence, change flow, security
Rules engine Drools decision tables an admin can edit, and the publish pipeline
Union rules The mock collective-agreement rule set, with sources
Data model PostgreSQL tables, constraints, migrations and seed
API REST endpoints, the rule-check and override contract, errors
Deployment Docker Compose topology, configuration, path to pilot
Access control Roles, permission matrix, mock sign-in, privacy
Testing Test layers, rule boundary matrix, scenarios, end-to-end flows
Traceability Each requirement mapped to the code and the test that proves it, with PARTIAL and NOT BUILT marked
Decisions The decision log (ADRs)
UI specification Design tokens, components and every screen

How it was built

Licence

MIT.