{"id":19363122,"url":"https://github.com/gogf/focus","last_synced_at":"2026-03-17T23:07:44.198Z","repository":{"id":41059907,"uuid":"325527304","full_name":"gogf/focus","owner":"gogf","description":"Community system build using GoFrame.","archived":false,"fork":false,"pushed_at":"2021-11-21T14:44:50.000Z","size":45526,"stargazers_count":115,"open_issues_count":0,"forks_count":36,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-01-27T11:11:40.117Z","etag":null,"topics":["bbs","community","goframe","mvc","orm","template"],"latest_commit_sha":null,"homepage":"https://goframe.org/pages/viewpage.action?pageId=3672270","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gogf.png","metadata":{"files":{"readme":"README.MD","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-30T10:59:36.000Z","updated_at":"2025-08-07T21:46:41.000Z","dependencies_parsed_at":"2022-07-17T09:30:34.272Z","dependency_job_id":null,"html_url":"https://github.com/gogf/focus","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gogf/focus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogf%2Ffocus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogf%2Ffocus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogf%2Ffocus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogf%2Ffocus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gogf","download_url":"https://codeload.github.com/gogf/focus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogf%2Ffocus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30635156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T22:38:22.569Z","status":"ssl_error","status_checked_at":"2026-03-17T22:38:11.804Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bbs","community","goframe","mvc","orm","template"],"created_at":"2024-11-10T07:32:57.813Z","updated_at":"2026-03-17T23:07:44.178Z","avatar_url":"https://github.com/gogf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `Focus`聚焦社区\n\n\n`Focus聚焦社区`是`GoFrame`社区项目，采用了简洁强大的`GoFrame`作为后端`WEB`框架， 由于前台系统需要`SEO`因此使用了`GF`自带`template`模板引擎，数据库用`MySQL`，前端使用`jQuery`/`bootstrap`框架。\n\n一、源码地址\n======\n\n*   `github`：[https://github.com/gogf/focus](https://github.com/gogf/focus)\n*   `gitee`：[https://gitee.com/johng/focus](https://gitee.com/johng/focus)\n\n二、演示地址\n======\n\n请不要恶意发送垃圾数据哦~ 地址：[https://focus.goframe.org/](https://focus.goframe.org/)\n\n三、安装部署\n======\n\n安装\n--\n\n1、下载项目源码： `git clone [https://github.com/gogf/focus](https://github.com/gogf/focus)`\n\n2、创建`focus`数据库:\n```sql\nCREATE DATABASE `focus` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin';\n```\n3、运行`document`下`focus.sql`初始化数据库`SQL`。\n\n4、复制`config`下`config.example.toml`为`config.toml`配置文件，其他配置根据需要自行调整。\n\n```toml\n# 数据库连接配置\n    [database.default]\n        link   = \"mysql:root:12345678@tcp(127.0.0.1:3306)/focus\"\n        debug  = true\n```\n5、运行：`go run main.go`\n\n6、访问 [http://127.0.0.1:8199](http://127.0.0.1:8199/) 即可看到登录页面，默认账号/密码：`goframe` / `123456`\n\nlinux一键部署\n--\n\n一键部署仅支持linux，并且需要先完成docker-compose安装;\n\n```bash\ngit clone https://github.com/gogf/focus \u0026\u0026 \\\n cd focus \u0026\u0026 chmod 755 focus.sh \u0026\u0026 ./focus.sh build\n```\n\n更多命令，请执行`./focus help`\n\n部署\n--\n\n1、安装`gf-cli`工具链，详情查看：[开发工具](https://itician.org/pages/viewpage.action?pageId=1114260)\n\n2、打包命令：执行 `gf build` 即可，具体配置请参考：[build 交叉编译](https://itician.org/pages/viewpage.action?pageId=1115788)\n\n3、打包结果：默认 `linux/macos/windows` 三个版本。\n```html\nbin\n├── darwin_amd64\n│   └── focus\n├── linux_amd64\n│   └── focus\n└── windows_amd64\n    └── focus.exe\n```\n4、将`config.toml`和`focus`放到同一级目录，启动`focus`即可。\n\n发布\n--\n\n默认配置文件配置中，会将`public,template`目录进行二进制打包，随着可执行文件一同发布。因此，发布时仅需要将`config.toml`和`focus`拷贝到目标服务器运行即可。此外，您也可以考虑将特定的配置文件用打包发布，那么发布时仅需要发布`focus`可执行文件即可。\n\n如果您想同时打包配置文件到可执行文件中，那么您可以同时参考一下关于默认配置文件读取的修改方式：[配置管理里#默认文件修改](https://itician.org/pages/viewpage.action?pageId=1114668#id-%E9%85%8D%E7%BD%AE%E7%AE%A1%E7%90%86-%E9%BB%98%E8%AE%A4%E6%96%87%E4%BB%B6%E4%BF%AE%E6%94%B9)\n\n四、项目结构\n======\n```\n├── app\n│ ├── dao\n│ ├── model\n│ ├── shared\n│ └── system\n│     ├── admin\n│     │ └── internal\n│     └── index\n│         └── internal\n│             ├── api\n│             ├── define\n│             └── service\n├── config\n├── document\n├── library\n├── packed\n├── public\n├── template\n├── upload\n├── Dockerfile\n├── go.mod\n└── main.go\n```\n五、目录说明\n======\n\n|目录/文件名称   | 说明 | 描述\n|---|---|---\n|`app`           | 业务逻辑层 | 所有的业务逻辑存放目录。\n| - `dao`        | 数据访问   | 数据库的访问操作，仅包含最基础的数据库CURD方法。\n| - `model`      | 数据模型   | 存放数据相关的实体结构定义。\n| - `system`     | 系统模块   | 内部可能包含多个子系统，不同子系统之间资源相互隔离。\n| \u0026nbsp; \u0026nbsp; - `index`    | 前端页面 | 子系统，前端页面。\n| \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; - `internal`       | 内部模块 | 系统内部模块，仅供当前内部系统调用，无法在系统间共享。\n| \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; - `api`     | 业务接口 | 系统内部接收/解析用户输入参数的入口/接口层\n| \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; - `define`  | 结构定义 | 系统内部的输入、输出数据结构定义。\n| \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; - `service` | 逻辑封装 | 系统内部业务逻辑封装，实现特定的业务需求。\n|`config`        | 配置管理   | 所有的配置文件存放目录。\n|`docker`        | 镜像文件   | Docker镜像相关依赖文件，脚本文件等等。\n|`document`      | 项目文档   | Documentation项目文档，如: 设计文档、帮助文档等等。\n|`library`       | 公共库包   | 公共的功能封装包，往往不包含业务需求实现。\n|`packed`        | 打包目录   | 将资源文件打包的`Go`文件存放在这里，`boot`包初始化时会自动调用。\n|`public`        | 静态目录   | 仅有该目录下的文件才能对外提供静态服务访问。\n|`template`      | 模板文件   | MVC模板文件存放的目录。\n|`Dockerfile`    | 镜像描述 | 云原生时代用于编译生成Docker镜像的描述文件。\n|`go.mod`        | 依赖管理   | 使用`Go Module`包管理的依赖描述文件。\n|`main.go`       | 入口文件   | 程序入口文件。\n\n六、框架设计\n======\n\n由于采用了强大易用的`GoFrame`开发框架，可以参考框架的一些设计介绍。\n\n*   [代码分层设计](https://itician.org/pages/viewpage.action?pageId=3672442)\n*   [对象封装设计](https://itician.org/pages/viewpage.action?pageId=3672526)\n*   [Context上下文](https://itician.org/pages/viewpage.action?pageId=3672552)\n*   [单应用多系统设计](https://itician.org/pages/viewpage.action?pageId=3672600)\n*   更多：[框架设计](https://itician.org/pages/viewpage.action?pageId=3672399)\n\n七、项目截图\n======\n\n![](document/images/demo1.png)\n\n图1. 社区首页\n\n![](document/images/demo2.png)\n\n图2. 登录页面\n\n![](document/images/demo3.png)\n\n图3. 注册页面\n\n![](document/images/demo4.png)\n\n图4. 发布/编辑页面\n\n![](document/images/demo5.png)\n\n图5. 内容详情\n\n![](document/images/demo6.png)\n\n图6. 搜索页面\n\n![](document/images/demo7.png)\n\n图7. 个人主页\n\n![](document/images/demo8.png)\n\n图8. 编辑资料\n\n八、数据库表设计\n========\n\n![](document/images/databases.png)\n\n九、功能模块进度\n========\n\n![](document/images/plan.png)\n\n十、Focus文档\n========\n\n更多资料请移步：[Focus聚焦社区文档](https://goframe.org/pages/viewpage.action?pageId=3672270)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgogf%2Ffocus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgogf%2Ffocus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgogf%2Ffocus/lists"}