GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — UnitKeeperBot/miniapp at main · ilyascw/UnitKeeperBot

Expand file tree

/

miniapp

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

miniapp

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
public
public
 
 
src
src
 
 
.dockerignore
.dockerignore
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.prettierrc.json
.prettierrc.json
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
components.json
components.json
 
 
eslint.config.js
eslint.config.js
 
 
index.html
index.html
 
 
nginx.conf
nginx.conf
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.app.json
tsconfig.app.json
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.node.json
tsconfig.node.json
 
 
vite.config.ts
vite.config.ts
 
 

README.md

Outline

UnitKeeper Mini App

The main user interface for UnitKeeper, delivered as a Telegram Mini App.

Stack

  • Vite — build tool and dev server
  • React + TypeScript — UI
  • Telegram UI Kit (@telegram-apps/telegram-ui) — native Telegram look and feel
  • Telegram Mini Apps SDK (@tma.js/sdk-react) — runtime, theme, init data
  • TanStack Query — data fetching, caching, loading/error states
  • wouter — lightweight client-side routing behind a local navigation adapter

Project layout

src/
  api/         # typed backend client, contract types, endpoints, query hooks
  auth/        # session bootstrap from Telegram init data + token storage
  components/  # app shell: layout, loader, error state, error boundary
  config/      # validated build-time configuration (env.ts)
  routes/      # route table and path registry
  screens/     # one component per screen
  telegram/    # SDK init, launch-data resolution, appearance hook
  App.tsx      # providers + shell composition
  main.tsx     # entrypoint (SDK init + render)

The app never sends a user id to the backend. Authentication exchanges the signed Telegram init data for a session token (POST /auth/telegram); the backend derives the user from the signature. The token is persisted and restored on reload (validated against GET /auth/me).

Backend contract

  • POST /auth/telegram { init_data } → session { access_token, expires_at, context }
  • GET /auth/me → current context (user / membership / group)
  • GET /groups/current → current group card (404 ⇒ onboarding)
  • /tasks, /task-logs/* → task catalog and approval flows
  • /sprints/current/* → sprint progress and closing
  • /balances/* → balance, transfers and transaction history

Contract types live in src/api/types.ts and mirror backend/src/unitkeeper_backend/api/schemas.

Developer setup

Requires Node.js 22.13+ and npm.

cd miniapp
npm install
cp .env.example .env        # then edit values
npm run dev                 # http://localhost:5173

Environment variables

Variable Purpose
VITE_API_BASE_URL Backend base URL incl. /api/v1 (default /api/v1)
VITE_TELEGRAM_DEBUG true to enable verbose Telegram SDK logging
VITE_DEV_INIT_DATA Dev-only raw init data to bootstrap auth outside Telegram (never in prod)

Running outside Telegram

In a plain browser tab there is no window.Telegram.WebApp, so init data cannot be retrieved and the app shows an "Open from Telegram" state. To develop screens without Telegram, paste a valid raw init data string into VITE_DEV_INIT_DATA. This is ignored in production builds.

Running inside Telegram

Expose the dev server over HTTPS (e.g. with a tunnel) and set the Mini App URL in BotFather to that address. Opening the app from the bot injects real init data and the full theme.

Scripts

Script Description
npm run dev Start the Vite dev server
npm run build Type-check and build for production
npm run preview Preview the production build
npm run typecheck Type-check without emitting
npm run lint Run ESLint
npm run format Format with Prettier
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.