Skip to content

Commit d9c7ac5

Browse files
committed
docs: overview
1 parent 094fcb2 commit d9c7ac5

File tree

7 files changed

+315
-0
lines changed

7 files changed

+315
-0
lines changed

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/.vitepress/cache
2+
**/.vitepress/dist
3+
node_modules

docs/.vitepress/config.mts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
export default defineConfig({
4+
title: "sharing",
5+
description: "document for sharing",
6+
themeConfig: {
7+
nav: [
8+
{ text: 'Home', link: '/' },
9+
],
10+
sidebar: [
11+
{
12+
text: "comments",
13+
base: "/comments/",
14+
items: [
15+
{ text: 'Overview', link: '/index' },
16+
]
17+
},
18+
{
19+
text: "users",
20+
base: "/users/",
21+
items: [
22+
{ text: 'Overview' , link: '/index' },
23+
]
24+
},
25+
{
26+
text: "Content",
27+
base: "/content/",
28+
items: [
29+
{ text: 'Overview' , link: '/index' },
30+
]
31+
},
32+
{
33+
text: "Graph",
34+
items: [
35+
{ text: 'Overview' },
36+
]
37+
},
38+
{
39+
text: "CDC",
40+
items: [
41+
{ text: 'Overview' },
42+
]
43+
},
44+
{
45+
text: "Cron",
46+
items: [
47+
{ text: 'Overview' },
48+
]
49+
},
50+
],
51+
52+
socialLinks: [
53+
{ icon: 'github', link: 'https://github.com/sixwaaaay/sharing' }
54+
]
55+
}
56+
})

