{"id":13605786,"url":"https://github.com/rust10x/rust-web-app","last_synced_at":"2025-04-12T05:34:37.813Z","repository":{"id":195276461,"uuid":"682878661","full_name":"rust10x/rust-web-app","owner":"rust10x","description":"Code template for a production Web Application using Axum: The AwesomeApp Blueprint for Professional Web Development.","archived":false,"fork":false,"pushed_at":"2024-08-05T17:38:48.000Z","size":180,"stargazers_count":425,"open_issues_count":0,"forks_count":60,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-08-05T20:43:26.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust10x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-25T04:51:56.000Z","updated_at":"2024-08-05T17:38:51.000Z","dependencies_parsed_at":"2023-10-30T03:25:52.603Z","dependency_job_id":"21fcc312-4d34-436e-8d77-45454191d025","html_url":"https://github.com/rust10x/rust-web-app","commit_stats":null,"previous_names":["rust10x/rust-web-app"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust10x%2Frust-web-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust10x%2Frust-web-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust10x%2Frust-web-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust10x%2Frust-web-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust10x","download_url":"https://codeload.github.com/rust10x/rust-web-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223498031,"owners_count":17155243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:02.763Z","updated_at":"2025-04-12T05:34:37.799Z","avatar_url":"https://github.com/rust10x.png","language":"Rust","readme":"# Rust10x Web App Blueprint for Production Coding\n\nMore info at: https://rust10x.com/web-app\nDiscord: https://discord.gg/XuKWrNGKpC\n\n# Note last commit with `modql 0.4.0-rc.4`\n\n- There is a small change in the `SeaField::new(iden, value)` where the value is now `impl Into\u003cSimpleExpr\u003e`. \n\t- `so change:` `SeaField::new(UserIden::Pwd, pwd.into())`\n\t- `       to:` `SeaField::new(UserIden::Pwd, pwd)`\n\nYou can find this change in the `. update to modql 0.4.0-rc.4`\n\n# IMPORTANT NOTE on E06 - 2024-01-23 BIG UPDATE\n\nThis update ([GitHub tag: E06](https://github.com/rust10x/rust-web-app/releases/tag/E06)) is significant in many respects:\n\n- **1) Data Model Change**\n\t- We are transitioning from the simple `Project / Task` model to a more intricate one centered around AI chat, specifically `Agent, Conv / ConvMsg`.\n\t- Subsequently, we'll introduce `Org / Space` constructs to demonstrate multi-tenancy and a \"workspace\" type of container, common in many use cases (like GitHub repositories, Discord servers, etc.).\n\t- The `examples/quick_dev` has been updated to reflect the new data model.\n\t- IMPORTANT - While `Agent` and `Conv` concepts exist, the blueprint's purpose isn't to develop a complete AI chat system. Instead, it aims to illustrate the common structures needed to build such an application and others. The Agents are merely examples of entities and might later exhibit some \"Echo\" capability to demonstrate the integration of long-running, event-based services.\n\n- **2) ModelManager DB Transaction Support**\n\t- There's a significant enhancement to the `ModelManager`, which now contains a `lib_core::model::store::Dbx` implementing an on-demand **database transaction** support.\n\t- By default, the ModelManager operates non-transactionally; each query executes as its own DB command. However, Bmc functions can transform a ModelManager into a transactional one and initiate/commit a transaction \n\t\t- Search for `mm.dbx().begin_txn()` for an example in `UserBmc::create`.\n\n- **3) Declarative Macros**\n\t- To reduce boilerplate, this Rust10x blueprint now supports flexible declarative macros (i.e., `macro_rules`) at the `lib_rpc` and `lib_core::model` levels. These create the common basic CRUD JSON-RPC functions and the common BMC CRUD methods.\n\t\t- Search for `generate_common_bmc_fns` or `generate_common_rpc_fns` to see them in actions.\n\t- It's important to note that these declarative macros are additive and optional. In fact, entities can introduce additional behavior as needed or opt out of using these macros if custom logic is required, even for common behaviors.\n\n- **4) Code Update**\n\t- All JSON-RPC responses now include a `.data` field as `result.data` to represent the requested data. This adds flexibility to later include metadata at the root of the `result` object (the JSON-RPC specification prohibits adding anything at the root of the JSON response).\n\t\t- This is in the `lib_rpc::response` crate/module.\n\t- The introduction of a `conv_id` in the `Ctx` paves the way for a future `Access Control System`, which will be privilege-based and tied to key container constructs (e.g., `Org`, `Space`, `Conv`).\n\n## Rust10x Web App YouTube Videos:\n\n- [Episode 01 - Rust Web App - Base Production Code](https://youtube.com/watch?v=3cA_mk4vdWY\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n    - [Topic video - Code clean -  `#[cfg_attr(...)]` for unit test](https://www.youtube.com/watch?v=DCPs5VRTK-U\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n\t- [Topic video - The Reasoning Behind Differentiating ModelControllers and ModelManager](https://www.youtube.com/watch?v=JdLi69mWIIE\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n\t- [Topic video - Base64Url - Understanding the Usage and Significance of Base64URL](https://www.youtube.com/watch?v=-9K7zNgsbP0\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n\n- [Episode 02 - Sea-Query (sql builder) \u0026 modql (mongodb like filter)](https://www.youtube.com/watch?v=-dMH9UiwKqg\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n\n- [Episode 03 - Cargo Workspace (multi-crates)](https://www.youtube.com/watch?v=zUxF0kvydJs\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n\t- [AI-Voice-Remastered](https://www.youtube.com/watch?v=iCGIqEWWTcA\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n\n- [Episode 04 - Multi-Scheme Password Hashing](https://www.youtube.com/watch?v=3E0zK5h9zEs\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n\n- [Episode 05 - JSON-RPC Dynamic Router](https://www.youtube.com/watch?v=Gc5Nj5LJe1U\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n\n- **Episode 06 coming upon request on [discord](https://discord.gg/XuKWrNGKpC)**\n\n- Other Related videos: \n\t- [Rust Axum Full Course](https://youtube.com/watch?v=XZtlD_m59sM\u0026list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)\n\n\n## Starting the DB\n\n```sh\n# Start postgresql server docker image:\ndocker run --rm --name pg -p 5432:5432 \\\n   -e POSTGRES_PASSWORD=welcome \\\n   postgres:17\n\n# (optional) To have a psql terminal on pg. \n# In another terminal (tab) run psql:\ndocker exec -it -u postgres pg psql\n\n# (optional) For pg to print all sql statements.\n# In psql command line started above.\nALTER DATABASE postgres SET log_statement = 'all';\n```\n\n## Dev (watch)\n\n\u003e NOTE: Install cargo watch with `cargo install cargo-watch`.\n\n```sh\n# Terminal 1 - To run the server.\ncargo watch -q -c -w crates/services/web-server/src/ -w crates/libs/ -w .cargo/ -x \"run -p web-server\"\n\n# Terminal 2 - To run the quick_dev.\ncargo watch -q -c -w crates/services/web-server/examples/ -x \"run -p web-server --example quick_dev\"\n```\n\n## Dev\n\n```sh\n# Terminal 1 - To run the server.\ncargo run -p web-server\n\n# Terminal 2 - To run the tests.\ncargo run -p web-server --example quick_dev\n```\n\n## Unit Test (watch)\n\n```sh\ncargo watch -q -c -x \"test -- --nocapture\"\n\n# Specific test with filter.\ncargo watch -q -c -x \"test -p lib-core test_create -- --nocapture\"\n```\n\n## Unit Test\n\n```sh\ncargo test -- --nocapture\n\ncargo watch -q -c -x \"test -p lib-core model::task::tests::test_create -- --nocapture\"\n```\n\n## Tools\n\n```sh\ncargo run -p gen-key\n```\n\n\u003cbr /\u003e\n\n---\n\nMore resources for [Rust for Production Coding](https://rust10x.com)\n\n\n[This repo on GitHub](https://github.com/rust10x/rust-web-app)","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust10x%2Frust-web-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust10x%2Frust-web-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust10x%2Frust-web-app/lists"}