Initial
This commit is contained in:
95
README.md
Normal file
95
README.md
Normal file
@ -0,0 +1,95 @@
|
||||
|
||||
# Clocker
|
||||
|
||||
## Sequence diagram
|
||||
|
||||
```plantuml
|
||||
@startuml
|
||||
participant FE as "Frontend" << React >>
|
||||
participant Funnel as "Funnel" << Python >>
|
||||
participant Hours as "ServeHours" << Go >>
|
||||
participant Minutes as "ServeMinutes" << Go >>
|
||||
participant Seconds as "ServeSeconds" << Go >>
|
||||
participant Milliseconds as "ServeMilliseconds" << Go >>
|
||||
participant CurrentTime as "ServeCurrentTime" << Rust >>
|
||||
|
||||
activate FE #hotpink
|
||||
FE -> FE: Load page
|
||||
FE -> Funnel: WS Connect
|
||||
|
||||
loop #ivory
|
||||
activate Funnel #gold
|
||||
Funnel -> Hours: GetHours()
|
||||
activate Hours #skyblue
|
||||
Hours -> CurrentTime: GetCurrentTime()
|
||||
activate CurrentTime #sandybrown
|
||||
return HH:MM:SS.ms
|
||||
return HH
|
||||
|
||||
Funnel -> Minutes: GetMinutes()
|
||||
activate Minutes #skyblue
|
||||
Minutes -> CurrentTime: GetCurrentTime()
|
||||
activate CurrentTime #sandybrown
|
||||
return HH:MM:SS.ms
|
||||
return MM
|
||||
|
||||
Funnel -> Seconds: GetSeconds()
|
||||
activate Seconds #skyblue
|
||||
Seconds -> CurrentTime: GetCurrentTime()
|
||||
activate CurrentTime #sandybrown
|
||||
return HH:MM:SS.ms
|
||||
return SS
|
||||
|
||||
Funnel -> Milliseconds: GetMilliseconds()
|
||||
activate Milliseconds #skyblue
|
||||
Milliseconds -> CurrentTime: GetCurrentTime()
|
||||
activate CurrentTime #sandybrown
|
||||
return HH:MM:SS.ms
|
||||
return ms
|
||||
|
||||
Funnel -> FE: WS: Send formatted time
|
||||
deactivate Funnel
|
||||
end
|
||||
deactivate FE
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
## Services
|
||||
|
||||
| Service | Language | Port |
|
||||
| -- | -- | -- |
|
||||
| Funnel | Python | - |
|
||||
| ServeCurrentTime | Rust | 50000 |
|
||||
| ServeHours | Go | 50001 |
|
||||
| ServeMinutes | Go | 50002 |
|
||||
| ServeSeconds | Go | 50003 |
|
||||
| ServeMilliseconds | Go | 50004 |
|
||||
|
||||
### Funnel
|
||||
|
||||
Requirements:
|
||||
- python 3.8+
|
||||
- grpcio
|
||||
- grpcio-tools
|
||||
|
||||
Install virtualenv and libs
|
||||
```sh
|
||||
cd src/funnel
|
||||
virtualenv env
|
||||
source env/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Compile proto stubs:
|
||||
```sh
|
||||
cd src/funnel
|
||||
make proto
|
||||
```
|
||||
|
||||
Run service:
|
||||
```sh
|
||||
cd src/funnel
|
||||
make run
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user