https://github.com/majdsassi/go-url
Go-Url is a modern, full-stack URL shortener built using Go. It leverages the Gin framework for routing, GORM for ORM/database management, and HTMX for dynamic, responsive frontend behavior. Ideal for developers seeking a practical example of a Go web app with a modern frontend.
https://github.com/majdsassi/go-url
backend gin-framework gin-gonic go go-backend go-htmx go-project golang gorm-orm htmx link-shortener self-hosted url url-shortener
Last synced: 5 months ago
JSON representation
Go-Url is a modern, full-stack URL shortener built using Go. It leverages the Gin framework for routing, GORM for ORM/database management, and HTMX for dynamic, responsive frontend behavior. Ideal for developers seeking a practical example of a Go web app with a modern frontend.
- Host: GitHub
- URL: https://github.com/majdsassi/go-url
- Owner: majdsassi
- Created: 2025-06-14T14:12:38.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-06-14T15:05:34.000Z (9 months ago)
- Last Synced: 2025-06-14T15:41:13.826Z (9 months ago)
- Topics: backend, gin-framework, gin-gonic, go, go-backend, go-htmx, go-project, golang, gorm-orm, htmx, link-shortener, self-hosted, url, url-shortener
- Language: HTML
- Homepage:
- Size: 536 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go-Url
A modern, self-hosted URL shortener built with Go, Gin, GORM, and HTMX.
## ๐ปDemo

## โจ Features
- โ
Create and manage shortened URLs
- ๐ Fast redirects using Gin
- ๐๏ธ Persistent storage with GORM and MySQL
- โก Dynamic frontend updates via HTMX (no page reloads)
- ๐ Unique shortcodes generation
- ๐ Link Visits
## ๐๏ธ Tech Stack
- [Go](https://golang.org/)
- [Gin](https://github.com/gin-gonic/gin) - High-performance web framework
- [GORM](https://gorm.io/) - ORM for Go
- [HTMX](https://htmx.org/) - Modern frontend interaction without full-page reloads
## ๐งช Getting Started
### 1. Clone the Repository
```bash
git clone https://github.com/majdsassi/go-url.git
cd go-url
```
### 2 . Install Dependencies
```go
go mod tidy
```
### 3. Create your local variables
```env
DBURL="db_user:db_password@tcp(127.0.0.1:3306)/db_name?charset=utf8mb4&parseTime=True&loc=Local"
```
(if your db does require a password leave it empty and if ur db is remote change the tcp values with db_url:port )
### 5. Migrate Your Database
```go
go run migration/migrate.go
```
### 6. Run Your App
```go
go run main.go
```
OR Run it Using [CompileDaemon](https://github.com/githubnemo/CompileDaemon)
```bash
CompileDaemon -command="./go-url"
```
## ๐ License
MIT License. See [LICENSE](https://medium.com/@avinashvagh/github-licenses-explained-a-quick-guide-46d98ef4ca81)for details.
## ๐ค Contributing
Pull requests welcome. If you want to add features like analytics, expiration, or QR code generationโgo for it!