Skip to content

Commit

Permalink
port part of fetch agent from the old fullstack demo
Browse files Browse the repository at this point in the history
  • Loading branch information
hgzimmerman committed Oct 6, 2019
1 parent 3b4241b commit 9e04291
Show file tree
Hide file tree
Showing 17 changed files with 1,672 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[workspace]
members = [
"backend/db",
"backend/server",
"backend/diesel_test_setup",
"backend/pool",
"backend/auth",
"wire",
"yew_frontend"
]
File renamed without changes.
2 changes: 1 addition & 1 deletion wire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ edition = "2018"
serde_json = "1.0.39"
serde = { version = "1.0.91", features = ["derive"] }
uuid = { version = "0.6.*", features = ["serde", "v4"] }
chrono = { version = "0.4.6", features = ["serde"] }
chrono = { version = "0.4.9", features = ["serde"] }
16 changes: 15 additions & 1 deletion wire/src/user.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use serde::{Serialize, Deserialize};
use uuid::Uuid;
use chrono::NaiveDateTime;

#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct NewUser {
Expand All @@ -17,4 +18,17 @@ pub struct User {
pub google_user_id: String,
/// The user's name as it appears in google
pub google_name: Option<String>,
}
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct JwtPayload<T> {
/// Issue date of the token
pub iat: NaiveDateTime,
/// Subject - the information being authenticated by this token
pub sub: T,
/// Expiration date of the token
pub exp: NaiveDateTime,
}

/// Bearer string.
pub const BEARER: &str = "Bearer ";
24 changes: 24 additions & 0 deletions yew_frontend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "yew_frontend"
version = "0.1.0"
authors = ["Henry Zimmerman <zimhen7@gmail.com>"]
edition = "2018"

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

[dependencies]
yew = { git = "https://github.com/yewstack/yew", branch="master" }
yew_router = { git = "https://github.com/yewstack/yew_router", branch="master" } # TODO, this needs to use yew master
yewtil = {git = "https://github.com/hgzimmerman/yewtil", branch="next"}
yew_css = {git = "https://github.com/hgzimmerman/yew_css", branch="master"}
web_logger = "0.2.0"
wire = {path = "../wire"}
serde = "1.0.101"
failure = "0.1.5"
log = "0.4.8"
chrono = "0.4.9"
base64 = "0.10.1"
stdweb = "0.4.19"
uuid = { version = "0.6.*", features = ["serde", "v4"] }
#uuid = "0.7.4"
serde_json = "1.0.41"
5 changes: 5 additions & 0 deletions yew_frontend/assets/navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.navbar {
height: 44px;
background-color: gray;
display: flex;
}
Loading

0 comments on commit 9e04291

Please sign in to comment.