Giter Club home page Giter Club logo

webapp.rs's Introduction

WebApp.rs

CircleCI Coverage Docs master Docs release Docs release backend Docs release frontend License MIT Crates.io Crates.io Crates.io

A web application completely written in Rust

Target of this project is to write a complete web application including backend and frontend within Rust.

Rust wasm             Rust app
in browser <- REST -> HTTP Server -- actix-web
 |                         |
Yew                   Diesel (ORM) -> PostgreSQL

Blog Posts

  1. A Web Application completely in Rust.
  2. Lessons learned on writing web applications completely in Rust.

Build

The following build dependencies needs to be fulfilled to support the full feature set of this application:

The app consist of a frontend and a backend. For getting started with hacking, the backend can be tested via make run-backend, whereas the frontend can be tested with make run-frontend. You can adapt the application configuration within Config.toml if needed.

This installs build requirements, rust and wasm-pack, on Ubuntu or Debian.

> sudo apt-get update
> sudo apt-get install -y pkg-config libssl-dev npm sudo wget
> wget https://sh.rustup.rs -O rustup-init
> sudo sh rustup-init -y
> cargo install wasm-pack
> sudo npm install -g rollup

This builds the project.

> git clone https://github.com/saschagrunert/webapp.rs.git
> cd webapp.rs
> make all

Run

make deploy uses podman to start a PostgreSQL container and the Rust backend container. If you wish to use docker instead of podman, set CONTAINER_RUNTIME=docker in the top of Makefile. Edit Config.toml if needed to set the backend url and PostgreSQL credentials:

[server]
url = "http://127.0.0.1:30080"
...
[postgres]
host = "127.0.0.1"
username = "username"
password = ""
database = "database"

Ensure the runtime dependencies are installed, and then start the two containers.

> sudo apt install -y postgresql-client
> cargo install diesel_cli --no-default-features --features "postgres"
> sudo make deploy

The application should now be accessible at http://127.0.0.1:30080. During development, you can start the containers separately, using make run-app to start only the rust backend container, and run-postgres to start only the PostgreSQL container.

If both the backend and frontend are running, you can visit the web application at http://127.0.0.1:30080. After the successful loading of the application you should see an authentication screen like this:

authentication screen

The login screen will accept any username and password that are equal, such as me (username) and me (password). There is currently no further user authentication yet, but non matching combination will result in an authentication failure. After the successfully login you should be able to see the content of the application:

content screen

The authentication should persist, it is even better after a manual page reload. Logging out of the application via the logout button should also work as intended.

Control Flow

The complete control flow of the application looks like this:

control screen

Contributing

You want to contribute to this project? Wow, thanks! So please just fork it and send me a pull request.

webapp.rs's People

Contributors

deedasmi avatar dependabot-preview[bot] avatar dependabot[bot] avatar frankli-dev avatar joaofl avatar miguelgargallo avatar pickfire avatar rich-murphey avatar rofrol avatar saschagrunert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webapp.rs's Issues

error: no such subcommand: `web`

When execute make run-frontend in the cloned repo root, it complains:

error: no such subcommand: `web`

	Did you mean `new`?

Makefile:97: recipe for target 'run-frontend' failed
make: *** [run-frontend] Error 101

I'm on Ubuntu 16.04

make deploy issue with fetching req once_cell=1.18

always get this

make deploy
Password:
latest: Pulling from saschagrunert/build-rust
Digest: sha256:3a4d5aca99e7491b92fd2f10f07075397217fc4bf6464cf294ab89fcff5cd561
Status: Image is up to date for saschagrunert/build-rust:latest
docker.io/saschagrunert/build-rust:latest
Error: Error during execution of cargo metadata: Updating crates.io index
error: failed to select a version for the requirement once_cell = "=1.18.0"
candidate versions found which didn't match: 1.17.2, 1.17.1, 1.17.0, ...
location searched: crates.io index
required by package actix v0.13.0
... which is depended on by webapp-backend v1.0.0 (/deploy/backend)
make: *** [Makefile:49: build-frontend] Error 1
make: *** [deploy] Error 2

Without postgresql, with empty State, unpack_cbor results in E0284

Hello,

First of all thanks for sharing this wonderful project with the community!

And please close this ticket if this is the wrong place to ask this question.

