Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deptyped/notepher-bot
Note-taking Telegram Mini App
https://github.com/deptyped/notepher-bot
telegram telegram-bot telegram-mini-app telegram-miniapp-contest-2023 telegram-web-app
Last synced: about 2 months ago
JSON representation
Note-taking Telegram Mini App
- Host: GitHub
- URL: https://github.com/deptyped/notepher-bot
- Owner: deptyped
- License: mit
- Created: 2023-10-10T15:21:33.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-12T20:39:17.000Z (10 months ago)
- Last Synced: 2024-10-18T06:04:17.584Z (2 months ago)
- Topics: telegram, telegram-bot, telegram-mini-app, telegram-miniapp-contest-2023, telegram-web-app
- Language: Vue
- Homepage: https://t.me/NotepherBot
- Size: 605 KB
- Stars: 165
- Watchers: 4
- Forks: 24
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Notepher Bot
[Notepher](https://t.me/NotepherBot) is an intuitive note-taking [Telegram Mini App](https://core.telegram.org/bots/webapps) designed to effortlessly capture your ideas, to-do lists, and important information. Stay organized and productive without leaving your favorite messenger.
## Features
- **Offline First**. Notes are stored locally and synchronized when an internet connection is available.
- **Synced**. Notepher leverages the power of [Telegram Cloud Storage](https://core.telegram.org/bots/webapps#cloudstorage) to keep your notes in sync across all your devices.
- **Seamless**. Interface colors match your app theme.
- **Organized**. Tag your notes and filter them by tags, pin the most important notes at the top.
- **Search**. Instantly search through all your notes.
- **Powerful**. Formatting, text highlighting, editing history, lists and to-do lists.For more details, check out [User Guide](./README_USER.md).
## Launch
Follow these steps to set up and run your bot using this repository:
1. **Clone Repository**
```bash
git clone https://github.com/deptyped/notepher-bot.git
```2. **Build and Deploy Web App**
After cloning the repository, navigate to the `web-app` directory:
```bash
cd apps/web-app
```Run the following command to build the web app:
```bash
npm run build
```This command will generate build output resources inside the `dist` directory. You can now deploy these resources as a regular static website to your hosting provider of choice.
For information on launching the web app in developer mode, please refer to [apps/web-app/README.md](./apps/web-app/README.md)
3. **Configure the Menu Button**
- Open the Telegram app and search for "[@BotFather](https://t.me/BotFather)".
- Start a chat with [@BotFather](https://t.me/BotFather).
- Use the `/setmenubutton` command to see your bot list and select the bot you want to configure the menu button.
- Follow the prompts to set up the menu button with the URL obtained in the previous step.
- After that, the menu button will be available to users when they interact with your bot.**Congrats!** Web App is deployed and available to bot users.
> [!NOTE]
> At this stage web app is fully functional, further steps are optional.4. **Environment Variables Setup**
Once you have completed the web app build and deployment, navigate to the `apps/bot` directory:```bash
cd ../bot
```Create an environment variables file by copying the provided example file:
```bash
cp .env.example .env
```
Open the newly created `.env` file and set the `BOT_TOKEN` environment variable. This token should be obtained from [@BotFather](https://t.me/BotFather).Set the `WEB_APP_URL` environment variable with the URL obtained during the web app deployment (step 2).
5. **Launching the Bot**
You can run your bot in both development and production modes.**Development Mode:**
Install the required dependencies:
```bash
npm install
```
Start the bot in watch mode (auto-reload when code changes):
```bash
npm run dev
```**Production Mode:**
Install only production dependencies (no development dependencies):
```bash
npm install --only=prod
```
Set the `NODE_ENV` environment variable to "production" in your `.env` file. Also, make sure to update `BOT_WEBHOOK` with the actual URL where your bot will receive updates.
```dotenv
NODE_ENV=production
BOT_WEBHOOK=
```
Start the bot in production mode:
```bash
npm start
# or
npm run start:force # if you want to skip type checking
```### List of Available Commands
- `npm run lint` — Lint source code.
- `npm run format` — Format source code.
- `npm run typecheck` — Run type checking.
- `npm run dev` — Start the bot in development mode.
- `npm run start` — Start the bot.
- `npm run start:force` — Start the bot without type checking.## Environment Variables
Variable
Type
Description
NODE_ENV
String
Specifies the application environment. (development
orproduction
)
BOT_TOKEN
String
Telegram Bot API token obtained from @BotFather.
WEB_APP_URL
String
HTTPS link to Web App.
LOG_LEVEL
String
Optional.
Specifies the application log level.
For example, useinfo
for general logging. View the Pino documentation for more log level options.
Defaults toinfo
.
BOT_MODE
String
Optional.
Specifies method to receive incoming updates. (polling
orwebhook
)
BOT_WEBHOOK
String
Optional inpolling
mode.
Webhook endpoint URL, used to configure webhook in production environment.
BOT_SERVER_HOST
String
Optional. Specifies the server hostname.
Defaults to0.0.0.0
.
BOT_SERVER_PORT
Number
Optional. Specifies the server port.
Defaults to80
.
BOT_ALLOWED_UPDATES
Array of String
Optional. A JSON-serialized list of the update types you want your bot to receive. See Update for a complete list of available update types.
Defaults to an empty array (all update types exceptchat_member
).
BOT_ADMINS
Array of Number
Optional.
Administrator user IDs.
Use this to specify user IDs that have special privileges, such as executing/setcommands
.
Defaults to an empty array.