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.
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!
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
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
- video
- Comments & Likes & Follows
environmental preparation
-
Golang 1.22+
- /dl/
- /dl/
-
Node 14.17+
- /en/download/
-
+
- /
- /
-
JetBrains GoLand/WebStorem
- /
-
VSCode
- /
-
Docker
- /products/docker-desktop
Configuration and startup of necessary components
- Consul: Adopted
backend/gopkgs/launcher
Provides 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)
- locate
env/
file with the commanddocker-compose -f ./env/ up -d
Start Consul, Redis, MySQL, MinIO
(Steps 2 and 3 are not required) - locate
env/rocketmq/
file, which willbrokerIP1
Change to local LAN IP - locate
env/
file with the commanddocker-compose -f ./env/ up -d
Starting RocketMQ
MySQL Library Table Structure Synchronization
- go into
sql
catalogs - probe
sql/Makefile
file, which involves a MySQL connection that should be consistent with the local environment. - To install the goose tool, run
go install /pressly/goose/v3/cmd/goose@latest
- fulfillment
make up
command, the MySQL library table structure is synchronized to the local
Start the back-end service
compile and run
- go into
backend
directories other thangopkgs
All service catalogs other thango run cmd/
Starting services
mirror image run
- go into
backend
directories other thangopkgs
All service catalogs outside of themake build
to compile the Docker image - go into
env
Catalog, checkconfigs
The configuration files should be consistent with your local environment, especially the./baseservice/
Middle.Need to change the local area network IP of this machine
- go into
env
directory, execute thedocker-compose -f up -d
Start all back-end services
Starting front-end services
- go into
frontend/doutok
directory, execute thepnpm install
Installation of dependencies - fulfillment
pnpm dev
Start the front-end service byhttp://localhost:23000 interviews
wrap-up
Ongoing updates are welcome.