bcnrust / devbcn-workshop Goto Github PK
View Code? Open in Web Editor NEWπ¦π¨ DevBcn Workshop - Full Stack Rust - Actix - Postgres - Shuttle - Dioxus
Home Page: https://bcnrust.github.io/devbcn-workshop/
License: MIT License
π¦π¨ DevBcn Workshop - Full Stack Rust - Actix - Postgres - Shuttle - Dioxus
Home Page: https://bcnrust.github.io/devbcn-workshop/
License: MIT License
Hello :)
IΒ΄m sorry for opening up a issue, but i canΒ΄t help me out.
As I was following the instructions from your Tutorial i ran into this error. I checked it multiple times and can say i exactly followed the instructions.
error[E0277]: the trait bound
shuttle_shared_db::Postgres: ResourceInputBuilderis not satisfied --> api/shuttle/src/main.rs:11:7 #[shuttle_shared_db::Postgres()] pool: sqlx::PgPool, ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait
ResourceInputBuilderis not implemented for
shuttle_shared_db::Postgres`
error[E0599]: no function or associated item named default
found for struct shuttle_shared_db::Postgres
in the current scope
--> api/shuttle/src/main.rs:9:1
#[shuttle_runtime::main]
|^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in Postgres
`
As an absolute beginner i would be very thankfull for a solution to this problem, i canΒ΄t figure out myself.
Under the App Effects section, immediately before the transition into the Film Modal subsection, there's a seemingly unfinished paragraph starting with "Sure, here's a revised version with a more formal tone: " just below the first code snippet on the page.
Adding the line
#[shuttle_shared_db::Postgres()] pool: sqlx::PgPool,
into
`async fn actix_web(
) -> ShuttleActixWeb<impl FnOnce(&mut ServiceConfig) + Send + Clone + 'static> {
let config = move |cfg: &mut ServiceConfig| {
cfg.service(hello_world);
};`
in main.rs in api > shuttle > src breaks the compile with:
no function or associated item named new
found for struct shuttle_shared_db::Postgres
in the current scope
items from traits can only be used if the trait is in scope rustc
README guide link is https://https://bcnrust.github.io/devbcn-workshop/.
Thanks for building this workshop, it's a great way to try out new technologies.
I came across an issue with the unit testing section. I decided not to abandon macros at the end of configure section, because why would you?
It turns out Actix unit testing does not work with macro-enhanced handlers as they are converted to a struct and not left as a function.
It would be useful to motivate the switch from macros to raw handlers. At the moment its presented as just something you could do for fun.
Further, the code in the repo (check_health) does not match the document coded (health).
(Did I miss something?)
Sorry for opening an issue for a question, but the discussions are not available for this repo.
This workshop is awesome. But I don't want to be locked into using shuttle. I just want to run it on my own server.
It is mentioned somewhere that this workshop was updated to use shuttle. However, I think that being able to run it on your own server is more imoprtant than requiring people to use a 3rd party service to deploy the app.
Is there any way that this workshop includes a separate chapter that explains how not to use shuttle?
Would be great to see an image in the beginning of what the final demo looks like.
I have taken the vscode testing script file api.http
and adapted it to a script for the HTTP Client, which is a free plugin for IDEs from Jetbrains.
It features (grand word, isn't it)
dev
, remote shuttle
)film_id
of a newly created filmThere are two files needed. You can find both of them in this gist: https://gist.github.com/bronsen/509f5087b2b463d0268750bd6f236d87
Please make use of them! π
I have put them in api/lib/tests
, alongside health.rs
. However, you can put them whereever you like, as long as you keep those two files (rest-api.http, http-client.env.json) together.
rest-api.http
in your Jetbrains IDE where you have installed the HTTP Client plugin.Run with:
Just like the original api.http
file, it's a bunch of http calls (GET, POST, etc) seperated by markers (###
). There are placeholders (for example {{host}}
), that are filled from the corresponding env file.
GET {{host}}/health HTTP/1.1
HTTP Client also has so-called Response handlers, which are javascript and can access the response object of the previous call, and can also set variables. One such variable is film_id
that is used to fill the {{film_id}}
placeholder.
#shortened example
POST {{host}}/v1/films
{"some": "data"}
> {%
client.global.set("film_id", response.body["id"]);
# from now on we can use {{film_id}} in the script
%}
I hope this is useful to others, who follow that exhaustive tutorial π ππΎ
I am working through the workshop and am at Section 2.8 - Deploying the database. cargo shuttle run
works great but cargo shuttle deploy
yields the following error:
Error: failed to parse a successful response
Caused by:
UUID parsing failed: invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `H` at 3 at line 1 column 86
And I have not found anything more helpful needed to diagnose the issue or even determine which file has an issue. .
Any suggestions for how to find diagnostic info?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.