GoChat is a real-time chat application developed using a modern tech stack featuring Go+Templ+HTMX+Alpine.js+TailwindCss, and WebSockets. This project showcases a scalable, interactive chat system with efficient server-side rendering and dynamic front-end updates.
- Real-Time Messaging: Leveraging WebSockets for instantaneous, bidirectional communication.
- Dynamic Content Updates: Using HTMX to seamlessly update parts of the web page without full reloads.
- Reactive UI: Enhanced with Alpine.js for minimal overhead and a smooth user experience.
- Server-Side Templating: Implementing Templ to render dynamic content server-side.
- Responsive Design: Styled with Tailwind CSS for a modern, responsive interface.
- Rate Limiting: Protects against spam with configurable message rate limits.
- Go: Backend development for a robust and efficient server-side experience.
- Templ: A templating engine for Go, simplifying dynamic content rendering.
- HTMX: For AJAX requests and dynamic content updates without page reloads.
- Alpine.js: A minimal JavaScript framework to add interactivity with ease.
- WebSockets: Provides real-time messaging capabilities.
- Tailwind CSS: A utility-first CSS framework for designing custom, responsive interfaces.
- Go (version 1.18 or higher)
- A web browser
-
Clone the Repository:
git clone https://github.com/NikoMalik/GoChat
-
Install Dependencies:
go install github.com/air-verse/air@latest go install github.com/a-h/templ/cmd/templ@latest npm install
-
Run the Application:
You will need to open three terminals to run different tasks:
-
Terminal 1: Watch for Templ
make templWatch
-
Terminal 2: Run the Go server
air
-
Terminal 3: Build Tailwind CSS
make tailwind
-
-
Open Your Browser:
Visit
http://localhost:8000
to access GoChat.
- Chat with Others: Enter your username and start sending messages in real-time.
- View Online Users: See who is online and engage with them directly.
- Rate Limiting: Prevents abuse by enforcing message limits.
We welcome contributions to improve GoChat! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b your-feature
). - Make your changes.
git add .
- Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin your-feature
). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.