So, after unceremoniously commenting out a lot of database related stuff, after changing State (because an empty State wouldn't compile due to unused type parameter) and all its use sites, I got stuck with this:

error[E0284]: type annotations required: cannot resolve `<_ as actix::Actor>::Context == _`                                                                                                   
  --> backend/src/http/login_credentials/mod.rs:21:33                                                                                                                                         
   |                                                                                                                                                                                          
21 |     let (request_clone, cbor) = unpack_cbor(http_request);                                                                                                                               
   |                                 ^^^^^^^^^^^                                                                                                                                              
     
  /// Cbor unpacking helper, also returns a clone of the request reference
  pub fn unpack_cbor<A, D, M>(
--    http_request: &HttpRequest<State<A>>,
--) -> (HttpRequest<State<A>>, FromErr<CborRequest<D>, Error>)
++    http_request: &HttpRequest<State>,
++) -> (HttpRequest<State>, FromErr<CborRequest<D>, Error>)
  where
      M: Message,
      D: DeserializeOwned + 'static,
  /// Shared mutable application state
--pub struct State<T>
--where
--    T: Actor,
--{
--    /// The database connection
--    pub database: Addr<T>,
--}
++pub struct State;

And I've replaced the CreateSession, UpdateSession, DeleteSession structs, I don't know if it matters.

++
++
++use actix::prelude::*;
++use failure::Fallible;
++use webapp::{protocol::model::Session};
++
++pub struct Data(pub String);
++
++impl Message for Data {
++    type Result = Fallible<Session>;
++}
++
++impl From<String> for Data {
++    fn from(s: String) -> Data {
++       Data(s)
++    }
++}
++

This is on nightly-1.30.

Thanks!

Does not work on Firefox

Dont work properly on firefox. But work prefect on Chrome.

My system is Debian 10 .
Firefox version : 68.2.0esr
Chrome version : 78.0.3904.108

This is how I run the project
git clone https://github.com/saschagrunert/webapp.rs.git && cd webapp.rs
Change "podman" to "docker" in Makefile
I've installed all the dependencies。
make run-app

Access to localhost:30080 and try to login , Chrome successed , Firefox just return a 408 page .

Here is what i found in Firefox Console :

issue

This is really weird, because everything works fine on Chrome, but not on Firefox. And I can't solve the problem by reading the error message.

Front End build error: LLVM TargetMachine for triple: wasm32-unknown-unknown

First off, thanks for a the work in putting together this comprehensive repo! It is invaluable for a newbie, like me, in making progress!

I am running into an error that I can't seem to find an answer for.

Error Message when running sudo make all:

error: Could not create LLVM TargetMachine for triple: wasm32-unknown-unknown: No available targets are compatible with triple "wasm32-unknown-unknown"

thread 'main' panicked at 'Failed to grab the target configuration from rustc!', /home/trouperk/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-web-0.6.26/src/cargo_shim/mod.rs:178:13
note: Run with RUST_BACKTRACE=1 environment variable to display a backtrace.
Makefile:53: recipe for target 'build-frontend' failed
make: *** [build-frontend] Error 101

End Error Message

