Skip to content

Commit 1977527

Browse files
committed
feat(frontend): Initialize audio streaming web app
Sets up React + Vite + TypeScript frontend structure. - Adds Tailwind CSS v4 and Lucide icons. - Implements modular architecture with Zustand state management. - Adds detailed views for Home, Broadcaster, and Listener. - Updates README with backend integration notes.
1 parent 5bc88d4 commit 1977527

31 files changed

+4835
-139
lines changed

README.md

Lines changed: 13 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,18 @@
1-
# bgce-stream
21

3-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4-
[![Go Version](https://img.shields.io/badge/Go-1.19%2B-blue.svg)](https://golang.org/)
5-
[![WebRTC](https://img.shields.io/badge/WebRTC-Supported-green.svg)](https://webrtc.org/)
6-
[![Contributions Welcome](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg)](CONTRIBUTING.md)
2+
## Backend Integration Notes
73

8-
> **Simple audio streaming for small communities** - Create rooms instantly, share links, and start streaming music or voice with friends.
4+
To transform this frontend into a fully functional streaming application, the backend must handle the following events and data flow:
95

10-
## 🎵 What is bgce-stream?
6+
### Socket Events
7+
- **`join-stream`**: Payload `{ username: string, role: string }`. Server should add user to the room and broadcast update.
8+
- **`start-broadcast`**: Server marks the stream as live.
9+
- **`end-broadcast`**: Server cleans up room and notifies listeners.
10+
- **`toggle-mic`**: Payload `{ isMuted: boolean }`. Server broadcasts this state to all listeners to update their UI.
11+
- **`user-joined` / `user-left`**: Broadcast to all clients to update the `UserList`.
1112

12-
bgce-stream is a lightweight, browser-based audio streaming platform designed for small-to-medium communities ("bhai-brother" groups). It enables instant room creation, shareable links, and high-quality audio streaming without complex setup or UI overhauls.
13+
### WebRTC / Streaming
14+
- **Signaling Server**: Implement Webrtc signaling (offer, answer, ice-candidate exchanges).
15+
- **Media Server (Optional)**: For scaling to many listeners, use an SFU (Selective Forwarding Unit) like meediasoup or Janus instead of mesh networking.
1316

14-
### Key Features
15-
16-
- 🚀 **One-click room creation** - Generate unique, shareable links instantly
17-
- 🎤 **Simple streaming experience** - Just click and stream
18-
- 🎛️ **Audio enhancement** - Automatic gain control, noise filtering, and music mode
19-
- 🔊 **Preserve audio richness** - Not compressed like standard voice calls
20-
- 🌐 **Browser-based** - No downloads, works on any modern browser
21-
- 👥 **Community-focused** - Designed for small groups (3-5 users)
22-
23-
## 🚀 Quick Start
24-
25-
### Prerequisites
26-
27-
- **Backend**: Go 1.19 or higher
28-
- **Frontend**: Modern web browser with WebRTC support
29-
- **Network**: Stable internet connection
30-
31-
### Installation
32-
33-
1. **Clone the repository**:
34-
```bash
35-
git clone https://github.com/your-username/bgce-stream.git
36-
cd bgce-stream
37-
```
38-
39-
2. **Start the backend server**:
40-
```bash
41-
cd backend
42-
go mod tidy
43-
go run ./cmd/server
44-
```
45-
46-
3. **Open the frontend**:
47-
```bash
48-
cd frontend
49-
# Use any static file server, e.g.:
50-
python -m http.server 3000
51-
# or
52-
npx serve public
53-
```
54-
55-
4. **Access the application**:
56-
- Open `http://localhost:3000` in your browser
57-
- Click "Create Room" to get started
58-
59-
## 📖 Documentation
60-
61-
- **[Contributing Guide](docs/CONTRIBUTING.md)** - How to contribute to bgce-stream
62-
- **[Roadmap](docs/ROADMAP.md)** - Development plans and upcoming features
63-
- **[v0.1.0 Release Notes](docs/releases/v0.1.0/README.md)** - Current MVP features
64-
- **[Backend README](backend/README.md)** - Backend-specific documentation
65-
66-
<!-- ## 🏗️ Architecture
67-
68-
### Backend (Go)
69-
- **REST API** for room management
70-
- **WebSocket signaling** for WebRTC peer connections
71-
- **Room management** with automatic cleanup
72-
- **CORS support** for cross-origin requests
73-
74-
### Frontend (Vanilla JavaScript)
75-
- **WebRTC P2P mesh** for direct peer connections
76-
- **Web Audio API** for audio processing
77-
- **Responsive design** for desktop and mobile
78-
- **Progressive enhancement** for browser compatibility
79-
80-
### Audio Processing
81-
- **Automatic Gain Control (AGC)** - Adjusts volume automatically
82-
- **Noise Suppression** - Reduces background noise
83-
- **Music Mode** - Enhanced settings for instrument tones
84-
- **High-quality audio** - Preserves audio richness via Opus tuning
85-
86-
## 🎯 Use Cases
87-
88-
- **Music jamming sessions** - Share and play music together
89-
- **Voice chats** - High-quality voice conversations
90-
- **Online rehearsals** - Practice sessions with band members
91-
- **Community meetings** - Small group discussions
92-
- **Gaming voice chat** - Low-latency audio for gaming -->
93-
94-
## 🤝 Contributing
95-
96-
We welcome contributions! Please see our [Contributing Guide](docs/CONTRIBUTING.md) for details.
97-
98-
## 📋 Roadmap
99-
100-
See [Roadmap](docs/ROADMAP.md) for detailed development plans and upcoming features for bgce-stream.
101-
102-
## 🛠️ Technology Stack
103-
104-
### Backend
105-
- **Go** - High-performance server
106-
- **Gorilla WebSocket** - WebSocket implementation
107-
- **Standard Library** - Minimal dependencies
108-
109-
### Frontend
110-
- **Vanilla JavaScript** - No frameworks
111-
- **WebRTC** - Peer-to-peer connections
112-
- **Web Audio API** - Audio processing
113-
- **CSS3** - Modern styling
114-
115-
### Infrastructure
116-
- **GitHub** - Version control and collaboration
117-
- **GitHub Actions** - CI/CD (planned)
118-
- **Docker** - Containerization (planned)
119-
120-
## 📄 License
121-
122-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
123-
124-
## 🙏 Acknowledgments
125-
126-
- **WebRTC community** - For the amazing real-time communication technology
127-
- **Go community** - For the excellent ecosystem and tools
128-
- **Contributors** - Everyone who helps make this project better
129-
- **Users** - For feedback and support
130-
131-
## 📞 Support
132-
133-
- **GitHub Issues** - Bug reports and feature requests
134-
- **GitHub Discussions** - Questions and general discussion
135-
- **Email** - [Contact maintainers](mailto:rahim.cse.diu@gmail.com)
136-
137-
## 🌟 Star History
138-
139-
[![Star History Chart](https://api.star-history.com/svg?repos=your-username/bgce-stream&type=Date)](https://star-history.com/#your-username/bgce-stream&Date)
140-
141-
---
142-
143-
### Made with ❤️ for the community
144-
>>>>>>> Stashed changes
17+
### API Endpoints (Optional)
18+
- **`GET /api/status`**: To check if a broadcast is currently live before joining.

SETUP.md

Whitespace-only changes.

frontend/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

frontend/README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## React Compiler
11+
12+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13+
14+
## Expanding the ESLint configuration
15+
16+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
17+
18+
```js
19+
export default defineConfig([
20+
globalIgnores(['dist']),
21+
{
22+
files: ['**/*.{ts,tsx}'],
23+
extends: [
24+
// Other configs...
25+
26+
// Remove tseslint.configs.recommended and replace with this
27+
tseslint.configs.recommendedTypeChecked,
28+
// Alternatively, use this for stricter rules
29+
tseslint.configs.strictTypeChecked,
30+
// Optionally, add this for stylistic rules
31+
tseslint.configs.stylisticTypeChecked,
32+
33+
// Other configs...
34+
],
35+
languageOptions: {
36+
parserOptions: {
37+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
38+
tsconfigRootDir: import.meta.dirname,
39+
},
40+
// other options...
41+
},
42+
},
43+
])
44+
```
45+
46+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47+
48+
```js
49+
// eslint.config.js
50+
import reactX from 'eslint-plugin-react-x'
51+
import reactDom from 'eslint-plugin-react-dom'
52+
53+
export default defineConfig([
54+
globalIgnores(['dist']),
55+
{
56+
files: ['**/*.{ts,tsx}'],
57+
extends: [
58+
// Other configs...
59+
// Enable lint rules for React
60+
reactX.configs['recommended-typescript'],
61+
// Enable lint rules for React DOM
62+
reactDom.configs.recommended,
63+
],
64+
languageOptions: {
65+
parserOptions: {
66+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
67+
tsconfigRootDir: import.meta.dirname,
68+
},
69+
// other options...
70+
},
71+
},
72+
])
73+
```

frontend/eslint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
import { defineConfig, globalIgnores } from 'eslint/config'
7+
8+
export default defineConfig([
9+
globalIgnores(['dist']),
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs.flat.recommended,
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: globals.browser,
21+
},
22+
},
23+
])

frontend/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>frontend</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)