An open API service indexing awesome lists of open source software.

https://github.com/bravo68web/is-he-online

Live Presense Tracker // ๐Ÿ”Ž
https://github.com/bravo68web/is-he-online

discord livestream presense rpc sse vscode-extension

Last synced: about 2 months ago
JSON representation

Live Presense Tracker // ๐Ÿ”Ž

Awesome Lists containing this project

README

          

# Is He Online? ๐Ÿ‘€

[![Turborepo](https://img.shields.io/badge/Built%20with-Turborepo-blue)](https://turbo.build)
[![uWebSockets.js](https://img.shields.io/badge/Powered%20by-uWebSockets.js-green)](https://github.com/uNetworking/uWebSockets.js)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue)](https://typescriptlang.org)

A blazing-fast, real-time presence monitoring system for Discord and VSCode activity broadcasting built with modern tools and architecture.

## ๐Ÿ—๏ธ Architecture

This project uses a **Turborepo monorepo** structure for better organization and development experience:

```
โ””โ”€โ”€ packages/
โ””โ”€โ”€ api/ # @is-he-online/broadcast-api - Ultra-fast uWebSockets.js server
```

## โšก Key Features

- ๐Ÿš€ **Ultra-fast uWebSockets.js** - C++ performance, 8x faster than Node.js HTTP
- ๐Ÿ“ก **Unlimited SSE streaming** - No timeout limitations, infinite connections
- ๐Ÿ‘ค **Real-time Discord monitoring** - Track user presence and activities
- ๐Ÿ—๏ธ **Modern monorepo** - Turborepo for efficient development workflow
- ๐ŸŽฏ **TypeScript everywhere** - Full type safety across all packages

## ๐Ÿš€ Quick Start

### Prerequisites
- Node.js 18+
- Discord Bot Token
- Target Discord User ID

### 1. Clone and Install
```bash
git clone
cd is-he-online
npm install
```

### 2. Configure Environment
```bash
cd packages/api
cp .env.example .env
# Edit .env with your Discord credentials
```

### 3. Build All Packages
```bash
yarn build
```

### 4. Start Development
```bash
# Start API server
yarn dev -- -- --workspace packages/api
```

## ๐Ÿ“ฆ Packages

### ๐Ÿ”Œ Broadcast API (`@is-he-online/broadcast-api`)
Ultra-fast Discord and VSCode activity broadcasting API built with uWebSockets.js.

**Features:**
- Discord bot integration with presence monitoring
- Real-time SSE streaming without timeouts
- Health monitoring and activity endpoints

**Tech Stack:**
- uWebSockets.js for ultra-fast HTTP/SSE
- Discord.js for bot functionality
- TypeScript for type safety

## ๐Ÿ› ๏ธ Development

### Available Scripts

| Command | Description |
|---------|-------------|
| `npm run build` | Build all packages |
| `npm run dev` | Start all packages in development mode |
| `npm run lint` | Lint all packages |
| `npm run clean` | Clean all build outputs |

### Workspace Commands

| Workspace | Description |
|------------|-------------|
| `yarn dev` | Start broadcast API server |

## ๐Ÿ”ง Configuration

### API Server (packages/api/.env)
```env
DISCORD_TOKEN=your_discord_bot_token
TARGET_USER_ID=your_discord_user_id
TARGET_USER_NAME=your_discord_user_name
PORT=3000
```

## ๐Ÿ“Š API Endpoints

| Endpoint | Method | Description | Authentication |
|----------|--------|-------------|----------------|
| `/health` | GET | Health check and status | None |
| `/activity` | GET | Current Discord activity | None |
| `/events` | GET | SSE stream for real-time updates | None |

## ๐ŸŽฏ Performance Benefits

### uWebSockets.js vs Traditional Solutions

| Metric | uWebSockets.js | Node.js HTTP | Improvement |
|--------|----------------|--------------|-------------|
| **Throughput** | ~1M req/s | ~125k req/s | **8x faster** |
| **Memory Usage** | Low | High | **50% less** |
| **SSE Connections** | Unlimited | Limited | **No timeouts** |
| **Latency** | Ultra-low | Standard | **3x lower** |

## ๐Ÿงช Testing

Test individual components:

```bash
# Test API server
curl http://localhost:3000/health

# Test SSE connection
curl -N http://localhost:3000/events
```

## ๐Ÿค Contributing

1. Fork the repository
2. Create your feature branch: `git checkout -b feature/amazing-feature`
3. Commit your changes: `git commit -m 'Add amazing feature'`
4. Push to the branch: `git push origin feature/amazing-feature`
5. Open a Pull Request

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js) - Ultra-fast WebSocket and HTTP library
- [Discord.js](https://discord.js.org) - Powerful Discord API library
- [Turborepo](https://turbo.build) - High-performance build system
- [TypeScript](https://typescriptlang.org) - Typed JavaScript at scale