Skip to content

PrivateChatProtocol/private-chat-ui

Private Chat Frontend

A secure, ephemeral chat application with no history, logs, tracking, or authentication.

Node.js Version Bun Version License: MIT PRs Welcome Maintenance GitHub issues Next.js Vercel

This client app requires a running instance of the server.

You can host your own instance, or use the one hosted by Diamonds VPN at chat.vpn.diamonds.

Features

  • Private chat rooms
  • Real-time messaging using WebSockets
  • No message history or logs stored
  • User presence notifications
  • Simple and intuitive UI

Getting Started

Deployment

Deploy with Vercel

Prerequisites

  • Node.js v22.13.1
  • bun 1.1.27

Installation

  1. Clone the repository:

    git clone https://github.com/PrivateChatProtocol/private-chat-ui.git
    cd private-chat-ui
  2. Install dependencies:

    bun install
  3. Create a .env.local file in the root directory:

    # Your frontend URL (development)
    NEXT_PUBLIC_FRONTEND_URL=localhost:3000
    
    # Backend server URL
    NEXT_PUBLIC_SERVER_URL=localhost:8000
    

Development

Start the development server:

bun run dev

Open http://localhost:3000 in your browser to view the client application.

WebSocket Protocol

The server and client uses the following message formats for real-time communication:

Joining a room:

{
  "system": true,
  "type": "JOIN_ROOM",
  "username": "string",
  "roomId": "string"
}

Leaving a room:

{
  "system": true,
  "type": "LEAVE_ROOM",
  "username": "string",
  "roomId": "string"
}

Sending a chat text message:

{
  "system": false,
  "type": "CHAT_MESSAGE",
  "roomId": "string",
  "content": "string",
  "username": "string"
}

Sending a chat image message:

{
  "system": false,
  "type": "IMAGE_MESSAGE",
  "roomId": "string",
  "username": "string",
  "imageData": "string",
  "caption": "string",
  "timestamp": "string"
}

Broadcasting chat members list:

{
  "system": true,
  "type": "USER_LIST",
  "roomId": "string",
  "members": ["string"]
}

Error

{
  "system": true,
  "type": "ERROR",
  "roomId": "string",
  "username": "string",
  "content": "string",
  "timestamp": "string"
}

Contributing

  1. Fork the repository
  2. Create a 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 file for details.

About

Private Chat UI

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •