Giter VIP home page Giter VIP logo

yangqi93 / webstack-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ch3nnn/webstack-go

0.0 0.0 0.0 10.34 MB

❤️ 基于 Golang 开源的网址导航网站项目,具备完整的前后台,您可以拿来制作自己平日收藏的网址导航。

Home Page: http://47.94.59.82:9999/

License: MIT License

Shell 0.15% JavaScript 15.76% Go 49.31% HTML 34.64% Batchfile 0.04% Dockerfile 0.10%

webstack-go's Introduction

webstack-go 网址导航后台系统

基于 Golang 开源的网址导航网站项目,具备完整的前后台,您可以拿来制作自己平日收藏的网址导航。

原有后端项目基础上新增功能:

  • 新增 webstack - 导航首页
  • 新增 系统管理员 - 网站分类
  • 新增 系统管理员 - 网站列表
  • 网站新增支持自动获取标题、Logo、网站描述
  • 新增 docker-compose.yml 一键安装各组件
  • 新增 首页看板娘
  • 批量添加网址
  • 优化: GEN 代码生成
  • 图片管理
  • 城市天气, 每日一句经典语录

快速开始

一、运行环境

安装 Golang、Mysql、Redis

  • Golang 1.16+ 因为使用了 //go:embed 特性;
  • MySQL
    • 连接地址,例如:127.0.0.1:3306;
    • 数据库名,例如:webstack,会在此数据库下初始化数据表;
    • 用户名,不可为空;
    • 密码,不可为空;
  • Redis
    • 连接地址,例如:127.0.0.1:6379;
    • 密码,可为空;
    • 连接DB,默认是 0 ;

二、启动服务

两种方式运行 1. 源码启动服务 2. Docker启动服务

一、源码运行服务

  1. 目录下执行 go mod tidy 拉取项目依赖库

  2. 安装完依赖执行 go run main.go 首次启动程序之后,会在浏览器中自动打开安装界面,链接地址:http://127.0.0.1:9999/install

  3. 点击 初始化项目 会看到如下图所示, 如果提示重新运行服务说明项目初始化完成, 只需重新运行服务就 OK 了!

二、Docker运行服务

包含两部分 1. 基础服务(Mysql、Redis、Service) 2. 监控服务(Prometheus、Grafana)

一、基础服务

  1. 目录下执行 docker-compose -f docker-compose.yml up -d 等待基础组件启动 (Mysql、Redis、Service)

    $ docker-compose -f docker-compose.yml up -d
    [+] Running 4/4
    ✔ Network webstack-go            Created                                                                                                                0.1s
    ✔ Container webstack-go-mysql    Healthy                                                                                                               12.9s
    ✔ Container webstack-go-redis    Healthy                                                                                                               13.4s
    ✔ Container webstack-go-service  Started  
  2. 执行docker-compose -f docker-compose.yml ps 服务正常运行如下

    NAME                  IMAGE                             COMMAND                  SERVICE               CREATED             STATUS                   PORTS
    webstack-go-mysql     mysql/mysql-server:5.7            "/entrypoint.sh mysq…"   webstack-go-mysql     2 minutes ago       Up 2 minutes (healthy)   0.0.0.0:3306->3306/tcp, 33060/tcp
    webstack-go-redis     redis:6.2.4                       "docker-entrypoint.s…"   webstack-go-redis     2 minutes ago       Up 2 minutes (healthy)   0.0.0.0:6379->6379/tcp
    webstack-go-service   webstack-go-webstack-go-service   "./webstack-go -env …"   webstack-go-service   2 minutes ago       Up 2 minutes (healthy)   0.0.0.0:9999->9999/tcp
  3. docker container 正常运行后, 在浏览器中打开安装界面,链接地址:http://127.0.0.1:9999/install

  4. 点击 初始化项目 会看到如下图所示, 如果提示重新运行服务说明项目初始化完成, 只需重新运行 webstack-go-service 容器服务就 OK 了!

二、prometheus、grafana监控服务

注: 监控服务看自己是否需要, 不运行也不影响正常使用

  1. 目录下执行 docker-compose -f docker-compose-prometheus.yml up -d 等待监控组件启动 (Prometheus、Grafana)
    [+] Running 4/4
    ✔ Container webstack-go-prometheus  Started                                                                                                             4.0s
    ✔ Container webstack-go-loki        Started                                                                                                             3.6s
    ✔ Container webstack-go-grafana     Started                                                                                                             4.3s
    ✔ Container webstack-go-promtail    Started  
  2. 执行docker-compose -f docker-compose-prometheus.yml ps 服务正常运行如下
      NAME                     IMAGE                              COMMAND                  SERVICE                  CREATED             STATUS                   PORTS
      webstack-go-grafana      grafana/grafana-enterprise:9.4.3   "/run.sh"                webstack-go-grafana      2 minutes ago       Up 2 minutes             0.0.0.0:3000->3000/tcp
      webstack-go-loki         grafana/loki:2.7.3                 "/usr/bin/loki -conf…"   webstack-go-loki         2 minutes ago       Up 2 minutes             0.0.0.0:3100->3100/tcp
      webstack-go-mysql        mysql/mysql-server:5.7             "/entrypoint.sh mysq…"   webstack-go-mysql        3 minutes ago       Up 3 minutes (healthy)   0.0.0.0:3306->3306/tcp, 33060/tcp
      webstack-go-prometheus   prom/prometheus:latest             "/bin/prometheus --c…"   webstack-go-prometheus   2 minutes ago       Up 2 minutes             0.0.0.0:9090->9090/tcp
      webstack-go-promtail     grafana/promtail:2.7.3             "/usr/bin/promtail -…"   webstack-go-promtail     2 minutes ago       Up 2 minutes             
      webstack-go-redis        redis:6.2.4                        "docker-entrypoint.s…"   webstack-go-redis        3 minutes ago       Up 3 minutes (healthy)   0.0.0.0:6379->6379/tcp
      webstack-go-service      webstack-go-webstack-go-service    "./webstack-go -env …"   webstack-go-service      3 minutes ago       Up 3 minutes (healthy)   0.0.0.0:9999->9999/tcp

Star History

Star History Chart

效果图

首页

网站分类

新增网站

网站信息

监控组件

grafana.png

webstack-go's People

Contributors

ch3nnn avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.