A Telegram Mini App served by the core under /app/, embedded in the binary. - API under /app/api/ with initData validated (HMAC, age) on every call - Pages: Home, Queue, Buy (target, product, invoice), History, Groups, group detail (Overview, Settings, Wallet, Usage) and Me - Every action runs through the same service, billing and scheduler code as the chat, so limits, prices and admin checks are decided on the server - Texts come from the catalog over the API; layout mirrors for RTL - Front end in web/miniapp (Vite, React, TypeScript); the build is committed and guarded by a source hash test; the Docker image rebuilds it - MINIAPP_ENABLED with an https PUBLIC_URL; entry points from /app, group settings and the over-limit offer - Browser test (make miniapp-e2e) against a core in test mode - Fix: each download attempt gets its own scratch directory, so a retry cannot lose its file to the cleanup of the failed attempt Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
26 lines
694 B
Go
26 lines
694 B
Go
// Package miniapp holds the built Mini App front end, so the core binary
|
|
// serves it without any files next to it.
|
|
//
|
|
// The dist directory is the output of "npm run build" in this directory
|
|
// (or "make miniapp" from the repository root). It is committed, so a
|
|
// plain "go build" works on a machine without Node.js. After changing
|
|
// anything under src, rebuild and commit dist together with the change.
|
|
package miniapp
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
)
|
|
|
|
//go:embed all:dist
|
|
var dist embed.FS
|
|
|
|
// FS returns the built app, with index.html at its root.
|
|
func FS() fs.FS {
|
|
sub, err := fs.Sub(dist, "dist")
|
|
if err != nil {
|
|
panic(err) // the directory is embedded at build time
|
|
}
|
|
return sub
|
|
}
|