Skip to content

yashpatil641/DevBrew

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

☕ DevBrew

Coffee chats for developers. Get matched 1:1 with another dev who shares your interests. 15 minutes of real conversation. Then back to work.

Next.js React Socket.IO WebRTC TypeScript Docker


✨ Features

  • 🎯 Interest-Based Matching — Pick your tech interests (React, Kubernetes, AI, etc.) and get matched with developers who share them
  • 📹 HD Video Chat — Real-time peer-to-peer video calls powered by WebRTC
  • ⚡ Instant Connect — No signup required. Jump straight into conversations
  • 🔀 Skip & Match — Not vibing? Skip and instantly find a new partner
  • 🔒 Privacy First — No data stored. Connections are ephemeral

🏗️ Tech Stack

Layer Technology
Frontend Next.js 16, React 19, TypeScript
Real-time Socket.IO for signaling
Video WebRTC with STUN/TURN servers
Backend Node.js, Express, TypeScript
Containerization Docker, Docker Compose, Nginx

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Docker & Docker Compose (for containerized setup)

🐳 Docker

The entire stack is containerized with production-grade Docker practices.

Architecture

flowchart LR
    U[Client Browser] -->|HTTP :80| N[Nginx Reverse Proxy]

    subgraph DN[Docker Network]
        N -->|/| F[Frontend<br/>Next.js :3000]
        N -->|/socket.io| B[Backend<br/>Express :3002]
    end
Loading

Quick Start

# Clone and run — that's it
git clone https://github.com/yashpatil/DevBrew.git
cd DevBrew
make dev

Open http://localhost and you're live.

Make Targets

Command Description
make dev Build & start all services (attached)
make prod Build & start all services (detached)
make build Build all Docker images
make down Stop all containers
make clean Stop, remove images, volumes & orphans
make logs Tail logs from all services
make ps Show running containers

Docker Highlights

  • Multi-stage builds — 3-stage Dockerfiles for both frontend and backend keep final images minimal
  • Non-root users — All containers run as unprivileged users
  • Health checks — Every service has a health check; depends_on uses condition: service_healthy
  • Layer cachingpackage.json copied before source for optimal cache hits
  • Resource limits — CPU and memory constraints on every service
  • Nginx reverse proxy — Routes traffic, upgrades WebSocket connections, gzip compression, security headers
  • Standalone Next.jsoutput: "standalone" produces a self-contained server (~50MB vs ~500MB)

📁 Project Structure

devbrew/
├── backend/
│   ├── src/
│   │   └── index.ts          # WebRTC signaling server
│   ├── Dockerfile            # Multi-stage build
│   ├── .dockerignore
│   ├── package.json
│   └── tsconfig.json
│
├── frontend/
│   ├── app/
│   │   ├── page.tsx          # Landing page
│   │   ├── interests/
│   │   │   └── page.tsx      # Interest selection
│   │   ├── chat/
│   │   │   └── page.tsx      # Video chat room
│   │   ├── globals.css       # Global styles
│   │   └── layout.tsx        # Root layout
│   ├── Dockerfile            # Multi-stage build
│   ├── .dockerignore
│   ├── package.json
│   └── tsconfig.json
│
├── nginx/
│   ├── nginx.conf            # Reverse proxy config
│   └── Dockerfile
│
├── docker-compose.yml        # Full stack orchestration
├── Makefile                  # Developer shortcuts
└── README.md

⚙️ How It Works

  1. User joins → Selects interests → Joins the matching queue
  2. Matching algorithm → Finds best match based on shared interests
  3. WebRTC handshake → Signaling server facilitates offer/answer exchange
  4. Peer connection → Direct video/audio stream between users
  5. Chat ends → User can skip or leave; no data is stored
sequenceDiagram
    participant A as User A (Peer A)
    participant S as Signaling Server
    participant B as User B (Peer B)

    A ->> S: Socket.IO
    S ->> A: Socket.IO
    S ->> B: Socket.IO
    B ->> S: Socket.IO

    Note over A,B: WebRTC Peer Connection (Direct Video/Audio)
Loading

🔧 Configuration

STUN/TURN Servers

The app uses public STUN servers and OpenRelay TURN servers for NAT traversal:

const ICE_SERVERS = {
    iceServers: [
        { urls: 'stun:stun.l.google.com:19302' },
        { urls: 'stun:stun1.l.google.com:19302' },
        {
            urls: 'turn:openrelay.metered.ca:80',
            username: 'openrelayproject',
            credential: 'openrelayproject',
        },
    ],
};

For production, consider using your own TURN server (e.g., Coturn) for reliability.


📦 Deployment

With Docker (Recommended)

make prod

Update NEXT_PUBLIC_SIGNALING_SERVER build arg in docker-compose.yml to your production backend URL.

Without Docker

Backend

cd backend
npm run build
npm start

Frontend

cd frontend
npm run build
npm start

🤝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests

☕ Grab a coffee. Find your people.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors