Coder Social home page Coder Social logo

aweme's Introduction

aweme

一个轻量级短视频应用程序后端

Codacy Badge Go Report Card build license Codecov Docker Image Size (latest semver)

项目结构

.
├── .github
├── cmd
│   └── aweme/main.go
├── configs
│   └── config.yml
├── docker-compose.yml
├── docs
├── internal
├── readme.md
├── renovate.json
└── scripts
    ├── codegen.sh
    ├── schema.sql
    ├── .env
    └── Dockerfile
  • .github/workflows: 该目录包含了 GitHub Actions 的配置文件。
  • cmd: 该目录包含了项目的入口包,即 main() 函数所在。
  • configs: 该目录包含了项目的配置文件,例如:数据库配置、日志配置等。
  • docker-compose.yml: 该文件用于在 Docker 环境下运行项目时所需的配置。
  • docs: 该目录包含项目的 API 文档, 可以使用 codegen.sh 脚本生成。
  • internal: 该目录包含项目的内部代码逻辑,例如:API 定义、数据访问层、逻辑层等。
  • scripts: 该目录包含项目的脚本文件,例如:代码生成脚本、数据库脚本等。
  • scripts/.env 文件包含了作为环境变量的配置信息,请按需填写,例如:数据库连接信息、密钥等。

kubernetes 部署

以下操作在默认的 namespace 下进行,如果需要部署到其他 namespace,请在命令中指定。

  1. 创建配置

    kubectl create cm aweme-config --from-file=aweme-app-config.yaml=configs/config.yml --from-file=aweme-app-schema.sql=scripts/schema.sql
  2. 创建 secret,其中包括了数据库连接信息、密钥等

    kubectl -f deploy/secret.yaml
  3. 部署 MySQL 和 redis 及相关 headless service

    kubectl -f deploy/mysql.yaml
    kubectl -f deploy/redis.yaml
  4. 部署应用及相关 service

    kubectl -f deploy/aweme.yaml
  5. (可选)配置 HPA 水平自动伸缩

    kubectl -f deploy/aweme-hpa.yaml

运行

项目运行可参考以下步骤:

  1. 在项目目录下,运行 scripts/codegen.sh 脚本来生成项目所需的代码,包括测试代码和 API 文档,(可选)在运行该脚本时,指定 MOCKERY 环境变量,以告诉脚本使用 Mockery 工具生成相应的 Mock 代码用于逻辑层测试。
  2. 根据实际情况修改 scripts 下的 .env 文件,并在其中配置环境变量,例如:数据库连接信息、密钥等。
  3. 运行 docker-compose up 命令来启动项目。该命令会根据 docker-compose.yml 文件中的配置来构建和启动项目的容器。

aweme's People

Contributors

sixwaaaay avatar renovate[bot] avatar restyled-io[bot] avatar yoreg123 avatar

Stargazers

 avatar

Forkers

sixwaaaay

aweme's Issues

refactor data access layer interface into command and query classes

we need to split the data access layer interface into smaller methods that perform specific tasks. This will make the code more readable, maintainable and testable.

  • The data access layer interface should have smaller and more focused methods
  • The logic layer code should work as expected with the new methods

add basic ci

automating the integration of code changes

  • continuous go test
  • continuous go build

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update module github.com/data-dog/go-sqlmock to v1.5.2
  • chore(deps): update mysql docker tag to v8.4
  • fix(deps): update module github.com/labstack/echo-jwt/v4 to v4.2.0
  • fix(deps): update module github.com/labstack/echo/v4 to v4.12.0
  • fix(deps): update module github.com/sony/sonyflake to v1.2.0
  • fix(deps): update module github.com/stretchr/testify to v1.9.0
  • fix(deps): update module github.com/uptrace/opentelemetry-go-extra/otelgorm to v0.3.1
  • fix(deps): update module go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho to v0.53.0
  • fix(deps): update module go.uber.org/fx to v1.22.2
  • fix(deps): update module go.uber.org/zap to v1.27.0
  • fix(deps): update module gorm.io/plugin/dbresolver to v1.5.2
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-go action to v5
  • chore(deps): update codecov/codecov-action action to v4
  • chore(deps): update docker/build-push-action action to v6
  • chore(deps): update docker/login-action action to v3
  • chore(deps): update goreleaser/goreleaser-action action to v6
  • chore(deps): update mysql docker tag to v9
  • fix(deps): update module github.com/golang-jwt/jwt/v4 to v5
  • fix(deps): update opentelemetry-go monorepo to v1 (major) (go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc, go.opentelemetry.io/otel/metric, go.opentelemetry.io/otel/sdk/metric)
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
scripts/Dockerfile
github-actions
.github/workflows/ci.yaml
  • actions/checkout v3
  • actions/setup-go v4
  • codecov/codecov-action v3
  • actions/checkout v3
  • actions/setup-go v4
  • docker/login-action v2
  • docker/build-push-action v4
  • mysql 8.0
.github/workflows/release.yaml
  • actions/checkout v3
  • actions/setup-go v4
  • goreleaser/goreleaser-action v4
  • actions/checkout v3
  • actions/setup-go v4
  • docker/login-action v2
  • docker/build-push-action v4
gomod
go.mod
  • go 1.19
  • github.com/DATA-DOG/go-sqlmock v1.5.0
  • github.com/alicebob/miniredis/v2 v2.30.1
  • github.com/brpaz/echozap v1.1.3
  • github.com/go-playground/validator/v10 v10.11.2
  • github.com/golang-jwt/jwt/v4 v4.5.0
  • github.com/labstack/echo-jwt/v4 v4.1.0
  • github.com/labstack/echo/v4 v4.10.2
  • github.com/minio/minio-go/v7 v7.0.50
  • github.com/redis/go-redis/extra/redisotel/v9 v9.0.2
  • github.com/redis/go-redis/v9 v9.0.2
  • github.com/sony/sonyflake v1.1.0
  • github.com/stretchr/testify v1.8.2
  • github.com/swaggo/echo-swagger v1.3.5
  • github.com/swaggo/swag v1.8.10
  • github.com/uptrace/opentelemetry-go-extra/otelgorm v0.1.21
  • go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.40.0
  • go.opentelemetry.io/contrib/instrumentation/runtime v0.39.0
  • go.opentelemetry.io/otel v1.14.0
  • go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.36.0
  • go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.13.0
  • go.opentelemetry.io/otel/metric v0.36.0
  • go.opentelemetry.io/otel/sdk v1.14.0
  • go.opentelemetry.io/otel/sdk/metric v0.36.0
  • go.uber.org/fx v1.19.2
  • go.uber.org/zap v1.24.0
  • golang.org/x/crypto v0.6.0
  • gopkg.in/yaml.v3 v3.0.1
  • gorm.io/driver/mysql v1.4.7
  • gorm.io/gorm v1.24.5
  • gorm.io/plugin/dbresolver v1.4.1
  • moul.io/zapgorm2 v1.3.0

  • Check this box to trigger a request for Renovate to run again on this repository

release workflow is needed

trigger:
git tag x.y.z

tool:
goreleaser
target platforms:

  • windows
  • linux
    target arch:
  • amd64

windows with zip format
linux with tar.gz format

publish list query

query the video published by specified user

  1. API handler changes
  2. logic

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.