{"id":49199766,"url":"https://github.com/suradet-ps/rust-herb","last_synced_at":"2026-04-23T13:06:03.964Z","repository":{"id":345864365,"uuid":"1119522462","full_name":"suradet-ps/rust-herb","owner":"suradet-ps","description":" A high-performance web application for browsing Thailand's NHSO-supported herbal medicines, rebuilt with Rust and Leptos.","archived":false,"fork":false,"pushed_at":"2026-04-15T17:12:29.000Z","size":38,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-21T15:49:51.090Z","etag":null,"topics":["axum","leptos","rust","rust-project"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suradet-ps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-19T12:03:48.000Z","updated_at":"2026-03-21T02:48:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/suradet-ps/rust-herb","commit_stats":null,"previous_names":["pharmacist-sabot/rust-herb","suradet-ps/rust-herb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suradet-ps/rust-herb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suradet-ps%2Frust-herb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suradet-ps%2Frust-herb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suradet-ps%2Frust-herb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suradet-ps%2Frust-herb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suradet-ps","download_url":"https://codeload.github.com/suradet-ps/rust-herb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suradet-ps%2Frust-herb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32181449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T11:42:27.955Z","status":"ssl_error","status_checked_at":"2026-04-23T11:42:18.877Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["axum","leptos","rust","rust-project"],"created_at":"2026-04-23T13:06:03.202Z","updated_at":"2026-04-23T13:06:03.959Z","avatar_url":"https://github.com/suradet-ps.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thai Herbal NHSO Support App (Rust Edition)\n\n\u003e A high-performance web application for browsing Thailand's NHSO-supported herbal medicines, rebuilt with **Rust** and **Leptos**.\n\n[![Rust](https://img.shields.io/badge/Rust-Nightly-CE412B?logo=rust\u0026logoColor=white)](https://www.rust-lang.org/)\n[![Leptos](https://img.shields.io/badge/Leptos-0.7-FF8937)](https://leptos.dev/)\n[![Axum](https://img.shields.io/badge/Axum-Backend-3178C6)](https://github.com/tokio-rs/axum)\n[![License](https://img.shields.io/badge/License-MIT-10B981)](LICENSE)\n\n## Overview\n\nThis project is a port of the original Vue.js application, rewritten in Rust to leverage **Server-Side Rendering (SSR)** and **WebAssembly (WASM)**. It serves as a digital formulary for healthcare professionals at Sabot Hospital, providing instant access to herbal medicine data.\n\n## Key Features\n\n- **Blazing Fast Performance**: Powered by Rust and WebAssembly with Leptos fine-grained reactivity.\n- **Server-Side Rendering (SSR)**: Initial HTML is rendered on the server (Axum) for SEO and fast First Contentful Paint.\n- **Pure Semantic SCSS**: Styled with clean, maintainable SCSS without relying on utility-class frameworks.\n- **Headless CMS**: Fetches data dynamically from Google Sheets via a secure Server Function.\n- **Instant Search \u0026 Filter**: Client-side filtering with memoized signals for immediate feedback.\n- **Type Safety**: Full end-to-end type safety from API response to UI rendering.\n\n## Tech Stack\n\n- **Frontend Framework**: [Leptos](https://github.com/leptos-rs/leptos) (Signals, Components, Suspense)\n- **Backend Server**: [Axum](https://github.com/tokio-rs/axum)\n- **Styling**: SCSS (Dart Sass)\n- **Data Fetching**: Reqwest (Server-side)\n- **Environment Management**: `dotenvy`\n\n## Getting Started\n\n### Prerequisites\n\n1. **Rust Nightly Toolchain**:\n   ```bash\n   rustup toolchain install nightly --allow-downgrade\n   rustup default nightly\n   rustup target add wasm32-unknown-unknown\n   ```\n\n2. **Cargo Leptos**:\n   ```bash\n   cargo install cargo-leptos --locked\n   ```\n\n3. **Sass (for styling)**:\n   ```bash\n   npm install -g sass\n   # or via your package manager of choice\n   ```\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/suradet-ps/rust-herb.git\n   cd rust-herb\n   ```\n\n2. **Configure Environment Variables**\n   Create a `.env` file in the root directory and add your Google Apps Script API URL:\n   ```env\n   GOOGLE_API_URL=https://script.google.com/macros/s/YOUR_SCRIPT_ID/exec\n   ```\n\n3. **Run the Development Server**\n   ```bash\n   cargo leptos watch\n   ```\n   The app will be available at `http://localhost:3000`.\n\n## Project Structure\n\n```\nrust-herb/\n├── public/              # Static assets\n├── src/\n│   ├── api.rs           # Server Functions for fetching data\n│   ├── app.rs           # Main application logic \u0026 routing\n│   ├── lib.rs           # Library entry point \u0026 Hydration\n│   ├── main.rs          # Server entry point (Axum)\n│   ├── models.rs        # Data structures (Structs)\n│   └── components/      # UI Components\n│       ├── header.rs\n│       ├── footer.rs\n│       ├── herb_card.rs\n│       ├── search_bar.rs\n│       └── ...\n├── style/\n│   └── main.scss        # Global SCSS styles\n└── Cargo.toml           # Dependencies\n```\n\n## Building for Production\n\nTo build the application for deployment:\n\n```bash\ncargo leptos build --release\n```\n\nThis will generate:\n1. A server binary in `target/server/release/rust-herb`\n2. Static site files in `target/site/`\n\n### Deployment (Linux Server)\n\n1. Copy the binary and the `site` folder to your server.\n2. Set the required environment variables:\n   ```bash\n   export LEPTOS_OUTPUT_NAME=\"rust-herb\"\n   export LEPTOS_SITE_ROOT=\"site\"\n   export LEPTOS_SITE_ADDR=\"0.0.0.0:3000\"\n   export GOOGLE_API_URL=\"your_google_script_url\"\n   ```\n3. Run the binary:\n   ```bash\n   ./rust-herb\n   ```\n\n## Testing\n\n```bash\n# Unit tests\ncargo test\n\n# Clippy (Linting)\ncargo clippy\n\n# Format check\ncargo fmt --all --check\n```\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuradet-ps%2Frust-herb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuradet-ps%2Frust-herb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuradet-ps%2Frust-herb/lists"}