How tobijpeg/bot-s works
Bot(s) KZ is a web-based Telegram bot builder: an owner signs in, creates a bot profile and workflow, edits it manually or with the optional builder AI, then launches it through the platform API. The server runs the saved workflow against Telegram messages; owners can review and reply to inbox items in the web app. The README documents Supabase-backed accounts and data, encrypted Telegram tokens, onboarding, reusable workflow sequences, and admin-only questionnaire responses. Some server and page implementations were not sampled, so those branches are included only where documented; edges reflect excerpted code or README statements.
Main entry points: server.js Platform API · BotFlowEditor.jsx Workflow editor · supabase.js Supabase client · api.js API client
Components 21
Web app
- App routes
src/App.jsx - Sign-in
src/pages/Auth.jsx - API client
src/lib/api.js - Inbox
src/pages/Inbox.jsx - Onboarding and tour
src/pages/Welcome.jsx - Admin responses
src/pages/AdminResponses.jsx - Settings and library
src/pages/Settings.jsx
Bot building
- Workspace state
src/context/CreateBotContext.jsx - Bot profile
src/lib/bot-profile.js - Workflow editor
src/pages/BotFlowEditor.jsx - Workflow model
src/workflow.js - Builder AI
src/workflow-ai.js - Local workspace
src/workspace-storage.js
Bot platform
- Platform API
server.js - Workflow runtime
src/workflow-runtime.js - Inbox delivery
src/inbox-delivery.js
Accounts and data
- Supabase client
src/lib/supabase.js - Supabase Auth and tables
Other components
- Bot owner
- Telegram user
- Telegram Bot API
Connections 28
- Bot owner → Sign-in: signs in
src/pages/Auth.jsx - App routes → Sign-in: routes to
src/App.jsx - App routes → Workflow editor: routes to
src/App.jsx - App routes → Inbox: routes to
src/App.jsx - Sign-in → Supabase client: authenticates with
src/pages/Auth.jsx - Supabase client → Supabase Auth and tables: connects to
src/lib/supabase.js - Workspace state → Workflow model: creates default
src/context/CreateBotContext.jsx - Workspace state → Local workspace: reads and writes
src/context/CreateBotContext.jsx - Workflow editor → Workspace state: edits state
src/pages/BotFlowEditor.jsx - Workflow editor → Workflow model: edits schema
src/pages/BotFlowEditor.jsx - Workflow editor → Builder AI: requests generation
src/pages/BotFlowEditor.jsx - Bot owner → Workflow editor: builds bot
README.md - Workflow editor → API client: sends AI request
src/pages/BotFlowEditor.jsx - Workflow editor → API client: saves configuration
src/pages/BotFlowEditor.jsx - API client → Platform API: calls platform API
README.md - Platform API → Workflow model: loads schema
server.js - Platform API → Workflow runtime: uses runtime
server.js - Platform API → Telegram Bot API: polls and replies
README.md - Telegram user → Telegram Bot API: sends messages
README.md - Platform API → Inbox delivery: dispatches replies
server.js - Inbox → API client: calls API
src/pages/Inbox.jsx - Inbox → Supabase client: accesses data
src/pages/Inbox.jsx - Platform API → Supabase Auth and tables: stores bot and inbox data
README.md - Platform API → Supabase Auth and tables: stores encrypted tokens
README.md - Onboarding and tour → Supabase client: uses account data
src/pages/Welcome.jsx - Admin responses → Supabase client: loads responses
src/pages/AdminResponses.jsx - Settings and library → Supabase client: uses account data
src/pages/Settings.jsx - Settings and library → Local workspace: manages saved sequences
src/pages/Settings.jsx