Skip to content

Commit

Permalink
docs(example/loco): chat room example with loco as a backend (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaplanelad authored Jan 25, 2024
1 parent 70924a9 commit b7e3402
Show file tree
Hide file tree
Showing 38 changed files with 8,572 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/loco-rooms-chat/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
loco = "run --"
1 change: 1 addition & 0 deletions examples/loco-rooms-chat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
28 changes: 28 additions & 0 deletions examples/loco-rooms-chat/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "loco_chat_rooms"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

loco-rs = { version = "0.2.3", default-features = false, features = [
"cli",
"channels",
] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
eyre = "0.6.11"
tokio = { workspace = true, default-features = false }
async-trait = "0.1.74"
chrono = { version = "0.4", features = ["serde"] }

axum = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter", "json"] }

[[bin]]
name = "loco_chat_rooms-cli"
path = "src/bin/main.rs"
required-features = []
9 changes: 9 additions & 0 deletions examples/loco-rooms-chat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Chat Room With Loco Backend
This repo provides the backend using [Loco](https://github.com/loco-rs/loco) and frontend for the Rust Socket.io

The building instructions for the client can be found in the `client` folder.

To run the server, `cd` into this directory and run `cargo loco start` command.

App Screenshot:
![App Screenshot](app-screenshot.png)
Binary file added examples/loco-rooms-chat/app-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions examples/loco-rooms-chat/client/dist/assets/index-S6s5_GGp.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions examples/loco-rooms-chat/client/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chatly</title>
<script type="module" crossorigin src="/assets/index-S6s5_GGp.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-myMiaP76.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
1 change: 1 addition & 0 deletions examples/loco-rooms-chat/client/dist/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions examples/loco-rooms-chat/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chatly</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading

0 comments on commit b7e3402

Please sign in to comment.