What has me confused on this issue is the following:

  • I successfully ran sudo make all initially and the build succeeded. Unfortunately, I hadn't noticed that I already had a local psql server running on port 5432 so I hit an error running the postgre container.
  • So I stopped the local version I had and attempted to re-make (in retrospect, I realize this was probably unnecessary after stopping my local process). It was, at that point that I hit this error message.
  • I have tried removing the entire folder and starting the process over with no success (using both the main repo directions and those found in issue/ticket #480).
  • I also did a force reinstall of cargo-web.
  • I know that the LLVM target issue for wasm32-unknown-unknown appears quite a bit as an error message (according to Google), but I've compiled to it previously, I double checked that I can still compile an existing project targeting wasm32-unknown-unknown, and, as mentioned above, it worked initially.

Machine and Version Info:

  • Ubuntu 18.04
  • rustup 1.20.2
  • rustc 1.39.0-nightly
  • cargo 1.39.0-nightly
  • rustc --print target-list includes an entry for: wasm32-unknown-unknown
  • results of rustup show:

Beginning
Default host: x86_64-unknown-linux-gnu
rustup home: /home/trouperk/.rustup

installed toolchains

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain

asmjs-unknown-emscripten
wasm32-unknown-emscripten
wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.39.0-nightly (6ef275e6c 2019-09-24)

End

Please let me know if there is any additional information I should provide. And thanks in advance for any ideas/suggestions!

clarify build environment

I thought it might be helpful for newcomers, for some of the packages required for building or installing this project to be enumerated.

Note that this is on Debian, which doesn't seem to have podman in the repos, so I substituted docker.

Also, in the Makefile, $(PWD) did not seem to work, so I substituted $(shell pwd).

Here are steps that build and deploy the project on current Debian.

install docker on Debian

sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io

install rust

wget https://sh.rustup.rs -O rustup-init
sudo sh rustup-init -y

install cargo-web

sudo apt-get install -y pkg-config libssl-dev
sudo cargo install cargo-web

build the project

cd /opt
git clone https://github.com/saschagrunert/webapp.rs.git
cd webapp.rs
sed -si 's/$(PWD)/$(shell pwd)/' Makefile
sed -si 's/^CONTAINER_RUNTIME.*/CONTAINER_RUNTIME=docker/' Makefile

modify app URL and docker conn as needed

sed -i 's|^url.|url = "http://127.0.0.1:8888"|' Config.toml
sed -i 's/^host.
/host = "127.0.0.1"/' Config.toml
sed -i 's/^username./username = "webapp"/' Config.toml
sed -i 's/^password.
/password = "abcd1234"/' Config.toml
sed -i 's/^database.*/database = "webapp"/' Config.toml
make all

deploy the web app

sudo apt install -y postgresql-client
cargo install diesel_cli --no-default-features --features "postgres"
sudo make deploy
make run-app
docker ps -a

Also, note that the build should be done on a local filesystem so that it can be mapped as a volume in a container.

I'd be glad to help put this in a project wiki page if needed.

Rust Error on Docker Run Image

The build works just fine on ubuntu but I'm receiving this elusive rust error on 'sudo docker run'

Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

This is a clean install on ubuntu 16.04, instructions worked fine but the image did not start up, i then ran manually and found this error.
The resulting internet searches for this error are not very helpful and this may be an easy fix. Any ideas anyone? Thanks.

Error when running `make deploy`

When running make deploy, I get the following error:

Status: Downloaded newer image for ekidd/rust-musl-builder:latest
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating git repository `https://github.com/DenisKolodin/yew`
    Updating git repository `https://github.com/saschagrunert/yew-router`
error: failed to open: /home/rust/src/target/release/.cargo-lock

Caused by:
  Permission denied (os error 13)
make: *** [deploy] Error 101

My docker version is "Version 18.06.1-ce-mac73 (26764)". I'd imagine there's not much other helpful info I can give about my machine since it looks like this is an error inside the docker container, but let me know if you need anything else.

Mac OS X: could not compile `webapp-backend`: library not found for -lpq

git clone [email protected]:saschagrunert/webapp.rs.git
cd webapp.rs
make all

on Mac OS X gives:

 = note: ld: library not found for -lpq
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          
error: aborting due to previous error

error: could not compile `webapp-backend`

To learn more, run the command again with --verbose.
make: *** [build-backend] Error 101

Migrate to actix-web 1.0.0

There are some migrations needed when going for actix 1.0.0. We should follow up on that after its release.

An?

shouldn't the description say "a web application"

Compile failed!

Environment:

  1. ubuntu 20.04
  2. cargo 1.62.0 (a748cf5a3 2022-06-08)
  3. version @master branch
error[E0433]: failed to resolve: could not find `agent` in `yew_router`
  --> frontend/src/component/content.rs:20:17
   |
20 | use yew_router::agent::{RouteAgent, RouteRequest::ChangeRoute};
   |                 ^^^^^ could not find `agent` in `yew_router`

error[E0432]: unresolved import `yew_router::agent`
  --> frontend/src/component/content.rs:20:17
   |
20 | use yew_router::agent::{RouteAgent, RouteRequest::ChangeRoute};
   |                 ^^^^^ could not find `agent` in `yew_router`

error[E0433]: failed to resolve: could not find `agent` in `yew_router`
  --> frontend/src/component/login.rs:22:17
   |
22 | use yew_router::agent::{RouteAgent, RouteRequest::ChangeRoute};
   |                 ^^^^^ could not find `agent` in `yew_router`

error[E0432]: unresolved import `yew_router::agent`
  --> frontend/src/component/login.rs:22:17
   |
22 | use yew_router::agent::{RouteAgent, RouteRequest::ChangeRoute};
   |                 ^^^^^ could not find `agent` in `yew_router`

error[E0433]: failed to resolve: could not find `agent` in `yew_router`

Make fails - make: *** [Makefile:49: build-frontend] Error 139

$ make all --trace

Makefile:43: target 'build-backend' does not exist
cargo build --release -p webapp-backend
    Finished release [optimized] target(s) in 0.06s
Makefile:49: target 'build-frontend' does not exist
cd frontend && \
        wasm-pack build --target web --release && \
        rollup ./main.js --format iife --file ./pkg/webapp_frontend.js
make: *** [Makefile:49: build-frontend] Error 139

What would be required to run the backend and postgresql in different VM's instead of podman or docker.

I would like to try running the backend in its own VM, the frontend in its own VM, and postgresql in its own VM.

I only just today starting reading about and working with Rust. I found this project listed here: https://github.com/actix/examples

I only use docker when necessary, however I did try to use podman initially just so that I could try and test things, unfortunately it did not work:

root@Web:~/webapp# make deploy
Error: 'overlay' is not supported over zfs, a mount_program is required: backing file system is unsupported for this graph driver
make: *** [Makefile:59: deploy] Error 125

I am currently looking at all the files included with this project and trying to get understanding of how it all fits together so that I can separate the backend and frontend as separate applications that run natively without the need for podman.

Clarifications on start and the run the backend server

Hi @saschagrunert ) Can you please clarify the place where you start the server in from_config method https://github.com/saschagrunert/webapp.rs/blob/master/backend/src/server/mod.rs#L86, and then start system runner in start method https://github.com/saschagrunert/webapp.rs/blob/master/backend/src/server/mod.rs#L102? What is the purpose of it? As I understand the server will start without calling the start method https://github.com/saschagrunert/webapp.rs/blob/master/backend/src/main.rs#L43, at least on my machine it works like that. If I don't start the server in from_config then I should start by calling start which in turn calls runner.run..
So to sum up. What is the purpose of starting server in from_config and the running system runner in start?
Thanks

