Skip to content

Teemo4621/Basic-Webchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Realtime Chat 💬

Connect instantly. Chat without limits!
Secure, Fast, Seamless.

Stay connected with friends, teams, or communities through our powerful chat — featuring real-time communication, modern UI, and scalable backend.

Hero Screenshot


🛠 Tech Stack

Frontend

Backend

Database

  • PostgreSQL

Realtime

  • WebSocket (Real-time chat message delivery)

⚙️ Project Structure

Frontend (Next.js 15)

  • Located in the frontend/ folder
  • Handles user interface, routing, and communicates with backend via REST and WebSocket

Backend (Go)

  • Located in the backend/ folder
  • Clean architecture layers: controller, usecase, repository
  • RESTful API and WebSocket endpoint
  • PostgreSQL with GORM for ORM

🚀 Features

  • ✅ Real-time messaging with WebSocket
  • ✅ Secure user authentication
  • ✅ Clean and scalable architecture
  • ✅ Responsive UI
  • ✅ Easy deployment setup
  • ✅ PostgreSQL integration
  • ✅ Production-ready structure

📦 Installation

Prerequisites

  • Go 1.20+
  • Node.js 20+ or Bun
  • PostgreSQL
  • Docker (optional for local development)

Backend Setup

cd backend
go run main.go

Frontend Setup

cd frontend
npm install # or bun install
npm run dev # or bun dev

🔄 WebSocket Usage

  • WebSocket endpoint: ws://localhost:PORT/api/v1/rooms/:room_code/ws
  • Events supported:
    • new_message: receive and broadcast messages in real time
    • member_online: notify when a member joins the room
    • member_offline: notify when a member leaves the room

📁 Example .env for Backend

FIBER_HOST=0.0.0.0
FIBER_PORT=8000

DB_HOST=0.0.0.0
DB_PORT=5432
DB_DATABASE=test
DB_USERNAME=test
DB_PASSWORD=123456789
DB_SSL_MODE=disable

JWT_SECRET=secret
JWT_EXPIRE=1 # hours
JWT_REFRESH_SECRET=refresh_secret
JWT_REFRESH_EXPIRE=24 # hours

📸 Demo Video

2025-05-10.16-15-55.mp4

🤝 Contributing

We welcome contributions! Please fork the repo, create a feature branch, and open a pull request.

🤍 Made with love by ZEMONNUB

About

Basic Webchat is a real-time chat app built with Go (Golang) for the backend and Next.js for the frontend, featuring WebSocket support for instant messaging.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages