From f72d9dbcf165c572b55cb237e1479fec05eb43ae Mon Sep 17 00:00:00 2001 From: CorrectRoadH Date: Sun, 10 Dec 2023 19:23:53 +0800 Subject: [PATCH] chore(doc): update document --- README.md | 6 +- README.zh.md | 102 ++++++++++++++++++++++++++++++++++ dashboard/src/api/database.ts | 2 +- docs/getting-started.md | 27 ++++++--- docs/imgs/screenshot-1.png | Bin 0 -> 299522 bytes docs/imgs/screenshot-2.png | Bin 0 -> 299705 bytes 6 files changed, 126 insertions(+), 11 deletions(-) create mode 100644 README.zh.md create mode 100644 docs/imgs/screenshot-1.png create mode 100644 docs/imgs/screenshot-2.png diff --git a/README.md b/README.md index 7225f5a..c2e5b47 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,14 @@ [Demo](https://likit.zeabur.app) +English | [简体中文](./README.zh.md) + ## What is Likit -Likit is a backend as a service for like(vote, unlike, count) feature. It is very ease to deploy and use. +Likit is a Backend as a Service for like(vote, unlike, count) feature. It is very ease to deploy and use. The goal of Likit is help your implement like function within 10 minutes. -Likit is suites small and middle size application. You can select difference vote implement engine to get difference features and performance. +Likit is suitable for small and middle size application. You can select difference vote implement engine to get difference features and performance. [Getting started](./docs/getting-started.md) diff --git a/README.zh.md b/README.zh.md new file mode 100644 index 0000000..0b8e6bf --- /dev/null +++ b/README.zh.md @@ -0,0 +1,102 @@ +

+ +

+ +# Likit + +[Demo](https://likit.zeabur.app) + +[English](./README.md) | 简体中文 + +## What is Likit +Likit 是一个 Backend as a Service ,提供点赞(投票、点赞、计数)功能。 部署和使用非常容易。 + +Likit的目标是帮助您在10分钟内实现类似的功能。 + +Likit 适用于中小型应用程序。 您可以选择差异投票工具引擎来获得不同的功能和性能。 +[Getting started](./docs/getting-started.md) + +| features | Simple Vote System | Middle Vote System(WIP) | +| -- | -- | -- | +| Vote | ✅ | 🚧 | +| Unvote | ✅ | 🚧 | +| Count | ✅ | 🚧 | +| List the voted users | ✅ | 🚧 | +| is Voted | ✅ | 🚧 | +| vote events | ❌ | 🚧 | +| message queue | ❌ | ❌ | +| requires | redis | redis,postgres | + +# Screenshots + +![](./img/screenshot-1.png) +![](./img/screenshot-2.png) + +# Deployment + +## Zeabur +Deloyment on Zeabur by one click + +[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/KZOLHA?referralCode=CorrectRoadH) + +## Docker Compose +``` +wget https://raw.githubusercontent.com/CorrectRoadH/Likit/main/docker-compose.yaml + +docker compose up -d +``` + +## K8S +Coming soon + +# Documentation +[Document](./docs/getting-started.md) + +## RESTful API + +### Vote +POST `http(s):///api/v1/vote` + +body + +``` +{ + "businessId": "businessId", + "messageId": "messageId", + "userId": "userId" +} +``` + +POST `http(s):///api/v1/unvote` + +body + +### Unvote +``` +{ + "businessId": "businessId", + "messageId": "messageId", + "userId": "userId" +} +``` + +### Count the number of votes +GET `http(s):///api/v1/count/:businessId/:messageId` + +### List the users who voted +GET `http(s):///api/v1/list/:businessId/:messageId` + +### Check if the user has voted +GET `http(s):///api/v1/isVoted/:businessId/:messageId/:userId` + + +## gRPC API +Coming soon + +## SDK + +### Golang +[Likit Go](https://github.com/CorrectRoadH/likit-go) + +### Java +Coming soon diff --git a/dashboard/src/api/database.ts b/dashboard/src/api/database.ts index eca4ca6..aac22de 100644 --- a/dashboard/src/api/database.ts +++ b/dashboard/src/api/database.ts @@ -22,7 +22,7 @@ const useDatabase = ()=> { } return { - database:data.dataSourceConfig||[], + database:data?.dataSourceConfig||[], isLoading, isError:error, createDatabase, diff --git a/docs/getting-started.md b/docs/getting-started.md index 12acc3e..fc575ad 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -2,26 +2,34 @@ WIP ## Getting started -WIP +Likit is very easy to embed in your backend. You just need to deploy it and create the business Id for your business. Then you can use it in your backend. + ### Deployment #### zeabur -WIP +Deloyment on Zeabur by one click + +[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/KZOLHA?referralCode=CorrectRoadH) + + #### docker-compose -WIP +``` +wget https://raw.githubusercontent.com/CorrectRoadH/Likit/main/docker-compose.yaml + +docker compose up -d +``` ### Create Business 1. create database connection if you want use extra database -Screenshots-1 +![create extract database connect](./imgs/screenshot-1.png) -2. create business by click the button `Create Business` on the top right corner. +1. create business by click the button `Create Business` on the top right corner. -Screenshots-2 +![create business](./imgs/screenshot-2.png) Input the business title and id - ### Implement the logic in your backend Copy business id and use it in your backend. Message id mean the id of object that be vote, The message id can be any string. It is decided by your business logic. @@ -33,4 +41,7 @@ Message id mean the id of object that be vote, The message id can be any string. WIP #### RESTful API -WIP \ No newline at end of file +WIP + +#### gRPC +WIP diff --git a/docs/imgs/screenshot-1.png b/docs/imgs/screenshot-1.png new file mode 100644 index 0000000000000000000000000000000000000000..6207a60498af7fb122b0f0e7dc76dc5b4317ccf9 GIT binary patch literal 299522 zcmbq*cU+Up(m#Tzh=2-+(mMh|=)I_bbdaj_E`c_#<#LU5-)5P4t)PmE~-VsB`!V;78bTl!uwQ!|1wXn1X ziqjvqKlZ#&BF0Gie`8yGH=~sVy z8PgJ{w{mrL6afG{JUlo(csU)MEdkuZ!omP99smyy2c`#yix<$<#FGQ)!tjg5UwKGd zxR^OxJGxps0BL{mG%a}}qj$Ixm2#@xcw`tRIJuU2Xq^<2OfG(IRh|}|MadZ8J+uzA=e?#Ww5#ad?`4=w{bqf~< zJGWnR*8*B&X8jw|+rQJq>ACs%0Nj6nP3IqJzw|*X_LniWTr8ZW9PBYOa{bHGzv}6Q z-QQY&ZQ5D?QjUn73D8oU-jl=J;+=_`oh!YBhMBVkMieUtS24gZb=q0~jmKYF|HDM= zFPani!$^O9<2MU}dG)W)Fbj>b7{LFU45snFMrQ%USei4&r1-a2`!S{~X)Pu7T3$+u z_O-LaJ8L@&EG)UOq&K(UYV?`h|HNcH`qql$2+)TX zAR^CbTzRew(DJt3rJY&vTrZ+9|HmVlc| zgej(^p~#OraccK%UtYavPnea8RIg^t#dG$Vh|L)OAdDk&U-VcgVD&!5OUh>hQIW5Y zcAk7N7Wm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