You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).
1
+
# Hyperlinks Space Program
3
2
4
-
## Get started
3
+
<u>**In progress.**</u>
5
4
6
-
To start the app (and the Telegram bot in polling mode), run:
5
+
This program is built upon [React Native](https://reactnative.dev/) by Meta and [Expo](https://expo.dev) multiplatform technologies, Windows build and executable creation achieved with [Electron Builder](https://www.electron.build/) and [Electron Forge](https://www.electronforge.io/), working in Telegram with help of [Telegram Mini Apps React SDK](http://telegram-mini-apps.com/) and [Bot API](https://core.telegram.org/bots). AI is backed by [OpenAI API](https://openai.com/ru-RU/api/), blockchain data is processed from [Swap.Coffee API](https://docs.swap.coffee/eng/user-guides/welcome).
6
+
7
+
## Program Kit
8
+
9
+
To give value for other developers we decided to launch an npm package that provides a ready starter for creating a multiplatform program in one command.
This runs both the Expo dev server and the bot. For Expo only (no bot), use `npm run start:expo`.
15
+
Link to the package: https://www.npmjs.com/package/@www.hyperlinks.space/program-kit
13
16
14
-
## Milestone snapshot package (npm)
17
+
## Program design
18
+
19
+
Access [Figma](https://www.figma.com/design/53lDKAD6pRv3e0uef1DP18/TECHSYMBAL-Inc.?node-id=754-71&t=v3tmAlywNgXkTWMd-1) in real time for contributing. Contact [Seva](t.me/sevaaignatyev) in Telegram to discuss and implement.
15
20
16
-
This repository includes a publishable snapshot package for fast developer bootstrap:
21
+
Copying fully or partially, usage as an inspiration for other developments are unpleasant, participation in our projects is appreciated. All core materials are available publicly for instant access worldwide and our project availability for newcomers.
-**npmjs (public):**`@www.hyperlinks.space/program-kit` — manage org and tokens: [www.hyperlinks.space on npm](https://www.npmjs.com/settings/www.hyperlinks.space/packages)
20
-
-**GitHub Packages:**`@hyperlinksspace/program-kit` (same version; GitHub requires the package scope to match this repo’s owner)
23
+
## How to fork and contribute?
21
24
22
-
**npm ownership:** your token must be allowed to publish under scope `@www.hyperlinks.space` (org members or automation token with access to that org).
25
+
1. Install GitHub CLI and authorize to GitHub from CLI for instant work
23
26
24
-
### Verify publish payload locally
27
+
```
28
+
winget install --id GitHub.cli
29
+
gh auth login
30
+
```
25
31
26
-
The npm package page uses `README.md` from the published tarball, not `npmReadMe.md`. The published package also includes **`fullREADME.md`**, a copy of this developer readme (saved before the npm readme replaces `README.md`). Match CI before `npm pack`, then restore:
32
+
2. Fork the repo, clone it and create a new branch and switch to it
git commit -m "Describe your change" # Commit on this branch
45
+
```
46
+
47
+
3. After making a commit, make a pull request, gh tool will already know the upstream remote
48
+
49
+
```
50
+
gh pr create --title "My new PR" --body "It is my best PR"
51
+
```
52
+
53
+
4. For subsequent commits (sync `main`, create a fresh branch, and commit there)
54
+
55
+
```
56
+
git checkout main # Return to main
57
+
git fetch upstream # Fully sync with upstream main
58
+
git reset --hard upstream/main # Reset local main to upstream/main
59
+
git push origin main # Keep your fork main in sync too
60
+
git switch -c new-branch-for-next-update # Create and switch to a new feature branch
61
+
```
62
+
63
+
**Move in loops starting from the step 3.**
41
64
42
-
The CLI materializes the bundled package payload into your target folder, then you run:
65
+
## Pull requests and commits requirements
66
+
67
+
- Give pull requests and commits a proper name and description
68
+
- Dedicate each pull request to an understandable area or field, each commit to a focused logical change
69
+
- Check file changes in every commit pulled, no arbitrary files modifications should persist such as LF/CRLF line-ending conversion, broken/garbled text diffs, BOM added or removed, accidental "invisible" corruption from text filters
70
+
- Add dependecies and packages step by step for security
71
+
- An issue creation or following an existing before a pull request would be a good practice
72
+
73
+
## Local deploy
74
+
75
+
To start the full local stack, run:
43
76
44
77
```bash
45
-
cd my-hsp-app
46
-
npm install
78
+
npm run start
47
79
```
48
80
49
-
### Release channels
81
+
This runs Expo dev server, the Telegram bot (polling mode), and local Vercel API (`vercel dev`).
-[Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo
89
+
## Milestone snapshot package (npm)
60
90
61
-
You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).
91
+
NPM release and snapshot details were moved to `docs/npm-release.md`.
62
92
63
93
### Local env setup
64
94
@@ -77,9 +107,22 @@ You can start developing by editing the files inside the **app** directory. This
77
107
78
108
The `.env` file is gitignored; do not commit it.
79
109
80
-
## Workflows
110
+
## GitHub Actions
81
111
82
-
This project is configured to use [EAS Workflows](https://docs.expo.dev/eas/workflows/get-started/) to automate some development and release processes. These commands are set up in [`package.json`](./package.json) and can be run using NPM scripts in your terminal.
112
+
Current Actions workflows include:
113
+
114
+
-`Vercel Deploy Test` (`.github/workflows/vercel-deploy-test-envs.yml`) - manual web deploy to Vercel.
-[EAS Workflows](https://docs.expo.dev/eas/workflows/get-started/) for Expo update/build/deploy flows (triggered via npm scripts from [`package.json`](./package.json)).
125
+
- GitHub Actions for CI/CD tasks stored in `.github/workflows` (manual release/deploy jobs and checks).
83
126
84
127
### Previews
85
128
@@ -109,51 +152,26 @@ Deploying from repository root makes this folder the project root, so `api/bot`
109
152
110
153
### Telegram bot (Grammy)
111
154
112
-
A minimal bot that replies "Hello" is included. It is deployable on Vercel via webhook and runnable locally with getUpdates.
155
+
The bot is extended beyond a basic "Hello" and "Start program" responder and now supports AI streaming and threads.
113
156
114
157
**Vercel (webhook)**
115
-
-**Env for deploy:** In Vercel → **Settings → Environment Variables** add **`BOT_TOKEN`** (or `TELEGRAM_BOT_TOKEN`). Assign to **Production** (and to **Build** if your dashboard has that option) so the deploy-step webhook script can run. The webhook URL is built from Vercel’s `VERCEL_PROJECT_PRODUCTION_URL` or `VERCEL_URL`.
116
-
-**Webhook on deploy:** Each build runs `scripts/set-webhook.ts` and calls Telegram `setWebhook` with the base URL + `/api/bot`. If the script fails (e.g. missing URL or Telegram error), the build fails so you see the error in the deploy log.
117
-
- Telegram sends updates to **POST**`/api/bot`; the bot replies "Hello".
158
+
-**Runtime path:** Telegram sends updates to `POST /api/bot`. This route proxies to the shared bot webhook handler in `bot/webhook`.
159
+
-**Webhook setup:**`scripts/set-webhook.ts` sets `https://<base>/api/bot` using `VERCEL_PROJECT_PRODUCTION_URL` (preferred) or `VERCEL_URL`.
160
+
-**Required env:** set `BOT_TOKEN` (or `TELEGRAM_BOT_TOKEN`) in Vercel project envs for production deploys.
161
+
-**Deploy flow:** webhook mode is intended for Vercel deploys (CLI `vercel --prod` or the manual GitHub Action `Vercel Deploy (Test Envs)`).
118
162
119
163
**Bot works locally but not on Vercel**
120
-
1. Open **GET**`https://<your-app>.vercel.app/api/bot` in a browser. The JSON shows:
121
-
-`bot: true` → BOT_TOKEN is set; `bot: false` → add BOT_TOKEN in Vercel → Settings → Environment Variables (Production), then redeploy.
122
-
-`expected_url` → URL we use for the webhook (from VERCEL_PROJECT_PRODUCTION_URL or VERCEL_URL).
123
-
-`telegram_has` → URL Telegram actually has. It must match your production URL (e.g. `https://hsbexpo.vercel.app/api/bot`). If it’s `(none)` or different, ensure the project’s production domain is set in Vercel and redeploy so set-webhook.ts runs with the correct URL.
124
-
-`webhook_set: true` → last setWebhook call succeeded.
125
-
2.**Root directory:** If you deploy via Git (auto-deploy from the repo), set **Root Directory** to the repository root (leave it empty/default) in Vercel → Project Settings → General. If you run `vercel --prod` from the root, the CLI already uses the correct project root.
126
-
3.**Logs:** After sending /start, check **Logs** for `[webhook] POST update` and any `[bot]` errors (e.g. handler_error, timeout).
127
-
4. Don’t run the same bot in polling locally while testing the webhook (or Telegram may deliver updates to the wrong place).
164
+
1. Confirm Vercel env has `BOT_TOKEN` and redeploy.
165
+
2. Ensure the deployed URL is stable and matches the webhook target (`/api/bot`).
166
+
3. Check deploy/runtime logs for `[set-webhook]` and `[webhook]` errors.
167
+
4. Do not run local polling with the same token while validating webhook mode.
128
168
129
169
**Local (getUpdates, no webhook)**
130
-
- Only `BOT_TOKEN` is required (in env or `.env`).
131
-
- Run the bot in polling mode (do not use the same token with webhook set elsewhere):
132
-
```bash
133
-
npx tsx scripts/run-bot-local.ts
134
-
```
135
-
-`npm run start` runs both Expo and the bot; or run the bot alone with `npm run bot:local`.
136
-
137
-
## Get a fresh project
138
-
139
-
When you're ready, run:
140
-
141
-
```bash
142
-
npm run reset-project
143
-
```
144
-
145
-
This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.
146
-
147
-
## Learn more
148
-
149
-
To learn more about developing your project with Expo, look at the following resources:
150
-
151
-
-[Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
152
-
-[Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.
153
-
154
-
## Join the community
170
+
- Only `BOT_TOKEN` is required (env or `.env`).
171
+
- Run bot only: `npm run bot:local`
172
+
- Run full local stack (Expo + bot + Vercel): `npm run start`
173
+
- Keep production and local bot tokens separate when possible to avoid webhook/polling conflicts.
155
174
156
-
Join our community of developers creating universal apps.
175
+
## Where to discuss the project?
157
176
158
-
-[Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
159
-
-[Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
177
+
This repository has [GitHub Discussions](https://github.com/HyperlinksSpace/HyperlinksSpaceProgram/discussions) opened, as well you can join our [Telegram Chat](https://t.me/HyperlinksSpaceChat) and [Channel](https://t.me/HyperlinksSpace).
-**npmjs (public):**`@www.hyperlinks.space/program-kit` — manage org and tokens: [www.hyperlinks.space on npm](https://www.npmjs.com/settings/www.hyperlinks.space/packages)
7
+
-**GitHub Packages:**`@hyperlinksspace/program-kit` (same version; GitHub requires the package scope to match this repo's owner)
8
+
9
+
## Verify publish payload locally
10
+
11
+
The npm package page uses `README.md` from the published tarball, not `npmReadMe.md`. The published package also includes **`fullREADME.md`**, a copy of the developer readme (saved before the npm readme replaces `README.md`). Match CI before `npm pack`, then restore:
-[Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo
45
+
46
+
You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).
0 commit comments