Community system build using GoFrame.

Focus聚焦社区

Focus聚焦社区GoFrame社区项目,采用了简洁强大的GoFrame作为后端WEB框架, 由于前台系统需要SEO因此使用了GF自带template模板引擎,数据库用MySQL,前端使用jQuery/bootstrap框架。

一、源码地址

二、演示地址

请不要恶意发送垃圾数据哦~ 地址:https://focus.goframe.org/

三、安装部署

安装

1、下载项目源码: git clone [https://github.com/gogf/focus](https://github.com/gogf/focus)

2、创建focus数据库:

CREATE DATABASE `focus` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin';

3、运行documentfocus.sql初始化数据库SQL

4、复制configconfig.example.tomlconfig.toml配置文件,其他配置根据需要自行调整。

# 数据库配置
[database]
    link  = "mysql:root:123456@tcp(127.0.0.1:3306)/focus"
    debug = true

5、运行:go run main.go

6、访问 http://127.0.0.1:8199 即可看到登录页面,默认账号/密码:goframe / 123456

部署

1、安装gf-cli工具链,详情查看:开发工具

2、打包命令:执行 gf build 即可,具体配置请参考:build 交叉编译

3、打包结果:默认 linux/macos/windows 三个版本。

bin
├── darwin_amd64
│   └── focus
├── linux_amd64
│   └── focus
└── windows_amd64
    └── focus.exe

4、将config.tomlfocus放到同一级目录,启动focus即可。

发布

默认配置文件配置中,会将public,template目录进行二进制打包,随着可执行文件一同发布。因此,发布时仅需要将config.tomlfocus拷贝到目标服务器运行即可。此外,您也可以考虑将特定的配置文件用打包发布,那么发布时仅需要发布focus可执行文件即可。

如果您想同时打包配置文件到可执行文件中,那么您可以同时参考一下关于默认配置文件读取的修改方式:配置管理里#默认文件修改

四、项目结构

├── app
│ ├── dao
│ ├── model
│ ├── shared
│ └── system
│     ├── admin
│     │ └── internal
│     └── index
│         └── internal
│             ├── api
│             ├── define
│             └── service
├── config
├── document
├── library
├── packed
├── public
├── template
├── upload
├── Dockerfile
├── go.mod
└── main.go

五、目录说明

目录/文件名称 说明 描述
app 业务逻辑层 所有的业务逻辑存放目录。
- dao 数据访问 数据库的访问操作,仅包含最基础的数据库CURD方法。
- model 数据模型 存放数据相关的实体结构定义。
- system 系统模块 内部可能包含多个子系统,不同子系统之间资源相互隔离。
    - index 前端页面 子系统,前端页面。
        - internal 内部模块 系统内部模块,仅供当前内部系统调用,无法在系统间共享。
          - api 业务接口 系统内部接收/解析用户输入参数的入口/接口层
          - define 结构定义 系统内部的输入、输出数据结构定义。
          - service 逻辑封装 系统内部业务逻辑封装,实现特定的业务需求。
config 配置管理 所有的配置文件存放目录。
docker 镜像文件 Docker镜像相关依赖文件,脚本文件等等。
document 项目文档 Documentation项目文档,如: 设计文档、帮助文档等等。
library 公共库包 公共的功能封装包,往往不包含业务需求实现。
packed 打包目录 将资源文件打包的Go文件存放在这里,boot包初始化时会自动调用。
public 静态目录 仅有该目录下的文件才能对外提供静态服务访问。
template 模板文件 MVC模板文件存放的目录。
Dockerfile 镜像描述 云原生时代用于编译生成Docker镜像的描述文件。
go.mod 依赖管理 使用Go Module包管理的依赖描述文件。
main.go 入口文件 程序入口文件。

六、框架设计

由于采用了强大易用的GoFrame开发框架,可以参考框架的一些设计介绍。

七、项目截图

图1. 社区首页

图2. 登录页面

图3. 注册页面

图4. 发布/编辑页面

图5. 内容详情

图6. 搜索页面

图7. 个人主页

图8. 编辑资料

八、数据库表设计

image

九、功能模块进度

Similar Resources

A dataviz framework help gopher to build a admin panel in ten minutes

A dataviz framework help gopher to build a admin panel in ten minutes

the missing golang data admin panel builder tool. Documentation | 中文文档 | DEMO Inspired by laravel-admin Preface GoAdmin is a toolkit to help you build

Oct 17, 2022

The source code for workshop Scalable architecture using Redis as backend database using Golang + Redis

The source code for workshop Scalable architecture using Redis as backend database using Golang + Redis

Sep 23, 2022

A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy

A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy

Fake-SMS A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a pr

Dec 31, 2022

:construction: Closed. A website and user system (Gin/Backbone).

A website and user system starter. Implemented with gin and Backbone. Gowall is port of Drywall Go Node.js Repository here Drywall Site Gowall Drywall

Jul 6, 2020

Hammond is a self hosted vehicle management system to track fuel and other expenses related to all of your vehicles.

Hammond is a self hosted vehicle management system to track fuel and other expenses related to all of your vehicles.

Hammond is a self hosted vehicle management system to track fuel and other expenses related to all of your vehicles. It supports multiple users sharing multiple vehicles. It is the logical successor to Clarkson which has not been updated for quite some time now.

Jan 2, 2023

Everything a semantic desktop search engine combined with a single-user document management system

Everything will be a semantic desktop search engine combined with a single-user document management system. It will apply ideas of the semantic web and knowledge graphs to organize your data, allowing you to maintain private knowledge graphs as well as make use of public knowledge graphs, such as Wikidata.

May 21, 2022

📈 Reincarnation of mrratality - MRR analytics system for SaaS-apps

remrratality Перерождение проекта mrratality с улучшенной архитектурой и стеком. Данный проект будет использован для лабораторных работ по курсам "Тес

Sep 25, 2022

Gazer system is used to track data.

Gazer System - 凝视系统 这是一个用于长期追踪数据变化的工具。 我们常需要定时针对某些链接进行爬取,以获取历史数据,这个系统为此而生。这是一组无状态的服务,意味着它可以简单地水平扩展。它提供了如下几个功能: 自动代理:使用洋葱路由进行代理,无需自行维护 IP 池,也可以绕过大多数基于

Nov 24, 2022

Golang beego framework based personal simple blog system

Golang beego framework based personal simple blog system

goblog 基于Golang的个人简易博客系统 [TOC] goblog介绍 goblog基于go语言开发的一个简约版个人博客系统,基于Golang语言编写,后端基于了Beego的web框架,目前具备博文系统最基础的功能模块.基本上是一个拿来即用的个人博文平台,只需要部署一个mysql数据存储服务

Nov 9, 2021
Comments
  • 打包发布到linux服务器报错,在mac下运行二进制包没有问题

    打包发布到linux服务器报错,在mac下运行二进制包没有问题

    CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go 包发布到linux服务器报错

    CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go 在mac下运行二进制包没有问题

    [root@vm172-31-16-137 focus]# ./main 2021-01-08 14:28:23.345 [FATA] SetServerRoot failed: cannot find file/folder "public" in following paths:

    1. /home/docker/focus Stack:
    2. github.com/gogf/gf/net/ghttp.(*Server).SetServerRoot /Users/mac/go/pkg/mod/github.com/gogf/[email protected]/net/ghttp/ghttp_server_config_static.go:56
    3. github.com/gogf/gf/net/ghttp.(*Server).SetConfig /Users/mac/go/pkg/mod/github.com/gogf/[email protected]/net/ghttp/ghttp_server_config.go:306
    4. github.com/gogf/gf/net/ghttp.(*Server).SetConfigWithMap /Users/mac/go/pkg/mod/github.com/gogf/[email protected]/net/ghttp/ghttp_server_config.go:298
    5. github.com/gogf/gf/frame/gins.Server.func1 /Users/mac/go/pkg/mod/github.com/gogf/[email protected]/frame/gins/gins_server.go:37
    6. github.com/gogf/gf/container/gmap.(*StrAnyMap).doSetWithLockCheck /Users/mac/go/pkg/mod/github.com/gogf/[email protected]/container/gmap/gmap_hash_str_any_map.go:217
    7. github.com/gogf/gf/container/gmap.(*StrAnyMap).GetOrSetFuncLock /Users/mac/go/pkg/mod/github.com/gogf/[email protected]/container/gmap/gmap_hash_str_any_map.go:254
    8. github.com/gogf/gf/frame/gins.Server /Users/mac/go/pkg/mod/github.com/gogf/[email protected]/frame/gins/gins_server.go:23
    9. github.com/gogf/gf/frame/g.Server /Users/mac/go/pkg/mod/github.com/gogf/[email protected]/frame/g/g_object.go:30
    10. focus/app.Run /Users/mac/go/src/focus/app/app.go:19
    11. main.main /Users/mac/go/src/focus/main.go:12
Soong is the replacement for the old Android make-based build system

Soong Soong is the replacement for the old Android make-based build system. It replaces Android.mk files with Android.bp files, which are JSON-like si

Oct 10, 2021
REST-API specifically build to support online store system of Zahir
REST-API specifically build to support online store system of Zahir

Rest Test. • From Above ERD please create Rest full API. Create register API(Include Generate password). • Acceptance o Phone number and email is uniq

Nov 15, 2021
DCreater - Build your own blog system with golang

DCreater - Build your own blog system with golang

Aug 18, 2022
Extensible wiki system using CouchDB and written in Golang
Extensible wiki system using CouchDB and written in Golang

Wikifeat Introduction Wikifeat is an open source collaboration platform built around the ever-popular Wiki concept. It is meant to be extensible and h

Aug 23, 2022
A golang framework helps gopher to build a data visualization and admin panel in ten minutes
A golang framework helps gopher to build a data visualization and admin panel in ten minutes

the missing golang data admin panel builder tool. Documentation | 中文介绍 | DEMO | 中文DEMO | Twitter | Forum Inspired by laravel-admin Preface GoAdmin is

Dec 30, 2022
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.

GraphJin gives you a high performance GraphQL API without you having to write any code. GraphQL is automagically compiled into an efficient SQL query. Use it either as a library or a standalone service.

Dec 29, 2022
🔥 Hugo website builder, Hugo themes & Hugo CMS. No code, build with widgets!
🔥 Hugo website builder, Hugo themes & Hugo CMS. No code, build with widgets!

Wowchemy: the website builder for Hugo Join 750,000+ Sites. No Code. Easily Create Future-Proof Websites ✏️ ?? ?? ?? 1. Create any kind of website

Jan 9, 2023
REST server to build and install multicloud environments based on shared.configV2

builder A REST server to build and install multicloud environments based on shared.configV2 json For configuration, please see the Documentation Below

Nov 2, 2021
Build a TodoList with Go Design and implement a backend RESTful service in golang with CRUD

May we ask Igor to do a little project in leu of sample code? If there is a hire, the hours spent should be invoiced, so please keep track of that. Th

May 5, 2022
GoAdmin is a toolkit to help you build a data visualization admin panel for your golang app.
GoAdmin is a toolkit to help you build a data visualization admin panel for your golang app.

the missing golang data admin panel builder tool. Documentation | 中文文档 | 中文介绍 | DEMO | 中文DEMO | Twitter | Forum Inspired by laravel-admin Preface GoAd

Nov 25, 2021