@arcforgelabs/flow 0.0.0-stage → 2026.10.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Samuel Rodda
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,46 @@
1
- # Temporary Holding Version
1
+ # Flow
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Flow is invoicing, bill entry and a financial dashboard for labs that make
4
+ work to order, first for dental labs. Seazona (the lab's case system) is a
5
+ bundled integration, and Xero is an optional one. See `VISION.md`.
6
+
7
+ Flow is maintained by Arc Forge Labs at
8
+ [arcforgelabs/flow](https://github.com/arcforgelabs/flow).
9
+
10
+ Licence: MIT (`LICENSE`).
11
+
12
+ ## Status
13
+
14
+ This repository is the new home of Flow, with a new history. Code moves here
15
+ from an earlier private codebase one module at a time (`CONTRIBUTING.md`,
16
+ "Porting from the earlier codebase"). Today it holds the repository's rules,
17
+ CI, the release track (npm, container image and GitHub Release, on a beta and
18
+ a stable channel), the integration port, a health check, Clerk sign-in with
19
+ roles kept in Flow, and the first part of the core: the PostgreSQL data model
20
+ for organisations, contacts, the price list and invoices. It is not ready to
21
+ run a lab.
22
+
23
+ ## Documentation
24
+
25
+ | Document | What it is for |
26
+ | --- | --- |
27
+ | `VISION.md` | What Flow is for, the core and its integrations, and what it will not do |
28
+ | `AGENTS.md` | Agent entry point (`CLAUDE.md` links to it) |
29
+ | `CONTRIBUTING.md` | How to file issues and pull requests, porting rules, merging |
30
+ | `SECURITY.md` | How to report a security problem, the trust model, and the rules held hard |
31
+ | `LICENSE` | MIT licence |
32
+ | `docs/DATA_MODEL.md` | The PostgreSQL records, the rules the database holds, and how to change the schema |
33
+ | `docs/RELEASING.md` | Versions and channels, the release workflows, how to cut and roll back a release, and the one-time setup |
34
+ | `docs/SELF_HOSTING.md` | Running a Flow release with Docker, Node or Replit, the update notice, and Clerk sign-in |
35
+ | `docs/REPLIT.md` | A Replit workspace of this repository that follows a release channel (`FLOW_DEPLOY_REF`) |
36
+ | `server/integrations/port.js` | The integration port every adapter implements |
37
+
38
+ ## Getting started
39
+
40
+ Requirements: Node 24, npm and PostgreSQL 16 or later.
41
+
42
+ ```bash
43
+ npm ci
44
+ FLOW_TEST_DATABASE_URL=postgres://… npm test # a throwaway database
45
+ DATABASE_URL=postgres://… npm start # http://localhost:19300/health
46
+ ```
package/SECURITY.md ADDED
@@ -0,0 +1,61 @@
1
+ # Security Policy
2
+
3
+ Flow handles a lab's invoices, supplier bills, bank details and integration
4
+ credentials, and it can see case references from a dental lab. Treat every
5
+ report about those with care.
6
+
7
+ ## Report a Security Issue
8
+
9
+ Report privately through GitHub's "Report a vulnerability" (Security tab of
10
+ this repository). Never open a public issue for a security problem, and never
11
+ paste a credential, in full or in part.
12
+
13
+ ### What We Need
14
+
15
+ - The affected version or commit, and the route, screen or file.
16
+ - Steps to reproduce, with synthetic data only.
17
+ - What an attacker gains.
18
+
19
+ ## Trust Model
20
+
21
+ - **One installation per lab.** Each installation runs with its own database,
22
+ configuration and secrets. Installations never share data or credentials.
23
+ - **People.** People sign in with Clerk. Flow's PostgreSQL holds each person's
24
+ role (`owner`, `admin` or `staff`) and access. A Clerk account with no Flow
25
+ role gets no access, and an installation is invitation only by default.
26
+ Owner-only actions need a verified owner sign-in (`docs/SELF_HOSTING.md`,
27
+ "Sign-in (Clerk)").
28
+ - **Machine access.** The Flow API uses signed connector keys, never Clerk
29
+ sessions. Keys are read only from request headers and are checked against
30
+ the holder's current access on every use.
31
+ - **Integrations.** Seazona, Xero and every later adapter reach the core only
32
+ through the integration port. Their credentials are stored per
33
+ organisation, encrypted, and are write-only in Settings.
34
+ - **Issued documents are records.** An invoice a customer has been sent is
35
+ never changed in place; a change produces a new version.
36
+
37
+ ## Rules Held Hard
38
+
39
+ - Never commit customer data, patient data, credentials, raw private messages
40
+ or runtime state. Tests and demos use synthetic fixtures. A photo, export or
41
+ screenshot from a real lab is customer data.
42
+ - Never commit a real organisation identifier (a Xero tenant id, a Seazona
43
+ tenant hostname, an ABN or a bank account). They belong in the
44
+ installation's configuration.
45
+ - Secrets live in the installation's secret store (for example Replit
46
+ Secrets), never in the repository, a log, an issue or a pull request. Name
47
+ the variable, never its value.
48
+ - No account has a built-in or fallback password, in any environment.
49
+ - Sign-in, API and integration routes are rate limited.
50
+ - Session cookies are `Secure`, `HttpOnly` and `SameSite`.
51
+ - Flow stores no clinical notes, images or scans, and keeps a patient
52
+ reference only where an invoice must print one.
53
+ - CI runs gitleaks on every push and pull request
54
+ (`.github/workflows/secret-scan.yml`).
55
+
56
+ ## Out of Scope
57
+
58
+ - Vulnerabilities in a third-party service Flow connects to (Clerk, Seazona,
59
+ Xero). Report those to the vendor.
60
+ - Problems that need an attacker who already holds an owner sign-in or the
61
+ installation's secrets.
package/VISION.md ADDED
@@ -0,0 +1,65 @@
1
+ # Flow — Vision
2
+
3
+ Flow is invoicing, bill entry and a financial dashboard for a lab that makes
4
+ work to order, first for dental labs.
5
+
6
+ It is for the person who bills the work and pays the suppliers. Finished feels
7
+ like this: completed cases become invoices they check and send, supplier bills
8
+ go in once and get approved, and one dashboard shows cash, what is owed to the
9
+ lab, what the lab owes, and the GST for the BAS period. Every invoice a
10
+ customer was sent can be found again, exactly as it was sent.
11
+
12
+ Flow is open source so any lab can run its own installation.
13
+
14
+ ## The core and its integrations
15
+
16
+ The core is invoices, bills, payments, contacts, the price list and the
17
+ dashboard. It works with no integration connected.
18
+
19
+ Everything outside the core is an integration behind one contract (the
20
+ integration port):
21
+
22
+ - **Seazona** is the lab's case system. Its adapter is bundled: it ships in
23
+ the package and is on in the dental preset, and an owner can turn it off.
24
+ It turns completed cases into draft invoices through the Seazona API.
25
+ - **Xero** is optional. Its adapter sends issued invoices and approved bills
26
+ to the owner's own Xero organisation and reads payments back.
27
+
28
+ Adding an integration never changes the core.
29
+
30
+ ## Standing decisions
31
+
32
+ ### Why does Flow keep its own records?
33
+
34
+ Flow is the store of record for the invoices and bills it issues. Xero gets a
35
+ copy and owns bank reconciliation. A lab without Xero still has complete,
36
+ correct records.
37
+
38
+ ### Why is a sent invoice never changed?
39
+
40
+ What a customer was sent is a commercial commitment. A change makes a new
41
+ version; the sent one stays as it was, attributed to whoever sent it.
42
+
43
+ ### Why does Flow keep as little patient data as it can?
44
+
45
+ Dental cases carry health information, which Australian privacy law treats as
46
+ sensitive. Flow keeps the case number and the practice. It keeps a patient
47
+ reference only when a practice needs one printed on its invoice, and it keeps
48
+ no clinical notes or images.
49
+
50
+ ### Why does each lab get its own installation?
51
+
52
+ Labs' customers, prices and credentials must never meet. Each installation has
53
+ its own data, configuration and secrets.
54
+
55
+ ## Out of scope
56
+
57
+ - Case management, production tracking and scheduling. The case system owns
58
+ the case.
59
+ - Patient records, clinical notes, scans and images.
60
+ - Acting as the general ledger. Accounting software owns the ledger and the
61
+ bank feed.
62
+ - Browser automation of another product. Integrations use published APIs.
63
+
64
+ This is a guardrail, not a law of physics. Strong evidence can change it;
65
+ record the change in the pull request that edits this file.