Skip to content

Commit

Permalink
chore: arch diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
rootCircle committed Oct 26, 2024
1 parent 846e4ee commit 1f82341
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ eq = $(if $(or $(1),$(2)),$(and $(findstring $(1),$(2)),\
#

.PHONY : \
init-repo \
migrate-run \
migrate-create \
prepare \
prepare-check \
doc \
fmt \
clippy \
Expand Down Expand Up @@ -52,7 +57,7 @@ doc :
ifeq ($(clean),yes)
@rm -rf target/doc/
endif
cargo doc --all-features --no-deps\
SQLX_OFFLINE=true cargo doc --all-features --no-deps\
$(if $(call eq,$(private),no),,--document-private-items) \
$(if $(call eq,$(open),no),,--open)

Expand Down
20 changes: 20 additions & 0 deletions cpast_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,23 @@ Launch `cargo`:
```bash
cargo test
```

## Architecture

```mermaid
graph TD
A[User Interface] -->|Submits Code| B[API Layer]
B -->|Enqueues Task| D[Task Queue RabbitMQ/Kafka]
D -->|Distributes Tasks| E[Worker Nodes]
E -->|Compiles Code| F[Compiler Manager]
F -->|Executes Code| G[Execution Environment]
G -->|Returns Output| E
E -->|Sends Result via WebSocket| B
B -->|WebSocket Connection| A
subgraph Storage
H[Database] -->|Stores Results and Logs| I[Result Storage]
end
G -->|Task Results| H
```
4 changes: 4 additions & 0 deletions cpast_api/src/routes/api/v1/evaluate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ pub(crate) struct EvaluateCodeApiv1;

#[derive(Serialize, ToSchema)]
struct EvaluateCodeInputDiff {
#[schema(example = "world")]
input: String,

#[schema(example = "Hello, world!")]
expected_output: String,

Expand All @@ -34,6 +37,7 @@ struct EvaluateCodeResponse {
has_output_matched: bool,

#[schema(example = json!(Vec::from([EvaluateCodeInputDiff {
input: "world".to_string(),
expected_output: "Hello, world!".to_string(),
actual_output: "Hello, worldd!".to_string(),
}])))]
Expand Down

0 comments on commit 1f82341

Please sign in to comment.