update readmes again

This commit is contained in:
David Westgate 2024-06-13 12:52:48 -07:00
parent 32a5e9287b
commit 2ac09d116d
5 changed files with 25 additions and 21 deletions

View File

@ -25,3 +25,16 @@ See [backend/README.md](./backend/README.md)
See [frontend/README.md](./frontend/README.md)
### State of things
This application is a proof of concenpt of the ability to use Rust for full stack web developmnet as well as an exercise in my experience using rust. To assist with running/developing this application, here is a look at my enviornment while I am working
![dev](./dev.png)
#### From Top left, counterclockwise
1) Terminal in `./frontend` running `trunk serve`
2) Terminal in `./backend` running `cargo run`
3) `postgres:latest` docker container with an `exec` terminal. In the terminal, I run `psql -U postgres` to connect to postgres, then `\dt` to confirm the tables exist. From there, any query can be written or tested.
4) Postman, to test the APIs for which there is not a frontend compoment.
5) Browsers connected to `http://127.0.0.1:8080` to use the web app.

BIN
dev.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 KiB

View File

@ -24,37 +24,31 @@ Then, access the webserver shown in standard output in a browser of your choice
### Dependency overview
#### std
TODO
#### [Yew](https://crates.io/crates/yew)
TODO
Frontend rendering engine and framework to allow the combination of state and rendering into re-usable components. Similar to [ReactJS](https://react.dev/) with which I am familiar
#### [gloo](https://crates.io/crates/gloo)
TODO
Assists with error handling in the wasm content
#### [Serde/serde_json](https://crates.io/crates/serde)
A useful package for serializing and deserializing data.
#### [wasm_bindgen_futures](https://crates.io/crates/wasm_bindgen_futures)
TODO
Allows the connection of Rust futures to behave like javascript promises in a wasm content
### Source overview
#### [`src/main.rs`](/frontend/src/main.rs)
TODO
This is primariliy the implementation of the Yew component for the `App`, that being the top level wrapper for what this page should render in the DOM. It shows us the finder and question, and also handles state managemnet.
#### [`src/finder.rs`](/frontend/src/finder.rs)
TODO
Finder is a wrapper component containing a search bar and find button, which allows the user to find a question by a given id. This component deals with mainting state and binding the button to a callback function.
#### [`src/question.rs`](/frontend/src/question.rs)
TODO
The question component renders the question by showing its parts, that being title, content, tags and id. It is also responsible for fetching the data when passed an id by props
### Looking ahead
TODO
#### Code cleanup
TODO
#### Higher priority
TODO
#### Lesser priority
TODO
* It would be nice to build out more functionality, specifically at least some function to utilize each API on the backend. Seperate components to help create, update and delete questions could be made, or the question components currently there could be modified to allow mutation, deletion and creation.
* Style - A little style goes a long way to improve the user experience. That said, I prefer occasions when a UI designer provides me a style guide or mock up.

View File

@ -13,14 +13,12 @@ pub fn Finder(props: &FinderProps) -> Html {
Callback::from(move |e: InputEvent| {
let input: HtmlTextAreaElement = e.target_unchecked_into();
let value = input.value();
// log!(format!("key change: {:?}", value));
let value = value.trim();
let value = if value.is_empty() {
None
} else {
Some(value.to_string())
};
// log!(format!("key change final: {:?}", value));
key.set(value);
})
};

View File

@ -48,7 +48,6 @@ impl Component for App {
true
}
Msg::GetQuestion(key) => {
// log!(format!("GetQuestion: {:?}", key));
App::refresh_question(ctx, key);
false
}