Location>code7788 >text

I open source a short video application (Go+React)|DouTok2.0 Project Information

Popularity:214 ℃/2024-10-30 13:30:14

preamble

Hello everyone, this is Shirazawa here, sorry for dragging out this article for a while. This post came out after DouTok 2.0 could initially allow people to access development.

DouTok: an open source web-based short video application, using microservices architecture, including front and back end (React & Go), DouTok is in the early stages of development, has completed the basic user registration, login, user information management, video upload, video list display, comments, likes, favorites and other functions.

image-20241030091521273

Why have a V2 version:

Example:DouTok It's a Byte Jump Youth Camp entry, but theDouTok1.0 Version of the microservice division is not reasonable enough, the split is too fragmented, may seem very "microservice", but with the actual work of the production environment on the division of services is contrary to the division of microservices should not be too much pursuit of "micro", but rather to adapt to the development of the project in the improvement of the basic design under the premise of the split. Instead, it should be adapted to the development of the project and be split under the premise of improving the basic design.

have sb do sthDouTok Another sticking point for continued expansion is the fact that it has no front-end of its own and relies on the "Shake" app available at the youth camp.DouTok The expansion went smoothly, so we decided to develop a brand new V2 version. In the V2 version, theDouTok Reduced division of services and increasedFront-end projects, while still incomplete at this stage, has the soil for continued expansion.

For those who have participated inDouTok1.0 All the students who maintained it were thanked!

image-20241029233433568

Follow-up planning

  • Front End:

    • Functions: page layout coordination and event jump refinement, etc.
    • Performance: React component optimization and refinement, etc.
  • Rear end:

    • Functions: Chatting system (IM), video recommendation, message push, private message, etc.
    • Performance: observability, stress testing, cache or message queue access, etc.

Participation in contributions

Whether you'refront-end developerneverthelessBackend DeveloperAll can participate in theDouTok We welcome you to join us in the development of the

🌟 Warehouse Address/cloudzenith/DouTok

🔥 How to get involved in contributing:/DouTok/community

🐧 QQ Group: 622383022

📺 Station B Explained:ShirasawaTalk

🔑 Open Source Learning Warehouse:go-learning

Quick Start

This tutorial will walk you through the step-by-step process of building and launching theDouTok projects, and can be read selectively if the reader already has knowledge of the subject.

Refer to the documentation station for all information (very detailed):/DouTok/docs/quickstart/

Project Architecture

image-20241029222657307

Main Catalog

This is a megastore project, all services are in this repository with the following directory structure:

  • backend: backend service
  • frontend: front-end service
  • test: test
  • deploy: Deployment
  • docs-site: docs-site
  • env: Dependency Deployment
  • sql: database script

Page Showcase

  • Upload Video

image-20241030000520491

  • video

image-20241029235126428

  • Comments & Likes & Follows

image-20241029235154405

environmental preparation

  1. Golang 1.22+

    • /dl/
    • /dl/
  2. Node 14.17+

    • /en/download/
  3. +

    • /
    • /
  4. JetBrains GoLand/WebStorem

    • /
  5. VSCode

    • /
  6. Docker

    • /products/docker-desktop

Configuration and startup of necessary components

  • Consul: Adoptedbackend/gopkgs/launcherProvides the ability for all back-end services to be automatically registered to Consul
  • Redis: Caching
  • MySQL: Persistent Storage
  • MinIO: Object Storage
  • RocketMQ: Message Queue (not required)
  1. locateenv/file with the commanddocker-compose -f ./env/ up -dStart Consul, Redis, MySQL, MinIO
    (Steps 2 and 3 are not required)
  2. locateenv/rocketmq/file, which willbrokerIP1Change to local LAN IP
  3. locateenv/file with the commanddocker-compose -f ./env/ up -dStarting RocketMQ

MySQL Library Table Structure Synchronization

  1. go intosqlcatalogs
  2. probesql/Makefilefile, which involves a MySQL connection that should be consistent with the local environment.
  3. To install the goose tool, rungo install /pressly/goose/v3/cmd/goose@latest
  4. fulfillmentmake upcommand, the MySQL library table structure is synchronized to the local

Start the back-end service

compile and run

  1. go intobackenddirectories other thangopkgsAll service catalogs other thango run cmd/ Starting services

mirror image run

  1. go intobackenddirectories other thangopkgsAll service catalogs outside of themake buildto compile the Docker image
  2. go intoenvCatalog, checkconfigsThe configuration files should be consistent with your local environment, especially the./baseservice/ Middle. Need to change the local area network IP of this machine
  3. go intoenvdirectory, execute thedocker-compose -f up -dStart all back-end services

Starting front-end services

  1. go intofrontend/doutokdirectory, execute thepnpm installInstallation of dependencies
  2. fulfillmentpnpm devStart the front-end service byhttp://localhost:23000 interviews

wrap-up

Ongoing updates are welcome.