Skip to content

waylonhsuP/antigravity_short_url_test

Repository files navigation

短網址服務 (Short URL Service)

本專案是一個全功能的短網址服務,包含使用者認證、短網址管理、自動過期與轉址功能。

本專案由 Google DeepMind 開發的 AntiGravity 生成

技術架構

  • Backend: Golang + Gin + Gorm
  • Database: PostgreSQL
  • Frontend: React + Vite (內嵌於 Go 服務中)
  • Infrastructure: Docker + Docker Compose

功能特色

  • 使用者系統: 支援註冊與登入 (JWT Authentication)。
  • 短網址建立:
    • 未登入:可建立匿名短網址。
    • 已登入:建立的短網址會與帳號關聯。
  • 儀表板: 登入後可管理自己的短網址 (查看、編輯、刪除、延長效期)。
  • 自動過期: 短網址預設存活時間為 3 天。
  • 現代化介面: 深色模式 (Dark Mode) 設計。

如何執行

前置需求

  • Docker
  • Docker Compose

啟動步驟

  1. 產生環境變數 為了安全起見,請先執行腳本產生隨機的資料庫密碼與 JWT Secret:

    chmod +x generate_env.sh
    ./generate_env.sh
  2. 啟動服務 使用 Docker Compose 建置並啟動所有服務:

    docker-compose up --build
  3. 訪問應用程式 打開瀏覽器訪問:http://localhost:8080

專案結構

  • cmd/server/: 後端程式進入點。
  • internal/: 後端核心邏輯 (Handlers, Models, Middleware)。
  • web/frontend/: React 前端原始碼。
  • web/templates/: Go HTML 模板。
  • Dockerfile: 多階段建置腳本 (Frontend + Backend)。
  • docker-compose.yml: 服務編排設定。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published