docs/comments/index.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Comments
2+
3+
[![CI](https://github.com/sixwaaaay/sharing/actions/workflows/comment.yaml/badge.svg)](https://github.com/sixwaaaay/sharing/actions/workflows/comment.yaml)
4+
5+
[![Container Image Size](https://img.shields.io/docker/image-size/sixwaaaay/sharing-comment/latest)](https://hub.docker.com/r/sixwaaaay/sharing-comment)
6+
7+
[![Docker Pulls](https://img.shields.io/docker/pulls/sixwaaaay/sharing-comment)](https://hub.docker.com/r/sixwaaaay/sharing-comment)
8+
9+
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/sixwaaaay/sharing-comment?sort=semver)](https://hub.docker.com/r/sixwaaaay/sharing-comment)
10+
11+
[![Codcov](https://codecov.io/gh/sixwaaaay/sharing/branch/main/graph/badge.svg)](https://codecov.io/gh/sixwaaaay/sharing)
12+
13+
the comments module backend.
14+
15+
## Technologies
16+
17+
| Name | Usage |
18+
| ----------- | -------------------- |
19+
| Spring Boot | Application Backbone Framework |
20+
| Spring Cache & Redis | Caching |
21+
| Spring Data JDBC & MySQL | Database |
22+
| Resilience4j | Circuit Breaker & Retry |
23+
| Micrometer | Observability |
24+
| Prometheus | Metrics |
25+
| OpenTelemetry | Tracing |
26+
| Bearer Token | Security |
27+
| GraalVM JDK 21 | AOT Compilation |
28+
| Docker | Containerization |
29+
| Compose | Automation |
30+
| GitHub Actions | CI/CD |
31+
| JUnit 5 | Testing |
32+
| Jacoco | Coverage |
33+
34+
## Details
35+
36+
The comments module backend is a Spring Boot application that provides HTTP APIs for comments.
37+
38+
Thanks to the Spring Boot framework, the application is easy to develop.
39+
**The minimal JDK version is 21**, so that **virtual threads** can be used to improve the performance.
40+
41+
**Spring Data JDBC** and **Spring Data Relational** are used to access the MySQL database and generate the SQL queries automatically.
42+
43+
**Spring Cache** is used to cache the comments data, and **Redis** is used as the cache store. The cache serialization is done by **Jackson**.
44+
45+
**Resilience4j** is used to provide the circuit breaker and retry features, so that the application can be more resilient and degrade when necessary.
46+
47+
**Micrometer** is used to collect the metrics, and **Prometheus** is used to store the metrics. **OpenTelemetry** is used to collect the traces.
48+
49+
**GraalVM JDK 21** is used to compile the application to a native image, so that the application can start faster, consume less memory and have a smaller disk footprint.
50+
51+
**Docker** is used to containerize the application, and **Compose** is used to automate the development environment.
52+
53+
**GitHub Actions** is used to automate the CI/CD process, and **JUnit 5** is used to test the application with **Jacoco** for coverage.
54+
55+
## User Features
56+
57+
- Submit a comment
58+
- Read comments by page
59+
- Read sub-comments by page
60+
- Reply to a comment or sub-comment
61+
- Like a comment or sub-comment
62+
- Dislike a comment or sub-comment
63+
64+
## Service Features
65+
66+
- Dynamic DataSource Routing for Read/Write Separation
67+
- MySQL Database Index for Comment Query
68+
- Redis Cache for Comment Data
69+
- keyset Pagination for Comment Query
70+
- AOT Compilation for GraalVM Native Image
71+
- Docker Containerization for packaging
72+
- Compose Automation for development environment
73+
- GitHub Actions for CI/CD
74+
- JUnit 5 & Jacoco for testing and coverage
75+
76+
## Service Dependencies
77+
78+
The comments module backend depends on the following services:
79+
80+
- MySQL Database for storing the comments data
81+
- Redis for caching, this is optional,which can be disabled by configuration
82+
- OpenTelemetry Collector for collecting the traces, this is optional, which can be disabled by configuration
83+
- Users Service with http API for user information, this is optional, which can be disabled by configuration
84+
- Vote Service with http API for voting, this is optional, which can be disabled by configuration

docs/content/index.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Content
2+
3+
[![CI](https://github.com/sixwaaaay/sharing/actions/workflows/content.yaml/badge.svg)](https://github.com/sixwaaaay/sharing/actions/workflows/content.yaml)
4+
5+
[![Container Image Size](https://img.shields.io/docker/image-size/sixwaaaay/content/latest)](https://hub.docker.com/r/sixwaaaay/content)
6+
7+
[![Docker Pulls](https://img.shields.io/docker/pulls/sixwaaaay/content)](https://hub.docker.com/r/sixwaaaay/content)
8+
9+
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/sixwaaaay/content?sort=semver)](https://hub.docker.com/r/sixwaaaay/content)
10+
11+
[![Codcov](https://codecov.io/gh/sixwaaaay/sharing/branch/main/graph/badge.svg)](https://codecov.io/gh/sixwaaaay/sharing)
12+
13+
The content module backend.
14+
15+
## Technologies
16+
17+
| Name | Usage |
18+
| ----------- | -------------------- |
19+
| Minimal API | Application Backbone Framework |
20+
| Dapper.AOT | Database Access |
21+
| MySQL | Database |
22+
| NativeAOT | AOT Compilation |
23+
| Grpc Client | Grpc Call |
24+
| Bearer Token | Security |
25+
| Prometheus | Metrics |
26+
| OpenTelemetry | Tracing |
27+
| XUnit | Testing |
28+
| Coverlet | Coverage |
29+
| Docker | Containerization |
30+
| Compose | Automation |
31+
| GitHub Actions | CI/CD |
32+
33+
## Details
34+
35+
The content module backend is a Minimal API application that provides HTTP APIs for content.
36+
With the help of **Dapper.AOT**, the application can access the MySQL database with simplified object mapping without reflection.
37+
The application is compiled to a native image by **NativeAOT**, so that the application can start faster, consume less memory and have a smaller disk footprint.
38+
**Grpc Client** is used to call the user module backend to get the user information.
39+
**Prometheus** is used to collect the metrics, and **OpenTelemetry** is used to collect the traces.
40+
**Docker** is used to containerize the application, and **Compose** is used to automate the development environment.
41+
**GitHub Actions** is used to automate the CI/CD process, and **XUnit** is used to test the application with **Coverlet** for coverage.
42+
43+
## User Features
44+
45+
- Submit a video contents
46+
- Read video contents by page
47+
- Read video contents of a user by page
48+
- Like a video content
49+
- Dislike a video content
50+
- Chat with a user
51+
- Query Chat history with a user
52+
- Video Information probing
53+
54+
## Service Features
55+
56+
- MySQL Index Optimization for video contents and chat history query performance
57+
- Keyset Pagination for video contents and chat history query performance
58+
- AOT Compilation for less memory and faster startup
59+
- Docker Containerization for packaging
60+
- Compose Automation for development environment
61+
- GitHub Actions for CI/CD
62+
- XUnit for testing
63+
- Coverlet for coverage

docs/index.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
layout: home
3+
4+
hero:
5+
name: "sharing"
6+
actions:
7+
- theme: brand
8+
text: Markdown Examples
9+
link: /markdown-examples
10+
- theme: alt
11+
text: API Examples
12+
link: /api-examples
13+
14+
features:
15+
- title: Container based delivery
16+
details: It's easy to deploy to various container platforms.
17+
- title: Observability
18+
details: OpenTelemetry and Prometheus are integrated. It's easy to monitor the system.
19+
- title: GitHub Actions
20+
details: Repetitive tests and builds are automated.
21+
- title: Media probe
22+
details: Media probe is supported for extracting media metadata.
23+
- title: AOT Compilation
24+
details: AOT compiled, small size, less memory usage, and fast startup.
25+
- title: Resilience
26+
details: Circuit Breaker, Retry are supported.
27+
- title: Security
28+
details: Security is considered in the design and implementation.
29+
- title: Binlog based CDC
30+
details: Binlog based change data capture is supported.
31+
- title: Read and Write Separation
32+
details: Read Operation and Write Operation can be separated.
33+
- title: OAuth2
34+
details: GitHub OAuth2 is supported. It's easy to login with GitHub account.
35+
- title: Cache
36+
details: Redis based data cache is supported.
37+
- title: S3
38+
details: S3 distributed storage is the default storage for media files.
39+
---
40+

docs/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"scripts": {
3+
"docs:dev": "vitepress dev",
4+
"docs:build": "vitepress build",
5+
"docs:preview": "vitepress preview"
6+
}
7+
}

docs/users/index.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Users
2+
3+
[![CI](https://github.com/sixwaaaay/sharing/actions/workflows/users.yaml/badge.svg)](https://github.com/sixwaaaay/sharing/actions/workflows/users.yaml)
4+
5+
[![Container Image Size](https://img.shields.io/docker/image-size/sixwaaaay/shauser/latest)](https://hub.docker.com/r/sixwaaaay/shauser)
6+
7+
[![Docker Pulls](https://img.shields.io/docker/pulls/sixwaaaay/shauser)](https://hub.docker.com/r/sixwaaaay/shauser)
8+
9+
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/sixwaaaay/shauser?sort=semver)](https://hub.docker.com/r/sixwaaaay/shauser)
10+
11+
[![Codcov](https://codecov.io/gh/sixwaaaay/sharing/branch/main/graph/badge.svg)](https://codecov.io/gh/sixwaaaay/sharing)
12+
13+
the users module backend.
14+
15+
## Technologies
16+
17+
| Name | Usage |
18+
| ----------- | -------------------- |
19+
| gRPC | gRPC endpoints |
20+
| echo | http endpoints |
21+
| GORM & MySQL | Database |
22+
| GitHub OAuth2 | OAuth2 login |
23+
| testify & go cover | Testing & Coverage |
24+
| Docker | Containerization |
25+
| Compose | Automation |
26+
| GitHub Actions | CI/CD |
27+
| OpenTelemetry-Go | Tracing & Metrics |
28+
29+
## Details
30+
31+
The users module backend provides **both gRPC and http APIs** for users.
32+
gRPC serializes the data with protobuf, and http serializes the data with json.
33+
34+
**GORM** is used to access the MySQL database and change the data source.
35+
36+
**GitHub OAuth** is used to provide the OAuth login feature, which is a third-party login feature so that users can log in with their GitHub accounts without registering.
37+
38+
**Testify** is used to simplify the testing, and the built-in **go cover** is used to collect the coverage.
39+
40+
**Docker** is used to containerize the application, and **Compose** is used to automate the development environment.
41+
42+
**GitHub Actions** is used to automate the CI/CD process.
43+
44+
**OpenTelemetry-Go** is used to collect and export the tracing and metrics data.
45+
46+
## User Features
47+
48+
- Sign Up and Sign In
49+
- OAuth Login with GitHub
50+
- Get User Info
51+
- Update User Info
52+
- Follow and Unfollow Users
53+
- Get Followers and Followings List by Page
54+
55+
## Service Features
56+
57+
- gRPC and http APIs
58+
- Read and write separation
59+
- Database connection pool
60+
- Cached Precompiled Statements
61+
- OAuth login
62+
- Tracing and metrics by OpenTelemetry protocol

0 commit comments

Comments
 (0)