LessGo is a collection of Go-based projects showcasing various backend functionalities and architectural patterns. Each project is designed to be self-contained and demonstrates specific Go concepts and external integrations.
This repository includes the following projects:
- Go Load Balancer
- Simple Letterboxd
- Go-Redis URL Shortener
- Real-time Chat Application
- Go File-based Database
(More to come...)
This project implements a basic load balancer in Go. It distributes incoming HTTP requests among a predefined set of backend servers using a round-robin algorithm. The load balancer also includes a basic health check to ensure requests are only forwarded to alive servers.
- Round Robin Load Balancing: Distributes requests sequentially among available backend servers.
- Simple Health Checking: Skips over unresponsive servers when selecting a target.
- Reverse Proxy: Forwards requests to backend servers and returns their responses to the client.
- Configurable Backend Servers: Easily add or remove target servers.
This project is a simple backend application for a Letterboxd-like service, built using Go (Golang). It allows users to manage a watchlist of movies, add new movies, update movie details (like adding a review and marking as watched), retrieve all movies, and delete specific or all movies from their watchlist. The backend leverages MongoDB as its database and Gorilla Mux for routing HTTP requests.
It's designed to be a straightforward, RESTful API that can serve as the foundation for a personal movie tracking application.
- Add Movies: Create new movie entries to your watchlist.
- Get All Movies: Retrieve a list of all movies in your watchlist.
- Update Movie (Review & Watched Status): Mark a movie as watched and add a review.
- Delete Single Movie: Remove a specific movie from the watchlist by its ID.
- Delete All Movies: Clear the entire watchlist.
- MongoDB Integration: Persistent storage of movie data.
- RESTful API: Standard HTTP methods for resource manipulation.
A fast and efficient URL shortening service built with Go (Fiber) and Redis, designed for high performance and easy deployment using Docker. This project allows users to shorten long URLs into concise, memorable links, with support for custom short codes and API rate limiting.
- URL Shortening: Convert long URLs into short, easy-to-share links.
- Custom Short Codes: Option to define your own custom short code instead of a randomly generated one.
- API Rate Limiting: Prevents abuse by limiting the number of short links an IP address can generate within a given timeframe.
- Link Redirection: Seamlessly redirects short URLs to their original destinations.
- Redis Caching: Utilizes Redis for ultra-fast storage and retrieval of URL mappings.
- Dockerized Deployment: Easy to set up and run using Docker and Docker Compose.
- Automatic HTTP Enforcement: Ensures URLs have
http://orhttps://for proper redirection. - Domain Blacklisting: Prevents shortening the service's own domain.
This is a real-time chat application built with Go for the backend, and Vite + React + Tailwind CSS for the frontend. It leverages WebSockets for instant message communication between users.
- Real-time Messaging: Instantly send and receive messages using WebSockets.
- Multiple Clients: Supports multiple clients connecting to the chat simultaneously.
- User Connection/Disconnection Notifications: Broadcasts messages to all connected clients when a new user joins or an existing user disconnects.
- Simple and Clean UI: Built with React and styled with Tailwind CSS for a responsive and intuitive user experience.
This provides a file-based key-value store implemented in Go. Data is stored as JSON files within a specified directory structure, with a focus on thread-safe operations for individual collections.
- File-Based Storage: Data persists directly on the filesystem as JSON files.
- Collections: Organize your data into logical groups, similar to tables in a relational database or collections in a NoSQL database.
- Resources (Keys): Each item within a collection is identified by a unique resource name (effectively a key).
- CRUD Operations: Full Create, Read, Update, and Delete functionality.
- Concurrency Safe: Utilizes
sync.Mutexto ensure that write and delete operations on the same collection are thread-safe, preventing data corruption. - Lightweight Logging: Integrates with
github.com/jcelliott/lumberfor basic console logging.
Feel free to fork the repository and contribute!
This project is open source and available under the MIT License.