搭建后端工程骨架(Go + Gin + PostgreSQL)
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- go, postgresql
- Domain
- api, authentication, backend, build-system, databases, observability
Research direction
Review issues #1, #2, #3, and #6 first; this work depends on their decisions, and an open linked pull request (#21) indicates implementation is already underway. The issue names the intended entry points, including cmd/server/main.go, internal/config, internal/repository, migrations/, and docs/openapi.yaml. Done means the listed build, test, health check, migration, middleware, and tooling requirements are met.
Written by the indexing model from the issue text.
Description
Background
TickFlow 后端基座。总体方案见 #1、API 契约见 #3、隔离与权限见 #6、数据模型见 #2。本 issue 只落地工程骨架,不实现业务功能。
Technical requirement
- Go module
github.com/LinuxSuRen/tick-flow,后端代码在仓库顶层cmd/+internal/; - Web 框架 Gin;
- 配置:环境变量优先,可选 YAML 覆盖(监听地址、PostgreSQL DSN、SMTP、上传目录、JWT secret);
- 目录结构:
cmd/server/main.go
internal/
config/ # 配置加载
router/ # 路由注册
middleware/ # RequireAuth / RequireRole / recovery / request id / 访问日志
handler/ # HTTP 入参出参
service/ # 领域逻辑(状态机、事件发布)
repository/ # 数据访问,统一 tenant scope
model/ # 表模型
events/ # 领域事件定义与分发
migrations/ # golang-migrate 迁移文件
docs/openapi.yaml
- 日志:标准库
log/slog,JSON 结构化、分级(高频路径 debug,关键链路出入口 info); - 迁移:golang-migrate,落地 #2 评审通过的初始迁移;
- repository 层提供统一
scope(ctx)helper(见 #6),附单测; GET /healthz:含数据库 ping;- Makefile:
make build / test / lint / run;Dockerfile 多阶段构建(预留前端产物嵌入路径); - 禁止任何硬编码默认账号或默认密码;首启引导走
POST /api/auth/setup。
Expect
go build ./...与go test ./...通过;本地启动后/healthz返回 200;- PR 描述附目录结构说明与启动方式。
Potential TODO list
- go mod init 与目录骨架
- 配置加载 + slog 接入
- golang-migrate 初始迁移(依赖 #2 评审通过)
- auth / role 中间件 + tenant scope helper(含单测)
- healthz、panic recovery、request id、访问日志
- Makefile + Dockerfile
依赖
#2、#3、#6 评审通过。
- Dominant language
- No language data
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LinuxSuRen/tick-flow
-
项目门面:logo、README 与仓库 AboutPossibly taken @linuxsuren-fs claimed this 9 days ago. Opendocumentation good first issue help wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 20/100
LinuxSuRen/tick-flow#20 ·
-
编写四个内置种子模板包Possibly taken @linuxsuren-fs claimed this 9 days ago. Opengood first issue help wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 35/100
LinuxSuRen/tick-flow#19 ·
-
实现处理工作台前端:列表、详情与处理动作Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 5/5 Over a week Newbie friendliness 25/100
LinuxSuRen/tick-flow#18 ·
-
实现提交门户前端:表单渲染器与我的工单Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 25/100
LinuxSuRen/tick-flow#17 ·
-
实现站内通知与邮件通知Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 25/100
LinuxSuRen/tick-flow#16 ·
All issues in LinuxSuRen/tick-flow
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
vetro-protocol/vetro-monorepo#1262 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ProyectoRespira/respira-webapp#334 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100