assets-tracker-api / FULLSTACK_README.md
somilsadana
Initial commit of full-stack assets tracker bot
83bcbe3
|
Raw History Blame Contribute Delete
2.03 kB
# 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