Update system name and references from TeaBoy to Tx

Replaces all user-facing instances of "TeaBoy" with "Tx" across the application, including titles, locale files, database settings, seed data, and API documentation. Also updates internal storage keys and session secrets to remove the old branding.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 07b19cb0-11b5-4be9-8932-ae4820eb73b8
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/HxTkDPZ
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
riyadhafraa
2026-04-22 10:26:53 +00:00
parent 6dd927350d
commit 1f23e65c0b
18 changed files with 57 additions and 43 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ export const sessionMiddleware = session({
if (process.env.NODE_ENV === "production") { if (process.env.NODE_ENV === "production") {
throw new Error("SESSION_SECRET must be set in production"); throw new Error("SESSION_SECRET must be set in production");
} }
return "teaboy-dev-secret-change-before-deploy"; return "tx-dev-secret-change-before-deploy";
})(), })(),
resave: false, resave: false,
saveUninitialized: false, saveUninitialized: false,
@@ -114,7 +114,7 @@ test("GET /api/groups requires admin (regular user gets 403)", async () => {
assert.equal(res.status, 403); assert.equal(res.status, 403);
}); });
test("admin lists default seed groups including Admins, TeaBoy, Everyone", async () => { test("admin lists default seed groups including Admins, Tx, Everyone", async () => {
const res = await fetch(`${API_BASE}/api/groups`, { const res = await fetch(`${API_BASE}/api/groups`, {
headers: { Cookie: adminCookie }, headers: { Cookie: adminCookie },
}); });
@@ -122,7 +122,7 @@ test("admin lists default seed groups including Admins, TeaBoy, Everyone", async
const list = await res.json(); const list = await res.json();
const names = new Set(list.map((g) => g.name)); const names = new Set(list.map((g) => g.name));
assert.ok(names.has("Admins")); assert.ok(names.has("Admins"));
assert.ok(names.has("TeaBoy")); assert.ok(names.has("Tx"));
assert.ok(names.has("Everyone")); assert.ok(names.has("Everyone"));
}); });
+1 -1
View File
@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1" />
<title>TeaBoy OS</title> <title>Tx OS</title>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+10 -10
View File
@@ -339,8 +339,8 @@ export function AnalogClockWidget({
); );
} }
const HOME_CLOCK_STORAGE_KEY = "teaboy:home-clock-visible"; const HOME_CLOCK_STORAGE_KEY = "tx:home-clock-visible";
const HOME_CLOCK_EVENT = "teaboy:home-clock-changed"; const HOME_CLOCK_EVENT = "tx:home-clock-changed";
function readHomeClockVisible(): boolean { function readHomeClockVisible(): boolean {
if (typeof window === "undefined") return true; if (typeof window === "undefined") return true;
@@ -384,8 +384,8 @@ export function useHomeClockVisibility(): [boolean, (next: boolean) => void] {
return [visible, setVisible]; return [visible, setVisible];
} }
const TOPBAR_CLOCK_STORAGE_KEY = "teaboy:topbar-clock-visible"; const TOPBAR_CLOCK_STORAGE_KEY = "tx:topbar-clock-visible";
const TOPBAR_CLOCK_EVENT = "teaboy:topbar-clock-changed"; const TOPBAR_CLOCK_EVENT = "tx:topbar-clock-changed";
function readTopbarClockVisible(): boolean { function readTopbarClockVisible(): boolean {
if (typeof window === "undefined") return true; if (typeof window === "undefined") return true;
@@ -428,13 +428,13 @@ export function useTopbarClockVisibility(): [boolean, (next: boolean) => void] {
return [visible, setVisible]; return [visible, setVisible];
} }
const HOME_CLOCK_SIZE_EVENT = "teaboy:home-clock-size-changed"; const HOME_CLOCK_SIZE_EVENT = "tx:home-clock-size-changed";
export type HomeClockSize = "compact" | "large"; export type HomeClockSize = "compact" | "large";
function homeClockSizeKey(userId: number | string | null | undefined): string { function homeClockSizeKey(userId: number | string | null | undefined): string {
return userId == null return userId == null
? "teaboy:home-clock-size" ? "tx:home-clock-size"
: `teaboy:home-clock-size:${userId}`; : `tx:home-clock-size:${userId}`;
} }
function readHomeClockSize(userId: number | string | null | undefined): HomeClockSize { function readHomeClockSize(userId: number | string | null | undefined): HomeClockSize {
@@ -473,12 +473,12 @@ export function useHomeClockSize(
return [size, setSize]; return [size, setSize];
} }
const HOME_CLOCK_POS_EVENT = "teaboy:home-clock-pos-changed"; const HOME_CLOCK_POS_EVENT = "tx:home-clock-pos-changed";
function homeClockPosKey(userId: number | string | null | undefined): string { function homeClockPosKey(userId: number | string | null | undefined): string {
return userId == null return userId == null
? "teaboy:home-clock-position" ? "tx:home-clock-position"
: `teaboy:home-clock-position:${userId}`; : `tx:home-clock-position:${userId}`;
} }
function readHomeClockPosition(userId: number | string | null | undefined): number { function readHomeClockPosition(userId: number | string | null | undefined): number {
@@ -11,7 +11,7 @@ export function useAppName() {
const { i18n } = useTranslation(); const { i18n } = useTranslation();
const { data } = useAppSettings(); const { data } = useAppSettings();
const isAr = i18n.language === "ar"; const isAr = i18n.language === "ar";
const fallback = isAr ? "نظام TeaBoy" : "TeaBoy OS"; const fallback = isAr ? "نظام Tx" : "Tx OS";
const name = data ? (isAr ? data.siteNameAr : data.siteNameEn) : fallback; const name = data ? (isAr ? data.siteNameAr : data.siteNameEn) : fallback;
useEffect(() => { useEffect(() => {
if (typeof document !== "undefined" && data) { if (typeof document !== "undefined" && data) {
+2 -2
View File
@@ -4,7 +4,7 @@ import ar from './locales/ar.json';
import en from './locales/en.json'; import en from './locales/en.json';
// Initialize i18next // Initialize i18next
const savedLanguage = localStorage.getItem('teaboy-lang') || 'ar'; const savedLanguage = localStorage.getItem('tx-lang') || 'ar';
i18n i18n
.use(initReactI18next) .use(initReactI18next)
@@ -26,7 +26,7 @@ document.documentElement.lang = savedLanguage;
i18n.on('languageChanged', (lng) => { i18n.on('languageChanged', (lng) => {
document.documentElement.dir = lng === 'ar' ? 'rtl' : 'ltr'; document.documentElement.dir = lng === 'ar' ? 'rtl' : 'ltr';
document.documentElement.lang = lng; document.documentElement.lang = lng;
localStorage.setItem('teaboy-lang', lng); localStorage.setItem('tx-lang', lng);
}); });
export default i18n; export default i18n;
+1 -1
View File
@@ -488,7 +488,7 @@
"error": "حدث خطأ", "error": "حدث خطأ",
"success": "تمت العملية بنجاح", "success": "تمت العملية بنجاح",
"language": "English", "language": "English",
"appName": "نظام TeaBoy" "appName": "نظام Tx"
}, },
"notes": { "notes": {
"title": "الملاحظات", "title": "الملاحظات",
+1 -1
View File
@@ -485,7 +485,7 @@
"error": "An error occurred", "error": "An error occurred",
"success": "Success", "success": "Success",
"language": "العربية", "language": "العربية",
"appName": "TeaBoy OS" "appName": "Tx OS"
}, },
"notes": { "notes": {
"title": "Notes", "title": "Notes",
+1 -1
View File
@@ -253,7 +253,7 @@ export default function ChatPage() {
// arrive in the conversation before the user next opens chat. // arrive in the conversation before the user next opens chat.
useEffect(() => { useEffect(() => {
if (!user || !conversations) return; if (!user || !conversations) return;
const ackKey = `teaboy:admin-known:${user.id}`; const ackKey = `tx:admin-known:${user.id}`;
let ack: number[] = []; let ack: number[] = [];
try { try {
ack = JSON.parse(localStorage.getItem(ackKey) ?? "[]"); ack = JSON.parse(localStorage.getItem(ackKey) ?? "[]");
@@ -1,7 +1,7 @@
// UI test verifying that the home-page clock widget keeps its grid position // UI test verifying that the home-page clock widget keeps its grid position
// and compact/large size after a full page reload, and that the changes are // and compact/large size after a full page reload, and that the changes are
// persisted to localStorage under the documented keys // persisted to localStorage under the documented keys
// `teaboy:home-clock-position` / `teaboy:home-clock-size` (or their per-user // `tx:home-clock-position` / `tx:home-clock-size` (or their per-user
// variants once a user is logged in). // variants once a user is logged in).
// //
// This is the recurring automated counterpart to the manual e2e check // This is the recurring automated counterpart to the manual e2e check
@@ -95,9 +95,9 @@ async function readClockStorage(page, userId) {
return page.evaluate((uid) => { return page.evaluate((uid) => {
return { return {
position: window.localStorage.getItem( position: window.localStorage.getItem(
`teaboy:home-clock-position:${uid}`, `tx:home-clock-position:${uid}`,
), ),
size: window.localStorage.getItem(`teaboy:home-clock-size:${uid}`), size: window.localStorage.getItem(`tx:home-clock-size:${uid}`),
}; };
}, userId); }, userId);
} }
@@ -2,7 +2,7 @@
* Generated by orval v8.5.3 🍺 * Generated by orval v8.5.3 🍺
* Do not edit manually. * Do not edit manually.
* Api * Api
* TeaBoy OS API specification * Tx OS API specification
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
export interface HealthStatus { export interface HealthStatus {
+1 -1
View File
@@ -2,7 +2,7 @@
* Generated by orval v8.5.3 🍺 * Generated by orval v8.5.3 🍺
* Do not edit manually. * Do not edit manually.
* Api * Api
* TeaBoy OS API specification * Tx OS API specification
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import { useMutation, useQuery } from "@tanstack/react-query"; import { useMutation, useQuery } from "@tanstack/react-query";
+1 -1
View File
@@ -3,7 +3,7 @@ info:
# Do not change the title, if the title changes, the import paths will be broken # Do not change the title, if the title changes, the import paths will be broken
title: Api title: Api
version: 0.1.0 version: 0.1.0
description: TeaBoy OS API specification description: Tx OS API specification
servers: servers:
- url: /api - url: /api
description: Base API path description: Base API path
+1 -1
View File
@@ -2,7 +2,7 @@
* Generated by orval v8.5.3 🍺 * Generated by orval v8.5.3 🍺
* Do not edit manually. * Do not edit manually.
* Api * Api
* TeaBoy OS API specification * Tx OS API specification
* OpenAPI spec version: 0.1.0 * OpenAPI spec version: 0.1.0
*/ */
import * as zod from "zod"; import * as zod from "zod";
+2 -2
View File
@@ -4,8 +4,8 @@ import { z } from "zod/v4";
export const appSettingsTable = pgTable("app_settings", { export const appSettingsTable = pgTable("app_settings", {
id: integer("id").primaryKey().default(1), id: integer("id").primaryKey().default(1),
siteNameAr: varchar("site_name_ar", { length: 200 }).notNull().default("نظام TeaBoy"), siteNameAr: varchar("site_name_ar", { length: 200 }).notNull().default("نظام Tx"),
siteNameEn: varchar("site_name_en", { length: 200 }).notNull().default("TeaBoy OS"), siteNameEn: varchar("site_name_en", { length: 200 }).notNull().default("Tx OS"),
registrationOpen: boolean("registration_open").notNull().default(true), registrationOpen: boolean("registration_open").notNull().default(true),
footerTextAr: varchar("footer_text_ar", { length: 300 }).notNull().default("جميع الحقوق محفوظة."), footerTextAr: varchar("footer_text_ar", { length: 300 }).notNull().default("جميع الحقوق محفوظة."),
footerTextEn: varchar("footer_text_en", { length: 300 }).notNull().default("All rights reserved."), footerTextEn: varchar("footer_text_en", { length: 300 }).notNull().default("All rights reserved."),
+4 -2
View File
@@ -1,8 +1,8 @@
# TeaBoy OS # Tx OS
## Overview ## Overview
**TeaBoy OS** — a bilingual (Arabic/English, RTL/LTR) full-stack internal web platform styled as an OS-like interface with glassmorphism aesthetics. Built as a pnpm monorepo. **Tx OS** — a bilingual (Arabic/English, RTL/LTR) full-stack internal web platform styled as an OS-like interface with glassmorphism aesthetics. Built as a pnpm monorepo.
## Architecture ## Architecture
@@ -11,6 +11,7 @@
├── artifacts/ ├── artifacts/
│ ├── api-server/ Express 5 backend (port 8080) │ ├── api-server/ Express 5 backend (port 8080)
│ └── teaboy-os/ React + Vite frontend (path: /, port dynamic) │ └── teaboy-os/ React + Vite frontend (path: /, port dynamic)
│ (legacy folder name; product brand is "Tx OS")
├── lib/ ├── lib/
│ ├── db/ Drizzle ORM + PostgreSQL schema │ ├── db/ Drizzle ORM + PostgreSQL schema
│ ├── api-spec/ OpenAPI spec + Orval codegen │ ├── api-spec/ OpenAPI spec + Orval codegen
@@ -66,3 +67,4 @@
- Socket.IO server path: `/api/socket.io` - Socket.IO server path: `/api/socket.io`
- Frontend connects to Socket.IO via same-origin proxy (no separate URL needed) - Frontend connects to Socket.IO via same-origin proxy (no separate URL needed)
- i18n locale files: `artifacts/teaboy-os/src/locales/ar.json` and `en.json` - i18n locale files: `artifacts/teaboy-os/src/locales/ar.json` and `en.json`
- Default receivers group is named **Tx** (was renamed from a legacy "TeaBoy"); a one-time migration in the seed script renames any pre-existing legacy group on next run.
+1 -1
View File
@@ -3,6 +3,6 @@ set -e
pnpm install --frozen-lockfile pnpm install --frozen-lockfile
pnpm --filter db run push-force pnpm --filter db run push-force
# Idempotent: ensure the default groups exist and existing users are mapped # Idempotent: ensure the default groups exist and existing users are mapped
# (Admins, TeaBoy, Everyone). Safe to run repeatedly. # (Admins, Tx, Everyone). Safe to run repeatedly.
pnpm --filter scripts run seed pnpm --filter scripts run seed
pnpm --filter @workspace/teaboy-os exec playwright install chromium pnpm --filter @workspace/teaboy-os exec playwright install chromium
+23 -11
View File
@@ -102,7 +102,7 @@ async function main() {
.insert(usersTable) .insert(usersTable)
.values({ .values({
username: "admin", username: "admin",
email: "admin@teaboy.local", email: "admin@tx.local",
passwordHash: adminHash, passwordHash: adminHash,
displayNameAr: "مدير النظام", displayNameAr: "مدير النظام",
displayNameEn: "System Admin", displayNameEn: "System Admin",
@@ -118,7 +118,7 @@ async function main() {
.insert(usersTable) .insert(usersTable)
.values({ .values({
username: "ahmed", username: "ahmed",
email: "ahmed@teaboy.local", email: "ahmed@tx.local",
passwordHash: userHash, passwordHash: userHash,
displayNameAr: "أحمد محمد", displayNameAr: "أحمد محمد",
displayNameEn: "Ahmed Mohammed", displayNameEn: "Ahmed Mohammed",
@@ -369,7 +369,7 @@ async function main() {
isSystem: 1, isSystem: 1,
}, },
{ {
name: "TeaBoy", name: "Tx",
descriptionAr: "فريق إعداد وتقديم الطلبات", descriptionAr: "فريق إعداد وتقديم الطلبات",
descriptionEn: "Team that prepares and delivers orders", descriptionEn: "Team that prepares and delivers orders",
isSystem: 1, isSystem: 1,
@@ -383,9 +383,21 @@ async function main() {
]) ])
.onConflictDoNothing(); .onConflictDoNothing();
// One-time migration: rename legacy "TeaBoy" group to "Tx" if it still exists
// and the new "Tx" group hasn't been created yet.
const existingGroups = await db.select().from(groupsTable);
const legacy = existingGroups.find((g) => g.name === "TeaBoy");
const newOne = existingGroups.find((g) => g.name === "Tx");
if (legacy && !newOne) {
await db
.update(groupsTable)
.set({ name: "Tx" })
.where(eq(groupsTable.id, legacy.id));
}
const allGroups = await db.select().from(groupsTable); const allGroups = await db.select().from(groupsTable);
const adminsGroup = allGroups.find((g) => g.name === "Admins"); const adminsGroup = allGroups.find((g) => g.name === "Admins");
const teaboyGroup = allGroups.find((g) => g.name === "TeaBoy"); const txGroup = allGroups.find((g) => g.name === "Tx");
const everyoneGroup = allGroups.find((g) => g.name === "Everyone"); const everyoneGroup = allGroups.find((g) => g.name === "Everyone");
const allRolesNow = await db.select().from(rolesTable); const allRolesNow = await db.select().from(rolesTable);
@@ -399,10 +411,10 @@ async function main() {
.values({ groupId: adminsGroup.id, roleId: adminRoleNow.id }) .values({ groupId: adminsGroup.id, roleId: adminRoleNow.id })
.onConflictDoNothing(); .onConflictDoNothing();
} }
if (teaboyGroup && orderReceiverNow) { if (txGroup && orderReceiverNow) {
await db await db
.insert(groupRolesTable) .insert(groupRolesTable)
.values({ groupId: teaboyGroup.id, roleId: orderReceiverNow.id }) .values({ groupId: txGroup.id, roleId: orderReceiverNow.id })
.onConflictDoNothing(); .onConflictDoNothing();
} }
@@ -414,13 +426,13 @@ async function main() {
.values(allAppsNow.map((a) => ({ groupId: adminsGroup.id, appId: a.id }))) .values(allAppsNow.map((a) => ({ groupId: adminsGroup.id, appId: a.id })))
.onConflictDoNothing(); .onConflictDoNothing();
} }
// TeaBoy gets the services app (which is where receivers see incoming orders) // The Tx receivers group gets the services app (where receivers see incoming orders)
if (teaboyGroup) { if (txGroup) {
const servicesApp = allAppsNow.find((a) => a.slug === "services"); const servicesApp = allAppsNow.find((a) => a.slug === "services");
if (servicesApp) { if (servicesApp) {
await db await db
.insert(groupAppsTable) .insert(groupAppsTable)
.values({ groupId: teaboyGroup.id, appId: servicesApp.id }) .values({ groupId: txGroup.id, appId: servicesApp.id })
.onConflictDoNothing(); .onConflictDoNothing();
} }
} }
@@ -447,7 +459,7 @@ async function main() {
} }
} }
if (teaboyGroup && orderReceiverNow) { if (txGroup && orderReceiverNow) {
const receiverRows = await db const receiverRows = await db
.select({ userId: userRolesTable.userId }) .select({ userId: userRolesTable.userId })
.from(userRolesTable) .from(userRolesTable)
@@ -455,7 +467,7 @@ async function main() {
if (receiverRows.length > 0) { if (receiverRows.length > 0) {
await db await db
.insert(userGroupsTable) .insert(userGroupsTable)
.values(receiverRows.map((r) => ({ userId: r.userId, groupId: teaboyGroup.id }))) .values(receiverRows.map((r) => ({ userId: r.userId, groupId: txGroup.id })))
.onConflictDoNothing(); .onConflictDoNothing();
} }
} }