Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

BrightWeb Game

一个支持账户系统、实时房间与数据持久化的在线桌游平台。目前提供 UNO、麻将、德州扑克,包含管理后台、BrightWeb 通用账户接入和 macOS / Linux 一键运行脚本。

在线试玩: https://game.brightweb.top

⚠️ 使用与授权声明

Caution

本项目不是开源项目,未授权任何人再分发或公开部署。

官方站点只有 https://game.brightweb.top,其他任何域名上的部署都未经授权。

任何未经授权的修改版、镜像、公开部署或衍生服务,均与本项目及 BrightWeb Dev Team 无关。团队未参与、未授权、也不认可;相关内容及由此产生的全部法律责任,由其制作者、发布者和部署者自行承担。BrightWeb Dev Team 保留就侵犯著作权及其他合法权益的行为追究责任的权利。

源码公开仅供学习交流,权利范围见 LICENSE。

This project is NOT open source. Redistribution and public deployment are not permitted. The only official site is https://game.brightweb.top — any deployment on another domain is unauthorized and unaffiliated with this project or BrightWeb Dev Team, which bears no responsibility for its content. See LICENSE.

功能

  • 统一账户登录、注册、会话管理与 BrightWeb OAuth
  • UNO、麻将、德州扑克实时在线房间
  • 六位房间码与可分享的独立房间地址
  • 刷新重连、断线等待、房主踢人和关闭房间
  • SQLite 持久化用户、资料、牌局、房间历史和平台设置
  • 首次启动向导:创建管理员、设置平台名称、服务地址和 Logo
  • 个人头像、显示名称、登录账户和密码修改
  • 独立 /admin 管理后台
  • 用户封禁、权限提升、用户创建和品牌管理
  • 活跃房间管理及“等待中 / 对局中 / 已关闭 / 游戏结束”状态

一键运行

macOS

双击 一键运行.command,脚本会自动检查环境、安装依赖、构建项目、启动服务器并打开浏览器。

也可以在终端运行:

./scripts/run-local.sh

Linux

支持 x86_64 和 ARM64。环境安装器会从 Node.js 官方源安装项目私有的 Node.js 22,并校验 SHA-256,无需写入系统目录:

chmod +x 一键安装环境.sh
./一键安装环境.sh
./scripts/run-local.sh

如果系统没有可用的 Node.js 22,run-local.sh 会自动调用 Linux 环境安装器。

手动运行

npm install
npm run build
npm start

默认地址:http://localhost:5173

可通过 PORT 环境变量修改端口。

首次启动

空数据库第一次启动时,平台会显示初始化向导,而不是普通登录页。需要设置:

  • 平台名称
  • 对外服务地址
  • 管理员显示名称
  • 管理员登录账户与密码
  • 可选 Logo 图片地址

首位用户会被创建为管理员并自动登录。初始化接口只能成功执行一次。

游戏与房间

游戏 当前玩法 房间能力
UNO 数字牌、功能牌、万能牌 创建、邀请、机器人、实时对局
麻将 摸牌、弃牌、胡牌判定 创建、邀请、机器人、实时对局
德州扑克 公共牌、下注、跟注、弃牌 创建、邀请、机器人、实时对局

创建房间后会生成类似下面的独立地址:

https://你的服务域名/5C7D53

管理员可以在后台查看当前和历史房间。被管理员或房主关闭的房间标记为“已关闭”,正常完成牌局的房间标记为“游戏结束”。

管理后台

管理员登录后可访问:

/admin

后台提供数据总览、用户管理、房间管理、牌局记录和品牌设置。数据总览与房间列表会自动刷新。

也可以通过终端创建或提升管理员:

npm run create-admin -- admin '请替换为高强度密码' 管理员

数据持久化

默认数据库文件为项目目录下的 uno-arena.sqlite。以下内容会写入数据库:

  • 用户、登录会话、管理员权限和封禁状态
  • 头像、显示名称、登录账户和密码哈希
  • 平台名称、Logo、服务域名
  • 房间历史、关闭原因和结束状态
  • 牌局记录、胜场和游戏局数

建议同时备份:

uno-arena.sqlite
uno-arena.sqlite-shm
uno-arena.sqlite-wal

BrightWeb 通用账户

在 BrightWeb 账户服务中注册 OAuth 客户端,并配置回调地址:

https://你的服务域名/api/auth/brightweb/callback

根据 .env.example 创建 .env,填写:

BRIGHTWEB_OAUTH_ISSUER=https://accounts.example.com
BRIGHTWEB_OAUTH_CLIENT_ID=replace_with_client_id
BRIGHTWEB_OAUTH_CLIENT_SECRET=replace_with_client_secret
BRIGHTWEB_OAUTH_REDIRECT_URI=https://你的服务域名/api/auth/brightweb/callback

配置完成后,登录页会自动显示 BrightWeb 通用账户入口。

Docker

docker build -t brightweb-game .
docker run --rm -p 5173:5173 -v brightweb-data:/app/data brightweb-game

Warning

Docker 命令仅用于获得授权的本地运行或私有环境测试,不构成公开部署授权。

技术结构

部分 实现
前端 React、Vite、Lucide Icons
后端 Node.js、Express、WebSocket
数据库 SQLite(node:sqlite)
实时通信 原生 WebSocket + ws
身份验证 本地账户、服务端 Session、BrightWeb OAuth
部署 Node.js、Docker、macOS / Linux 脚本

