GithubHelp home page GithubHelp logo

gamilian / douyin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hakusai22/douyin

0.0 0.0 0.0 19.8 MB

🐍 第三届字节跳动青训营抖音项目,主要是使用MySQL数据库, Gin+Gorm框架和JWT进行鉴权进行抖音简单实现。

Home Page: https://youthcamp.bytedance.com/

Go 100.00%

douyin's Introduction

douyin

基于 MySql + Gorm + Gin HTTP服务完成的第三届字节跳动青训营--极简抖音后端项目

Contributors Forks Stargazers MIT License GitHub top language


极简抖音App使用说明

Logo

字节青训营抖音项目

· 报告Bug · 提出新特性

img.png

目录

上手指南

开发前的配置要求
安装步骤

项目特点

  1. 基于《接口文档在线分享- Apifox》提供的接口进行开发,使用《极简抖音App使用说明 - 青训营版 》提供的APK进行Demo测试, 功能完整实现 ,前端接口匹配良好。

  2. 代码结构采用 (HTTP API 层 + RPC Service 层+Dao 层) 项目 结构清晰 ,代码 符合规范

  3. 使用 JWT 进行用户token的校验

  4. 使用 Gorm 对 MySQL 进行 ORM 操作;

  5. 数据库表建立了索引和外键约束,对于具有关联性的操作一旦出错立刻回滚,保证数据一致性和安全性

功能介绍

  • 视频:视频推送、视频投稿、发布列表
  • 用户:用户注册、用户登录、用户信息
  • 点赞:点赞操作、点赞列表
  • 评论:评论操作、评论列表
  • 关注:关注操作、关注列表、粉丝列表
git clone https://github.com/haksuai22/douyin.git
go mod tidy
./main.go 

文件目录说明

eg:

filetree
├─douyin(公共基础库,封装一些通用的逻辑)
│  ├─redis_cache(缓存)
│  ├─config(配置文件)
│  ├─controller(于handlers层)
│  ├─middlewares(中间件)
│  ├─models(实体类)
│  └─router(接口path访问路口)
│  └─service(操作数据库)
│  └─static(存储视频图片静态目录)
│  └─util(工具类)
│  └─image(图床)

开发的架构

img.png

本项目采用 MVC 分层设计模型分离模型层、视图层和控制层,从而降低代码的耦合度,提高项目的可维护性。

使用 Gin 作为 Web 框架,Redis 作为缓存框架,MySQL 作为持久层框架。

         ┌─────────┐      ┌─────────┐      ┌─────────┐
  ──req──►         ├──────►         ├──────►         │
         │   Gin   │      │  Redis  │      │  MySQL  │
  ◄─resp─┤         ◄──────┤         ◄──────┤         │

部署

使用到的框架

贡献者

请阅读 CONTRIBUTING.md 查阅为该项目做出贡献的开发者。

如何参与开源项目

贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献都是非常感谢的。

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

版本控制

该项目使用Git进行版本管理。您可以在 repository 参看当前可用版本。

作者

[email protected]

博客:Hakusai

版权说明

该项目签署了MIT 授权许可,详情请参阅 LICENSE.txt

鸣谢

成果演示

img.png

img.png img.png

star 趋势图

Stargazers over time

贡献者

douyin's People

Contributors

hakusai22 avatar hakusai2 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.