https://github.com/mementomori11723/simple-chat
A simple chat app built in go, we are using websocket to send data across multiple devices
https://github.com/mementomori11723/simple-chat
go golang http http-server tailwindcss websocket
Last synced: 4 months ago
JSON representation
A simple chat app built in go, we are using websocket to send data across multiple devices
- Host: GitHub
- URL: https://github.com/mementomori11723/simple-chat
- Owner: MementoMori11723
- Created: 2024-11-19T13:31:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-02T10:59:20.000Z (over 1 year ago)
- Last Synced: 2025-03-10T17:58:02.663Z (over 1 year ago)
- Topics: go, golang, http, http-server, tailwindcss, websocket
- Language: Go
- Homepage:
- Size: 36.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Chat
Simple Chat is a lightweight real-time chat application that allows multiple users to communicate instantly. It uses WebSockets for efficient message delivery and provides a responsive, user-friendly interface.
## Features
- **Real-time Messaging**: Instant message delivery using WebSockets.
- **Go Backend**: The server is built with Go for performance and simplicity.
- **Dynamic Templates**: HTML templates with Go's `template` package for dynamic content rendering.
- **TailwindCSS**: Responsive and modern UI design using TailwindCSS CDN.
## Project Structure
- **Server**: A Go-based WebSocket server that manages connections and broadcasts messages.
- **Frontend**: Built with HTML templates, styled using TailwindCSS, and rendered dynamically.
- **Templates**: Uses Go's `template` package with `{{ template "title" . }}` syntax for embedding dynamic data.
## Installation
1. **Clone the Repository**:
```bash
git clone https://github.com/MementoMori11723/Simple-Chat.git
cd simple-chat
```
2. **Run the Application**:
Ensure you have `make` and `go` installed. Then, run the following command:
```bash
make run
```
Or, you can use the following commands:
```bash
make
```
Or, you can also run the application manually:
```bash
go run .
```
3. **Access the Application**:
Open your browser and go to `http://localhost:8080`.
## Usage
- Navigate to the homepage to join the chat room.
- Start chatting with other connected users.
- Error handling is implemented for invalid routes.
## File Structure
- **`app.go`**: Main server file.
- **`pages/`**: Contains HTML templates (`index.html`, `layouts.html`, `error.html`).
- **`Makefile`**: Simplifies running the application.
## Future Improvements
- User authentication.
- Private messaging.
- Chat history storage.
---
Feel free to customize further if needed!