Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peer-Connect

A pet project to learn about servers. Peer-Connect is a full-stack video calling web application inspired by Google Meet. This project was built to explore how real-time communication servers work and to practice system design through the implementation of an SFU (Selective Forwarding Unit) server.

Built With

Frontend

  • React
  • Vite

Backend

  • Python

Key Libraries

  • aiortc — WebRTC implementation
  • aioquic — QUIC and WebTransport implementation

Getting Started

Prerequisites

What you need to run this project:

  • Node.js — v20 or later
  • Python — v3.11 or later
  • OpenSSL — required for generating certificates/keys

Development

Setup

  1. Clone or fork the repository
git clone https://github.com/liusvincent/peer-connect
  1. Go to the project directory
cd peer-connect
  1. Install the frontend dependencies
cd frontend
npm install
  1. Install the backend dependencies.
cd ../backend
python -m venv .venv

Activate the virtual environment: macOS/Linux

source .venv/bin/activate

Windows

.venv\Scripts\activate

Then install the Python dependencies:

pip install -r requirements.txt
  1. Generate a local TLS certificate
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 \
  -keyout key.pem -out cert.pem \
  -days 13 -nodes \
  -subj "/CN=localhost"

Then generate the SHA-256 fingerprint:

openssl x509 -in cert.pem -outform DER | openssl dgst -sha256 | awk '{print toupper($2)}'

Paste the output into frontend/src/services/webtransport.ts

Note

The certificate's validity period must not exceed 14 days. Otherwise, the browser will reject the WebTransport connection during the handshake.

  1. Start the backend server

From the backend directory:

python main.py
  1. Start the frontend development server

Open another terminal and run:

cd frontend
npm run dev
  1. Open the local development URL shown by Vite in your browser http://localhost:5173

Note

Because Peer-Connect uses WebRTC and WebTransport, your browser may require you to trust the locally generated certificate before a WebTransport connection can be established.

Deployment

To be done... Coming soon

Architecture

Peer-Connect uses an SFU server for multi-user video calls. Clients establish WebRTC connections with the SFU, which forwards media tracks between participants. WebTransport is used for communication between the client and server.

For a detailed explanation, see docs/architecture.md.

Documentation

Additional documentation is available in the docs directory. It covers the system design, architectural decisions, design patterns, and overall code structure of the project.

License

This project is licensed under the MIT License. See LICENSE for details.

Releases

Packages

Contributors

Languages