Running into an Error on Windows

I'm running into an error trying to deploy this app on Windows:

C:\Users\allen\Projects\webapp.rs>make deploy
   Compiling webapp v0.3.0 (file:///C:/Users/allen/Projects/webapp.rs)
    Finished release [optimized] target(s) in 7.14s
    Garbage collecting "app.wasm"...
    Processing "app.wasm"...
    Finished processing of "app.wasm"!
The `app` was deployed to "C:\\Users\\allen\\Projects\\webapp.rs\\target\\deploy"!
error: could not find `Cargo.toml` in `/home/rust/src` or any parent directory
make: *** [deploy] Error 101

C:\Users\allen\Projects\webapp.rs>

Though while I'm making this issue, I can provide some extra notes on what I needed to get closer to building the app:

  • Make for Windows
  • sed (this came with Git Bash I believe)
  • Additional SDKs provided by Visual Studio (specifically the Windows 8.1 SDK and Universal CRT SDK to compile sass-rs)

I understand that this might not be a big priority since Windows is somewhat of a second-class citizen for webdev stuff, but I think it would be really cool to see this work there too.

Thanks for making this, by the way!

stdweb may not be used on the beta release channel

Hi,

A complete rust + wasm newb here (coming from Typescript). I'm trying to build the frontend (on Ubuntu 18) and getting the following error:

$ make run-frontend

info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
Compiling proc-macro2 v0.4.19
Compiling unicode-xid v0.1.0
Compiling cc v1.0.25
Compiling ryu v0.2.6
Compiling serde v1.0.79
Compiling libc v0.2.43
Compiling pkg-config v0.3.14
Compiling failure_derive v0.1.2
Compiling rustc-demangle v0.1.9
Compiling cfg-if v0.1.5
Compiling itoa v0.4.3
Compiling matches v0.1.8
Compiling stdweb-internal-runtime v0.1.0
Compiling base-x v0.2.3
Compiling unicode-normalization v0.1.7
Compiling iovec v0.1.2
Compiling byteorder v1.2.6
Compiling discard v1.0.4
Compiling fnv v1.0.6
Compiling percent-encoding v1.0.1
Compiling anymap v0.12.1
Compiling slab v0.4.1
Compiling unicode-bidi v0.3.4
Compiling log v0.4.5
Compiling sass-sys v0.4.7
Compiling bytes v0.4.10
Compiling backtrace v0.3.9
Compiling http v0.1.13
Compiling backtrace-sys v0.1.24
Compiling quote v0.6.8
Compiling syn v0.14.9
Compiling syn v0.15.6
Compiling serde_json v1.0.31
Compiling serde_cbor v0.8.2
Compiling bincode v1.0.1
Compiling toml v0.4.7
Compiling serde_derive v1.0.79
Compiling idna v0.1.5
Compiling synstructure v0.9.0
Compiling url v1.7.1
Compiling stdweb-internal-macros v0.2.0
Compiling stdweb-derive v0.5.0
error[E0554]: #![feature] may not be used on the beta release channel
--> /home/artem/.cargo/registry/src/github.com-1ecc6299db9ec823/stdweb-internal-macros-0.2.0/src/lib.rs:1:1
|
1 | #![feature(proc_macro)]
| ^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try rustc --explain E0554.
error: Could not compile stdweb-internal-macros.
warning: build failed, waiting for other jobs to finish...
error: build failed
error: build failed
Makefile:95: recipe for target 'run-frontend' failed
make: *** [run-frontend] Error 101

$ rustc -V
rustc 1.30.0-beta.14 (1320d2145 2018-10-09)

I've installed the current beta version of Rust per instructions in RustWasm book:

https://rustwasm.github.io/book/game-of-life/setup.html

Should I be using the nightly version of Rust?

Thanks, :)

