LiteQueue is a local-first queue management system for solo developers and small teams. It runs on SQLite, keeps setup lightweight, and combines ticketing with a flexible form engine that can calculate wait time and display contextual hints.
LiteQueue 是一个面向个人开发者和小团队的本地优先排队系统。它基于 SQLite 运行,部署轻量,同时把工单管理与灵活表单引擎结合起来,可以自动计算等待时间并展示上下文提示。
中文:LiteQueue 面向门店、工作室、技术支持台和小型服务窗口。它支持自定义字段、动态选项提示、队列位置查询和管理后台,适合需要快速落地的本地排队场景。
English: LiteQueue is designed for counters, studios, support desks, and small service queues. It supports custom fields, dynamic hints, queue position lookup, and an admin dashboard for fast local deployment.
- 动态表单引擎 / Dynamic form engine for custom ticket fields.
- 自动计算工单预计耗时 / Automatic ticket time aggregation.
- 队列摘要与排队位置查询 / Queue summary and position lookup.
- 工单状态管理 / Ticket status management with pending, done, and canceled states.
- 管理后台配置管理 / Admin-side configuration management and activation.
- 本地 SQLite 开箱即用 / Local SQLite setup with minimal dependencies.
展示当前排队人数、预计等待时间和公告内容。 / Shows current queue size, estimated wait time, and announcements.
展示动态表单与提交结果。 / Shows the dynamic form and submission result.
管理员登录入口。 / Admin login entry point.
工单表格与操作区。 / Ticket table and action area.
配置版本、激活状态与编辑入口。 / Configuration versions, activation state, and edit entry points.
- Next.js 14
- React 18
- TypeScript
- Prisma
- SQLite
- Tailwind CSS
Copy-Item .env.example .env.local
npm install
npm run prisma:generate
npm run prisma:migrate
npm run prisma:seed
npm run devOpen http://localhost:3000 after the server starts.
启动后访问 http://localhost:3000。
| 变量 / Variable | 默认值 / Default | 说明 / Description |
|---|---|---|
| DATABASE_URL | file:./dev.db | Prisma 使用的 SQLite 数据库文件。 / SQLite database file used by Prisma. |
| NEXT_PUBLIC_POSITION_POLL_INTERVAL_MS | 30000 | 首页“我的排队位置”自动刷新间隔,单位毫秒。 / Auto-refresh interval for the My Position widget, in milliseconds. |
| NEXT_PUBLIC_ADMIN_POLL_INTERVAL_MS | 30000 | 管理页工单表格自动刷新间隔,单位毫秒。 / Auto-refresh interval for the admin tickets table, in milliseconds. |
| ADMIN_PASSWORD | admin123 | 管理员验证密码。 / Admin verification password. |
中文:npm run prisma:migrate 会使用当前 schema 和 migrations 初始化或更新本地 SQLite 数据库,npm run prisma:seed 会写入默认配置。修改 schema 后,请先执行 npm run prisma:generate。
English: npm run prisma:migrate initializes or updates the local SQLite database using the current schema and migration history, and npm run prisma:seed loads the default configuration. After schema changes, run npm run prisma:generate first.
默认种子会创建名为“代理软件选择”的配置,便于你直接演示首页、提交页和管理后台。
The default seed creates a configuration named “代理软件选择” so you can demonstrate the home page, submission flow, and admin dashboard immediately.
| Method | Path | 说明 / Description |
|---|---|---|
| GET | /api/config | 获取当前激活配置。 / Get the active configuration. |
| GET | /api/configs | 列出所有配置。 / List all configurations. |
| POST | /api/configs/create | 创建新配置版本。 / Create a new configuration version. |
| POST | /api/configs/:id/activate | 激活指定配置。 / Activate a specific configuration. |
| POST | /api/tickets | 提交工单,传入 answers。 / Create a ticket from answers. |
| GET | /api/tickets | 列出最近工单。 / List recent tickets. |
| GET | /api/tickets/:id | 获取工单详情。 / Get ticket details. |
| PATCH | /api/tickets/:id | 更新工单状态,支持 pending、done、canceled。 / Update ticket status. |
| DELETE | /api/tickets/:id | 删除工单。 / Delete a ticket. |
| GET | /api/tickets/summary | 获取待处理工单摘要。 / Get the pending queue summary. |
| GET | /api/tickets/position?ticketId=... | 查询工单排队位置。 / Look up a ticket's queue position. |
| POST | /api/admin/verify | 验证管理员密码。 / Verify the admin password. |
管理后台位于 /admin,支持配置管理、配置激活、工单查看、状态更新、自动刷新、手动刷新、过滤、排序和分页。
The admin dashboard lives at /admin and supports configuration management, configuration activation, ticket review, status updates, auto refresh, manual refresh, filtering, sorting, and pagination.
默认管理员密码来自 .env.local 中的 ADMIN_PASSWORD。前端与后端都会读取同一个值。
The default admin password comes from ADMIN_PASSWORD in .env.local. The frontend and backend use the same value.
请检查 .env.local 中的 ADMIN_PASSWORD 是否与前端输入一致。默认值是 admin123。 / Check whether ADMIN_PASSWORD in .env.local matches the value you enter. The default is admin123.
先确认 DATABASE_URL 指向当前项目的 SQLite 文件,例如 file:./dev.db。如果 schema 改动较大,请先运行 npm run prisma:generate,再执行迁移。 / Confirm that DATABASE_URL points to the current SQLite file, such as file:./dev.db. If the schema changed significantly, run npm run prisma:generate first, then rerun migrations.
检查 NEXT_PUBLIC_POSITION_POLL_INTERVAL_MS 和 NEXT_PUBLIC_ADMIN_POLL_INTERVAL_MS。数值越小,刷新越频繁。 / Check NEXT_PUBLIC_POSITION_POLL_INTERVAL_MS and NEXT_PUBLIC_ADMIN_POLL_INTERVAL_MS. Smaller values refresh more frequently.
不建议。SQLite 依赖本地文件,而 Vercel 的运行环境是无状态的。生产环境建议切换为可持久化数据库。 / Not recommended. SQLite depends on a local file, while Vercel runs in a stateless environment. Use a persistent database for production.
- 保持文档与脚本一致。 / Keep documentation aligned with package scripts.
- 提交前运行
npm run build。 / Runnpm run buildbefore committing. - 新增配置、API 或截图时,优先保持中英双语同步更新。 / When adding configs, APIs, or screenshots, keep both languages in sync.




