ThreadCount Community edition

Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from 8685140 on 2026-09-13. Licensed under the Functional Source License (FSL-1.1-ALv2).
This commit is contained in:
ThreadCount
2026-09-13 11:09:20 +10:00
commit 822c0b7c0b
406 changed files with 47742 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { NextResponse } from "next/server";
import { readFileSync } from "fs";
import path from "path";
import { COMMUNITY } from "@/lib/edition";
export const dynamic = "force-dynamic";
/* What the Android apps ask a server before they will point at it.
*
* The apps open threadcount.tech unless told otherwise; a room running the Community edition types
* its own address into the app's first screen, and the app calls this first. It proves the address
* is a ThreadCount server (not a look-alike, not a typo), says which edition and build, and carries
* the oldest app version this build still works with, so an app can say "update me" instead of
* breaking quietly. Public and unauthenticated on purpose: nothing here is about a facility. */
function version(): string {
try { return readFileSync(path.join(process.cwd(), "COMMUNITY_VERSION"), "utf8").trim(); } catch { /* hosted: no file */ }
return process.env.NEXT_PUBLIC_RELEASE || "hosted";
}
export async function GET() {
return NextResponse.json({
product: "threadcount",
edition: COMMUNITY ? "community" : "hosted",
version: version(),
paths: { counter: "/m", staff: "/my" },
// The oldest Play versionCode of each app this server still serves correctly.
minApp: { counter: 9, staff: 7 },
}, { headers: { "cache-control": "no-store", "access-control-allow-origin": "*" } });
}