File size: 2,032 Bytes
83bcbe3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Price Alert Bot - Full Stack Application

Your Telegram bot has been extended into a full-stack application with web and mobile interfaces.

## Project Structure

```
signals bot/
β”œβ”€β”€ backend/                 # FastAPI backend
β”‚   β”œβ”€β”€ main.py            # API server with WebSocket support
β”‚   └── requirements.txt
β”œβ”€β”€ web-app/               # Next.js web application
β”‚   β”œβ”€β”€ src/app/
β”‚   β”‚   β”œβ”€β”€ page.tsx      # Dashboard
β”‚   β”‚   └── globals.css
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”œβ”€β”€ mobile-app/            # React Native mobile app
β”‚   β”œβ”€β”€ App.tsx
β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”œβ”€β”€ DashboardScreen.tsx
β”‚   β”‚   β”œβ”€β”€ AddAssetScreen.tsx
β”‚   β”‚   └── AlertsScreen.tsx
β”‚   β”œβ”€β”€ package.json
β”‚   └── app.json
└── (original bot files)    # Your existing Telegram bot
```

## Running the Application

### 1. Start the Backend

```bash
cd backend
pip install -r requirements.txt
python main.py
```

The API runs on `http://localhost:8000`

**API Endpoints:**
- `GET /assets` - List tracked assets
- `POST /assets` - Add an asset
- `DELETE /assets/{name}` - Remove an asset
- `GET /assets/available` - List available assets
- `WS /ws` - WebSocket for real-time updates

### 2. Start the Web App

```bash
cd web-app
npm install
npm run dev
```

Open `http://localhost:3000`

### 3. Start the Mobile App

```bash
cd mobile-app
npm install
npx expo start
```

Scan the QR code with Expo Go app.

## Features

| Feature | Web | Mobile |
|---------|-----|--------|
| View tracked assets | βœ… | βœ… |
| Add/remove assets | βœ… | βœ… |
| Real-time prices | βœ… | βœ… |
| Alert history | βœ… | βœ… |
| Dark theme | βœ… | βœ… |
| Push notifications | - | (Configure FCM) |

## Configuration

Update `YOUR_SERVER_IP:8000` in mobile-app/screens/ with your backend server address.

For production, use environment variables:
- `NEXT_PUBLIC_API_URL` for web app
- Store backend URL in mobile app config