Issue、Pull Request 与 Discussion

欢迎提交与项目功能直接相关的内容,例如 Bug 反馈、浏览器兼容问题、游戏规则问题、性能优化建议、界面改进和实现细节讨论。提交问题时请尽量附上复现步骤、操作系统、浏览器版本和相关日志。

本仓库 Issue、Pull Request、Discussion 等区域的内容,由各自的发布者提交并对其独立负责。这些内容不代表本项目作者的观点或立场,作者未对其进行事先审查,也不对其真实性、合法性承担责任。

与本项目技术无关的内容——尤其是针对他人或公众人物的评论、影射、人身攻击,以及其他违法违规言论——将被删除或隐藏,必要时锁定议题并封禁相关账号。

Functional issues are welcome: bug reports, browser compatibility problems, game-rule issues, performance suggestions, UI improvements, and implementation questions. Issues, pull requests, and discussions are submitted by their respective authors, who bear sole responsibility for their content; such content does not represent the views of this project's author and is not reviewed in advance. Off-topic content — in particular remarks targeting other individuals or public figures — will be removed.

许可与声明

本项目不是 OSI 意义上的开源项目。 源码公开是为了技术分享,完整条款见 LICENSE:

  • 允许:阅读研究源码、在自己拥有或控制的设备上本地运行、为学习或个人使用而修改。
  • 不授权:再分发原版或修改版,无论是否收费;部署到第三方可访问的位置;对外提供任何形式的服务;任何商业使用;移除或篡改版权及来源声明。
  • 内容限制:不得使用本项目或其修改版制作、传播侵犯他人合法权益或违反适用法律法规的内容;违反者获得的有限许可自动终止。

官方站点只有 https://game.brightweb.top。其他域名上的部署均未经授权,与本项目及 BrightWeb Dev Team 无关。需要超出上述范围的授权,请事先取得 BrightWeb Dev Team 的书面许可。

版权

Powered by ©️2026 BrightWeb Dev Team. All rights reserved.


BrightWeb Game — English

BrightWeb Game is a full-stack online tabletop platform with account authentication, real-time rooms, SQLite persistence, an administrator console, and support for UNO, Mahjong, and Texas Hold'em.

Online demo: https://game.brightweb.top

License Notice

Caution

This project is not open source. Redistribution and public deployment are not authorized.

The only official site is https://game.brightweb.top. Deployments on all other domains are unauthorized.

Unauthorized copies, modifications, deployments, mirrors, and derivative services are not affiliated with this project or BrightWeb Dev Team. Their creators, publishers, and operators are solely responsible for their content and consequences.

The published source is provided for learning and technical exchange only. See LICENSE for the complete terms.

Features

  • Local accounts, sessions, profiles, and BrightWeb OAuth
  • Real-time UNO, Mahjong, and Texas Hold'em rooms
  • Shareable six-character room URLs
  • Refresh reconnection and temporary disconnect recovery
  • Host controls and administrator room management
  • Persistent room history and match records
  • First-run administrator and service setup wizard
  • User, role, ban, branding, and service-domain management
  • Profile avatar, display name, login account, and password editing

Quick Start

On macOS, double-click 一键运行.command, or run:

./scripts/run-local.sh

On Linux x86_64 or ARM64:

chmod +x 一键安装环境.sh
./一键安装环境.sh
./scripts/run-local.sh

Manual startup:

npm install
npm run build
npm start

Open http://localhost:5173. Set PORT to change the listening port.

First-Run Setup

An empty database opens the setup wizard. It creates the first administrator and stores the platform name, public service URL, optional Logo URL, administrator account, and password in SQLite. Setup can only be completed once.

Persistence

The default database is uno-arena.sqlite. Users, sessions, profiles, roles, bans, branding, service-domain settings, room history, closure reasons, match history, wins, and game counts persist across restarts.

Back up the SQLite database together with its -shm and -wal files.

Admin Console

Administrators can open /admin to manage users, permissions, rooms, match history, branding, and the service domain. Dashboard and room data refresh automatically.

BrightWeb Universal Account

Register an OAuth client using this callback URL:

https://your-service-domain.example/api/auth/brightweb/callback

Create .env from .env.example and provide the issuer URL, client ID, client secret, and exact callback URL.

Community Areas

Functional issues are welcome. Issues, pull requests, and discussions are submitted by their respective authors, who bear sole responsibility for their content. Such content does not represent the views of this project's author and is not reviewed in advance. Off-topic remarks, personal attacks, unlawful content, and content targeting other individuals or public figures will be removed or hidden.

License

This project is not open source under the OSI definition. The source is published for technical learning and exchange. See LICENSE.

  • Permitted: reading and studying the source, running it locally on devices you own or control, and modifying it for learning or personal use.
  • Not permitted: redistribution of original or modified versions, deployment to a location accessible by third parties, offering it as a service, commercial use, or removal or alteration of copyright and attribution notices.
  • Content restriction: the project and modified versions may not be used to create or distribute content that infringes the lawful rights of others or violates applicable law.

The only official site is https://game.brightweb.top. Written authorization from BrightWeb Dev Team is required for any use beyond the scope described above.

Copyright

Powered by ©️2026 BrightWeb Dev Team. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages