Skip to content
StcantPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

HPH

Work, in harmony. A reusable foundation for modular business management software, with a Rust frontend and backend.

HPH is currently a runnable local demo, not a system ready for real company data. The first working slice demonstrates the design, module composition and a server-validated time-tracking workflow.

Stack

Area Choice
Interface Leptos 0.8, server-side rendering and WebAssembly hydration
Server Axum 0.8 + Tokio
Shared rules Independent hph-core crate
Design Responsive CSS with design tokens; sage and indigo themes, no remote fonts
Build cargo-leptos 0.3.11, versioned Cargo.lock
Current persistence PostgreSQL/SQLx infrastructure and repositories; the interface still uses demo memory
Next persistence step Complete authentication and connect SQLx repositories to operational screens

Application code is written in Rust. The browser also uses CSS and the small JavaScript loader generated by wasm-bindgen/Leptos: there is no separate React or TypeScript application to maintain. Node and npm are not required. English is the default language for the interface and repository documentation.

Run locally

Prerequisites: Git and Rust installed through rustup. The rust-toolchain.toml file installs the required WebAssembly target and components.

git clone https://github.com/Stcant/HPH.git
cd HPH
cargo install cargo-leptos --version 0.3.11 --locked
HPH_DEMO=true cargo leptos watch

In PowerShell, first set $env:HPH_DEMO = "true", then run cargo leptos watch.

Open http://127.0.0.1:3000. The demo refuses to start without the explicit HPH_DEMO=true setting or on a non-loopback address. Do not expose it through a proxy, tunnel or public network: authentication is not available yet. PostgreSQL integration is optional and currently limited to connections, migrations and the health check; screens still use in-memory data. See docs/DATABASE.md.

Try the workflow

  1. From the dashboard, select Clock in for the demo profile, Elena Conti.
  2. Open Attendance and select Start break, End break, then Clock out. Events reach the server and remain visible after refreshing the page.
  3. Open Your workspace, enable Reports and inspect the recorded time for closed work intervals. Open intervals are excluded.
  4. Try disabling Time and attendance while Reports is enabled: the server rejects the change because Reports depends on Attendance. Open work sessions also prevent Attendance from being disabled.
  5. Disable Reports, close any open work sessions, then disable Attendance. The menu updates; enabling Attendance again restores access to the session's existing events.

All profiles are fictional. The demo's only actor is a fixed administrator selected by the server, not the browser. Module changes and events are shared between tabs using the same server instance and are lost when the process restarts. Other tabs do not update in real time: use the refresh button.

Customize the template

Edit hph.toml and restart the server:

organization = "Your company"
theme = "sage"       # sage | indigo
preset = "team"      # essential | team | complete
# modules = ["people", "attendance"] # optional: overrides preset

The optional modules setting accepts the IDs people, attendance and reports. Modules must include their dependencies; HPH rejects invalid configurations at startup. When modules is omitted, the preset applies. Initial choices in hph.toml persist across restarts; changes made in the demo interface last only until the server restarts.

Preset Modules
essential People
team People + Time and attendance
complete People + Time and attendance + Reports

Modules are compiled Rust components. Company administrators can enable or disable them in the interface; adding a new feature requires code and a new build. This is not a marketplace of third-party plugins loaded at runtime.

Module configuration belongs to the company: each workspace is composed around its own processes. The demo keeps changes in memory; a PostgreSQL repository for company configuration exists, but it still needs to be connected to authenticated requests.

The foundation can be cloned or forked and customized. Reusable code does not automatically enable GitHub's Template repository setting.

What works today

Feature Status
Responsive dashboard, screens and themes Implemented; browser QA still pending
People directory Read-only demo profiles
Modules and dependencies Configuration enforced and verified on the server
Clock in / start break / end break / clock out Sequence and timestamp validation on the server
Recorded-time summary Closed intervals, excluding breaks, with second-level precision
Roles and company boundaries Tested domain rules; no real authentication yet
PostgreSQL schema, module and membership repositories Tested under RLS in CI; not connected to the screens
Multiple companies and real accounts in the application Not implemented
Leave, shifts, corrections, audit and exports Not implemented
Payroll, accounting and inventory Outside the first version

Events use UTC timestamps displayed as YYYY-MM-DD. Summaries cover the demo session, not a contractual working day. There is no automatic calculation of overtime, accrued leave or payroll.

Verification

cargo fmt --all --check
cargo test --workspace --features ssr --locked
cargo check --target wasm32-unknown-unknown --features hydrate --lib --locked
cargo leptos build

Domain tests cover dependencies, permissions, foreign companies, duplicate clock-ins, reversed timestamps, breaks, disabling modules and data retention. HTTP tests exercise the real server functions through the Axum router and check SSR output. The PostgreSQL CI job applies RLS policies and tests SQLx pools, migrations, tenant context, module configuration and active membership lookup against a real PostgreSQL instance using a restricted runtime role. These are not browser tests and do not establish persistent business operations through the interface.

Structure

  • crates/hph-core/: modules, roles, time-tracking rules, serialized contracts and tests.
  • src/app.rs: Leptos components and screens.
  • src/api.rs: server functions; the client does not supply the acting identity.
  • src/server.rs: demo configuration and state, router and HTTP tests.
  • src/database.rs: SQLx PostgreSQL pool, migrations, health check and tenant-scoped transactions.
  • src/module_repository.rs and src/membership_repository.rs: company module configuration and active membership lookup.
  • style/main.css: layout, tokens, themes and mobile styles.
  • docs/MODULES.md: the module extension contract.
  • AGENTS.md and .dev-brain/STATE.md: project facts for coding agents and the current checkpoint (goal, evidence, next actions).

The next functional increment is authentication and sessions. The SQLx repository can already resolve an active membership for a selected company, but the screens do not use it yet. Until authentication, authorization and application persistence are integrated, HPH remains a local demo and must not host real company data.


🦀 Recruiter side quest: you found the Easter egg

If you made it this far, you probably followed the link on my CV—or took a very productive wrong turn on GitHub. Either way, thanks for looking beyond the bullet points.

I'm Stefano, and I'm building HPH in my spare time to learn Rust. I believe one of the best ways to learn a language is to write code and build something real—working through design decisions, testing ideas and occasionally negotiating with the Rust compiler.

Curious about the choices behind the project? Let's talk. Bonus points if you mention this Easter egg.

Achievement unlocked: actually read the README.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages