RepositoryGoESTây Ban Nha
emarifer

emarifer/gofiber-templ-htmx

Go/Fiber🧬+</>Templ to-do list app with user login and HTMx-powered frontend.

142sao
16fork
0issue
1lượt xem

🧬 Ứng dụng to-do list Go/Fiber + Templ + HTMx với đăng nhập người dùng

Một ứng dụng full-stack hoàn chỉnh: xác thực phiên, CRUD trên SQLite3, giao diện HTMx không cần tải lại trang.

Đây là phiên bản Golang của dự án rust-axum-askama-htmx-todoapp, được xây dựng bằng framework Fiber — nhẹ, nhanh, lấy Fasthttp làm nền tảng. Ứng dụng hỗ trợ đăng nhập/người dùng mới, quản lý danh sách công việc (thêm, sửa, xóa) với cơ sở dữ liệu SQLite3. Mọi tương tác frontend đều thông qua HTMx và hypermedia, mang lại trải nghiệm gần giống SPA mà không cần JavaScript phứ tạp.

✨ Điểm nổi bật

  • Templ thay thế html/template: Dùng a-h/templ — ngôn ngữ m�ẫu giống JSX, biên dịch thành Go, hỗ trợ autocomplete và kiểm tra lỗi thời gian biên dịch.
  • Xác thực phiên bằng middleware Fiber: Đăng nhập/người dùng mới sử dụng session, hỗ trợ flash messages qua thư viện sujit-baniya/flash.
  • CRUD đầy đủ trên SQLite3: Hai bảng (users, todos) liên kết bởi khóa ngoại, hỗ trợ thêm/sửa/xóa công việc.
  • Frontend HTMx không tải lại: Chuyển trang và gửi yêu cầu AJAX mà không cần refresh, mang lại trải nghiệm SPA.
  • Tailwind CSS + DaisyUI từ CDN: Tạo giao diện hiện đại, nhất quán với ít cấu hình.
  • SweetAlert2 thay thế popup JS: Hiển thị thông báo đẹp, nhận diện từ CDN.
  • _hyperscript cho tương tác nhẹ: Đóng thông báo, ẩn/hiện mật khẩu — không cần viết JS phứ tạp.
  • Xử lý lỗi tập trung: Fiber hỗ trợ xử lý 404/500 một cách tập trung và rõ ràng.

💡 Vì sao đáng chú ý

Không chỉ là một ứng dụng to-do đơn thường, dự án kết hợp nhiều công nghệ hiện đại: Fiber để xây backend nhanh, Templ để viết giao diện an toàn kiểu mạnh, HTMx để mang lại trải nghiệm trang mượt mà. Đặc biệt, việc dùng Templ thay vì html/template giúp giảm lỗi runtime, tăng tốc phát triển nhờ autocomplete và kiểm tra kiểu thời gian biên dịch.

Phù hợp cho những ai muốn học hoặc mở rộng một ứng dụng full-stack Go thực tế, đồng thời khám phá cách kết hợp Fiber + Templ + HTMx một cách hiệu quả.


#Go #Fiber #HTMx #Templ #CRUD #SQLite #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryGo
hrshadhin/fiber-go-boilerplate

🚀 Production-ready Golang based boilerplate application with Fiber web framework

101
Jul 1, 2024
RepositoryGo
ollama/ollama

Get up and running with Inkling, Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

188.9k
Dec 2, 2026
RepositoryGo
gofiber/fiber

⚡️ Express inspired web framework written in Go

40.4k
Dec 1, 2026
RepositoryGo
JioTV-Go/jiotv_go

Unlock the magic of JioTV across all your devices, without the need for the JioTV App. Crafted with love in Golang for a delightful blend of speed and efficiency! 🌟✨

766
Nov 25, 2026
RepositoryGo
donseba/go-htmx

Seamless HTMX integration in golang applications

601
Nov 5, 2026
RepositoryGo
emarifer/go-echo-templ-htmx

Go/Echo+Templ+Htmx: Full stack application using Golang's Echo framework & Templ templating language with user session management + CRUD to a SQLite database (To Do List) and HTMX in the frontend

298
Jun 19, 2024
RepositoryGo
indravscode/go-fiber-boilerplate

A boilerplate for building RESTful APIs using Golang, Fiber, and GORM PostgreSQL

222
Dec 13, 2025
RepositoryGo
samber/slog-fiber

🚨 Fiber middleware for slog logger

99
Nov 1, 2026
RepositoryGo
avelino/awesome-go

A curated list of awesome Go frameworks, libraries and software

197.2k
Dec 2, 2026