Compilation failed

Environment:

debian bullseye
cargo 1.67.0 (8ecd4f20a 2023-01-10)
version @master branch
   Compiling actix-macros v0.1.3
error[E0659]: `parse_quote_spanned` is ambiguous
   --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/pin-project-internal-0.4.28/src/pin_project/derive.rs:865:67
    |
865 |                 proj_generics.make_where_clause().predicates.push(parse_quote_spanned! { span =>
    |                                                                   ^^^^^^^^^^^^^^^^^^^ ambiguous name
    |
    = note: ambiguous because of a conflict between a `macro_rules` name and a non-`macro_rules` name from another module
note: `parse_quote_spanned` could refer to the macro defined here
   --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/pin-project-internal-0.4.28/src/utils.rs:23:1
    |
23  | / macro_rules! parse_quote_spanned {
24  | |     ($span:expr => $($tt:tt)*) => {
25  | |         syn::parse2(quote::quote_spanned!($span => $($tt)*)).unwrap_or_else(|e| panic!("{}", e))
26  | |     };
27  | | }
    | |_^
note: `parse_quote_spanned` could also refer to the macro imported here
   --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/pin-project-internal-0.4.28/src/pin_project/derive.rs:7:5
    |
7   |     *,
    |     ^
    = help: use `self::parse_quote_spanned` to refer to this macro unambiguously

error[E0659]: `parse_quote_spanned` is ambiguous
   --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/pin-project-internal-0.4.28/src/pinned_drop.rs:108:21
    |
108 |             *path = parse_quote_spanned! { path.span() =>
    |                     ^^^^^^^^^^^^^^^^^^^ ambiguous name
    |
    = note: ambiguous because of a conflict between a `macro_rules` name and a non-`macro_rules` name from another module
note: `parse_quote_spanned` could refer to the macro defined here
   --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/pin-project-internal-0.4.28/src/utils.rs:23:1
    |
23  | / macro_rules! parse_quote_spanned {
24  | |     ($span:expr => $($tt:tt)*) => {
25  | |         syn::parse2(quote::quote_spanned!($span => $($tt)*)).unwrap_or_else(|e| panic!("{}", e))
26  | |     };
27  | | }
    | |_^
note: `parse_quote_spanned` could also refer to the macro imported here
   --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/pin-project-internal-0.4.28/src/pinned_drop.rs:3:50
    |
3   | use syn::{spanned::Spanned, visit_mut::VisitMut, *};
    |                                                  ^
    = help: use `self::parse_quote_spanned` to refer to this macro unambiguously

   Compiling thiserror-impl v1.0.30
For more information about this error, try `rustc --explain E0659`.
error: could not compile `pin-project-internal` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
make: *** [Makefile:43: build-backend] Error 101

Unable to run `make backend`: : cannot find type `Acl_permission` in this scope

when i first ran make backend, i got the following error.

error: recursion limit reached while expanding the macro `table_body`
   --> src/backend/database/schema.rs:173:1
    |
173 | / table! {
174 | |     /// Representation of the `peers` table.
175 | |     ///
176 | |     /// (Automatically generated by Diesel.)
...   |
286 | |     }
287 | | }
    | |_^
    |
    = help: consider adding a `#![recursion_limit="128"]` attribute to your crate
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to previous error

error: Could not compile `webapp`.

i could fix it by adding '#![recursion_limit="256"]' to /src/lib.rs

Now i got the following error

error[E0412]: cannot find type `Acl_permission` in this scope
  --> src/backend/database/schema.rs:29:23
   |
29 |         permission -> Acl_permission,
   |                       ^^^^^^^^^^^^^^ did you mean `permission`?

error[E0412]: cannot find type `Acl_permission` in this scope
  --> src/backend/database/schema.rs:61:23
   |
61 |         permission -> Acl_permission,
   |                       ^^^^^^^^^^^^^^ did you mean `permission`?

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0412`.
error: Could not compile `webapp`.

To learn more, run the command again with --verbose.

steps to reproduce:

git clone
make backend

Empty webpage upon start

First, I read your Medium articles and they are amazing! Thanks for sharing this!

I have issues with showing something in the browser after running your application.
Just something that is weird about the readme:

Ensure the runtime dependencies are installed, and then **start the two containers**.
> sudo apt install -y postgresql-client
> cargo install diesel_cli --no-default-features --features "postgres"
> sudo make deploy

The last command doesn't start the containers, only builds them. (the makefile confirms this)

After executing make run-app, only the backend is running.
This allowed me to surf to http://127.0.0.1:30080/ but of course got panics because the frontend is not found.
So after make run-frontend, I just get an empty screen...

Can you help me getting this work?

Ah, forgot to mention. I'm using WSL2 with Debian ;-) Maybe this is related. Anyway, I've running both backend & frontend so I could see the traces, but no error is shown.

Consider switching to CBOR

The benefit would be to use serde and its derivations as well as using the same data types for the protocol and diesel models.

A disadvantage is that we loose the versioning and a bit of performance.

#9 contains a experimental implementation

Compile Error: error[E0433] and error[E0425]

Hi everyone, I'm very newbies in Rust. I tried to follow this installation steps but always got these errors (error[E0433] and error[E0425])
This is my environment

  • Ubuntu 20.04.6 LTS (WSL on windows 11)
  • cargo 1.72.1
  • version @master branch

I already run cargo clean, cargo update and make all instructions until Compiling yew-router v0.16.0 step I got these errors

`error[E0433]: failed to resolve: unresolved import
--> /home/fu4d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stdweb-0.4.20/src/webcore/ffi/wasm_bindgen.rs:67:32
|
67 | alloc: &Closure< Fn( usize ) -> *mut u8 >,
| ^ unresolved import

error[E0425]: cannot find function wasm_bindgen_initialize in this scope
--> /home/fu4d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stdweb-0.4.20/src/webcore/ffi/wasm_bindgen.rs:77:22
|
77 | let module = wasm_bindgen_initialize( memory, table, &alloc, &free );
| ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0425, E0433.
For more information about an error, try rustc --explain E0425.
error: could not compile stdweb (lib) due to 2 previous errors; 4712 warnings emitted
warning: build failed, waiting for other jobs to finish...
Error: Compiling your crate to WebAssembly failed
Caused by: Compiling your crate to WebAssembly failed
Caused by: failed to execute cargo build: exited with exit status: 101
full command: cd "/mnt/d/project/rew2/webapp.rs/frontend" && "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"
make: *** [Makefile:49: build-frontend] Error 1`

Could someone give me suggestion what I have to do to resolve this issue? thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.