Skip to content

tobtrie/htmx-rust-todo-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTMX meets Rust

This project try to evaluate the new library HTMX. For simplicity this projects implements a todo list. The data is not stored in a database. It is only stored inside the application state.

Project Todos

  • ❏ fix the Mutex and lifetime error in the get_state method. I guess the lifetime config does not solve the problem

  • ❏ use get_state method for all methods that uses the app state

    • This seems not so easy as expected due to some problems with the borrow checker

  • ✓ Only the toggled item is replaced

  • ✓ add a counter for done and not done tasks and update it with the click an the checkbox

  • ❏ refactor main.rs file and move some code to other files

  • ❏ clear input after clicking on the add button

    • the snippet "hx-on::after-request="this.reset()" fixes the problem, but it is not compatible with maud.

How to start developing

To start developing you need to install Rust. You can do it via Rustup. This is a so called toolchain installer for Rust. It installs Rust and all necessary tools for the development (like cargo or clippy) and necessary toolchains for your operation system.

After that you can start developing this application. With the command cargo run you start the server at port 8080. When you open a browser and goto the URL http://localhost:8080 you can see the frontend.

If you want to develop it is quite handy to use the cargo-watch cli tool. This tool starts a development server and recompiles the server if you save a changed file. After you installed the tool you can start the development server with the command cargo watch -x run. This compiles the code and start the server as described above.

Project details

Technologies

This project uses Rust as server language. The server framework is acitx-web. The frontend is generated by the library maud, which is also a Rust library. For the styling the CSS Library Tailwind is used. The library HTMX is used for the interactivity and server request.

Architecture

This application is server-side-rendered app. Which means the entire web frontend is generated by the maud library in the frontend.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published