Skip to content

Commit a200c68

Browse files
authored
feat: Rename packages (#41)
* feat: Rename packages * fix: Update readme * fix: Add new readme section
1 parent d5348ec commit a200c68

5 files changed

Lines changed: 51 additions & 35 deletions

File tree

README.md

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,27 @@ It is designed for anyone to clone or fork and use it as a starting point to bui
1111
- [Example](#example)
1212
- [Project Structure](#project-structure)
1313
- [Telegram Bot Commands](#telegram-bot-commands)
14+
- [Queuing Messages](#queuing-messages)
1415
- [Onboarding Modal Component](#onboarding-modal-component)
1516
- [Database](#database)
1617
- [Deployment](#deployment)
1718

1819
## Features
1920

20-
| Feature | Description |
21-
|---------|-------------|
22-
| Optimized Notifications | Reliable Telegram delivery out of the box. No complex setup required. |
23-
| From Pull to Push | Trigger relevant, contextual messages based on wallet activity. Keep your users informed in real-time without them having to check your dashboard. |
24-
| Telegram Bot | Prebuilt bot with wallet linkage and user controls. No need to build your own interface. |
25-
| Telegram Mini App (Coming Soon) | Richer Telegram UI via a lightweight, integrated Telegram Mini App. |
26-
| Onboarding Component | React component for instant onboarding. Users click a link or scan a QR. No wallet connection needed. |
27-
| Zero Installs | No apps, no browser extensions. Everything runs through Telegram. |
28-
| Easy Deployment | Runs as a single-node service. Self-host or deploy in your cloud infra. |
29-
| White Label | Customize components with your own branding and front-end logic. |
30-
| Data Flexibility | Compatible with SQLite, Postgres, MySQL, or MongoDB. Use your preferred stack. You own your user's data, eliminating exposure to third-party risks. |
31-
| Built for Simplicity | Deliver what drives user engagement, retention, and re-activation. DMe handles delivery logic; you focus on wallet signals. |
32-
| Attribution Dashboard (Coming Soon) | Track delivery, opens, and basic interaction metrics to measure messaging impact. |
33-
| Open Source | This framework is **fully open source**. You can inspect, extend, and contribute to its codebase. It’s actively maintained and open to community feedback and contributions. |
21+
| Feature | Description |
22+
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23+
| Optimized Notifications | Reliable Telegram delivery out of the box. No complex setup required. |
24+
| From Pull to Push | Trigger relevant, contextual messages based on wallet activity. Keep your users informed in real-time without them having to check your dashboard. |
25+
| Telegram Bot | Prebuilt bot with wallet linkage and user controls. No need to build your own interface. |
26+
| Telegram Mini App (Coming Soon) | Richer Telegram UI via a lightweight, integrated Telegram Mini App. |
27+
| Onboarding Component | React component for instant onboarding. Users click a link or scan a QR. No wallet connection needed. |
28+
| Zero Installs | No apps, no browser extensions. Everything runs through Telegram. |
29+
| Easy Deployment | Runs as a single-node service. Self-host or deploy in your cloud infra. |
30+
| White Label | Customize components with your own branding and front-end logic. |
31+
| Data Flexibility | Compatible with SQLite, Postgres, MySQL, or MongoDB. Use your preferred stack. You own your user's data, eliminating exposure to third-party risks. |
32+
| Built for Simplicity | Deliver what drives user engagement, retention, and re-activation. DMe handles delivery logic; you focus on wallet signals. |
33+
| Attribution Dashboard (Coming Soon) | Track delivery, opens, and basic interaction metrics to measure messaging impact. |
34+
| Open Source | This framework is **fully open source**. You can inspect, extend, and contribute to its codebase. It’s actively maintained and open to community feedback and contributions. |
3435

3536
## Getting Started
3637

@@ -148,8 +149,8 @@ The example also demonstrates how commands can be customized—for instance, obt
148149

149150
The monorepo is organized into the following packages:
150151

151-
* `packages/server`: The main server application that runs the Telegram bot and handles user interactions, message dispatching, and job scheduling.
152-
* `packages/onboarding-modal`: A React component that provides a user-friendly onboarding experience for linking Telegram accounts with their wallet addresses.
152+
- `packages/server`: The main server application that runs the Telegram bot and handles user interactions, message dispatching, and job scheduling.
153+
- `packages/onboarding-modal`: A React component that provides a user-friendly onboarding experience for linking Telegram accounts with their wallet addresses.
153154

154155
The server package is built with TypeScript and uses the [grammy](https://grammy.dev/) framework for Telegram bot interactions, [Prisma](https://www.prisma.io/) for database management, and [node-cron](https://www.npmjs.com/package/node-cron) for scheduling jobs.
155156

@@ -181,12 +182,27 @@ In this case, you would add an `aave.ts` service to the **services** folder and
181182

182183
The DMe framework includes a set of predefined commands that users can use to interact with the Telegram bot. These commands allow users to manage their subscriptions and get information about their linked wallets.
183184

184-
| Command | Description |
185-
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------|
186-
| `/start [address]` | Starts a conversation with the bot. If a wallet address is provided, it is linked to the user. |
187-
| `/add <address>` | Links an additional wallet address to the user's Telegram account. |
188-
| `/remove <index>` | Unlinks a wallet address from the user's Telegram account. The index is the number to the left of the address provided in `/list`. |
189-
| `/list` | Lists all wallet addresses linked to the user's Telegram account. |
185+
| Command | Description |
186+
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
187+
| `/start [address]` | Starts a conversation with the bot. If a wallet address is provided, it is linked to the user. |
188+
| `/add <address>` | Links an additional wallet address to the user's Telegram account. |
189+
| `/remove <index>` | Unlinks a wallet address from the user's Telegram account. The index is the number to the left of the address provided in `/list`. |
190+
| `/list` | Lists all wallet addresses linked to the user's Telegram account. |
191+
192+
## Queuing Messages
193+
194+
The MessageService is the main component you will be using to queue messages to users, ensuring reliable delivery with built-in rate limiting and retry logic. All messages should be created using the `MessageService.create` or `MessageService.createForUser` methods.
195+
196+
`MessageService.create(content: string, address: string, options?: MessageOptions)` Creates a message targeted for a certain wallet address. The message will be queued and delivered to all users that have linked that address. This should be used to send messages to users based on wallet activity.
197+
198+
`MessageService.createForUser(content: string, userId: number, options?: MessageOptions)` Creates a message targeted for a specific user. This should be used to send messages that are not related to wallet activity, such as welcome messages or responses to user commands.
199+
200+
`MessageOptions` include:
201+
202+
- priority: number - Sets the priority of the message. Higher priority messages are sent first. This allows you to prioritize certain messages over others. Default is 0 for create, and 1000 for createForUser. This is to ensure that command replies are sent before any other queued messages.
203+
- maxAttempts: number - Sets the maximum number of attempts to send the message. Default is 5, this is configurable via the `MAX_ATTEMPTS` environment variable.
204+
205+
Messages are formatted to support **MarkdownV2** when queued. See the [Telegram documentation](https://core.telegram.org/bots/api#markdownv2-style) for more details.
190206

191207
## Onboarding Modal Component
192208

@@ -195,19 +211,19 @@ The framework includes a React component that can be integrated into your React
195211
### 1. Install the Component
196212

197213
```bash
198-
pnpm install dme-onboarding-modal
214+
pnpm install @bootnodedev/dme-onboarding-modal
199215
```
200216

201217
### 2. Import Styles in Your Main App File
202218

203219
```tsx
204-
import "dme-onboarding-modal/lib/index.css";
220+
import "@bootnodedev/dme-onboarding-modal/lib/index.css";
205221
```
206222

207223
### 3. Use the Component in Your React App
208224

209225
```tsx
210-
import { Button } from "dme-onboarding-modal";
226+
import { Button } from "@bootnodedev/dme-onboarding-modal";
211227

212228
function Navbar() {
213229
return (

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "dme-monorepo",
2+
"name": "@bootnodedev/dme-monorepo",
33
"version": "1.0.0",
44
"private": true,
55
"description": "",

packages/onboarding-modal/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A React component for seamless user onboarding to Telegram bot notifications, pa
55
## Installation
66

77
```bash
8-
npm install dme-onboarding-modal
8+
npm install @bootnodedev/dme-onboarding-modal
99
```
1010

1111
## Usage
@@ -15,13 +15,13 @@ npm install dme-onboarding-modal
1515
In your main app file (e.g., `App.tsx` or `index.tsx`), import the component's styles:
1616

1717
```tsx
18-
import "dme-onboarding-modal/lib/index.css";
18+
import "@bootnodedev/dme-onboarding-modal/lib/index.css";
1919
```
2020

2121
### 2. Use the Component in Your React App
2222

2323
```tsx
24-
import { Button } from "dme-onboarding-modal";
24+
import { Button } from "@bootnodedev/dme-onboarding-modal";
2525

2626
function Navbar() {
2727
return (
@@ -42,7 +42,7 @@ function Navbar() {
4242
The wallet address can be obtained from your dApp's Web3 provider, such as **MetaMask** or **WalletConnect**:
4343

4444
```tsx
45-
import { Button } from "dme-onboarding-modal";
45+
import { Button } from "@bootnodedev/dme-onboarding-modal";
4646
import { useAccount } from "wagmi"; // or your Web3 library
4747

4848
function Navbar() {
@@ -86,8 +86,8 @@ The modal generates a deep link to your Telegram bot with the wallet address as
8686
## Example
8787

8888
```tsx
89-
import { Button } from "dme-onboarding-modal";
90-
import "dme-onboarding-modal/lib/index.css";
89+
import { Button } from "@bootnodedev/dme-onboarding-modal";
90+
import "@bootnodedev/dme-onboarding-modal/lib/index.css";
9191

9292
function App() {
9393
return (

packages/onboarding-modal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "dme-onboarding-modal",
3-
"version": "0.0.6",
2+
"name": "@bootnodedev/dme-onboarding-modal",
3+
"version": "0.0.1",
44
"author": "BootNode",
55
"license": "MIT",
66
"type": "module",

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "server",
2+
"name": "@bootnodedev/dme-server",
33
"version": "1.0.0",
44
"private": true,
55
"description": "",

0 commit comments

Comments
 (0)