{"id":51150259,"url":"https://github.com/mzyxnuel/tars","last_synced_at":"2026-06-26T05:30:49.681Z","repository":{"id":358237211,"uuid":"1218311278","full_name":"mzyxnuel/tars","owner":"mzyxnuel","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-16T10:46:25.000Z","size":196,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-16T12:40:00.437Z","etag":null,"topics":["framework","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mzyxnuel.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":"2026-04-22T18:43:30.000Z","updated_at":"2026-05-16T10:46:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mzyxnuel/tars","commit_stats":null,"previous_names":["mzyxnuel/tars"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mzyxnuel/tars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzyxnuel%2Ftars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzyxnuel%2Ftars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzyxnuel%2Ftars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzyxnuel%2Ftars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mzyxnuel","download_url":"https://codeload.github.com/mzyxnuel/tars/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzyxnuel%2Ftars/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34805072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["framework","rust"],"created_at":"2026-06-26T05:30:48.432Z","updated_at":"2026-06-26T05:30:49.670Z","avatar_url":"https://github.com/mzyxnuel.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TARS — Laravel-in-Rust\n\nA Laravel-inspired full-stack web framework for Rust. v1.\n\nTARS gives you Laravel's developer experience — controllers, migrations,\nseeders, factories, form requests, resources, configs — but in Rust. The\nHTTP layer wraps `axum`, the data layer wraps `sqlx`, the optional frontend\nwraps `dioxus` (cross-compiles to web, desktop, and mobile), and the\ncomponent library `tars-ui` ships pre-styled Dioxus components.\n\n- **JSON-first.** Frontend and backend always talk JSON.\n- **Laravel 13 directory tree**, with two tweaks:\n  - `/app` — controllers, middleware, requests, resources, providers\n    *(no `app/Models` — see below)*\n  - `/models` — all models, shared between frontend and backend\n  - `/resources` — frontend source files (Vue-like components,\n    file-based routes)\n\n## Workspace layout\n\n```\ncrates/\n├── tars-core         HTTP, routing, request/response, config, CORS\n├── tars-orm          Models, QueryBuilder, migrations, seeders, factories, resources\n├── tars-validation   Validation rules + FormRequest\n├── tars-ui           Dioxus component library (Button, Input, Card, Table, …)\n├── tars-frontend     Dioxus wrapper with Vue-inspired DX + file-based routing\n└── tars-cli          `tars` binary — artisan-like codegen + scaffold\n\nexample-app/           Full example with Laravel 13 directory tree\nexample-app/resources/ Frontend Cargo crate (Dioxus) that talks JSON to it\n```\n\n## Backend features\n\n- `Application` + `Router` (groups, resource routes, global middleware)\n- `Controller` + `Middleware` traits, async-trait based\n- `Request` with `input`, `only`, `except`, `has`, `route`, `json` helpers\n- `Response` with `json`, `created`, `no_content` helpers\n- `config(\"app.name\")` from `config/*.toml` files\n- Models with `all`, `find`, `create`, `delete` + chainable `QueryBuilder`\n- Migrations with fluent `Schema::create(\"users\").id().string(\"name\")`…\n- Factories + Seeders\n- Form requests (`StoreUserRequest::validated(\u0026req).await?`) — Laravel\n  rule strings: `\"required|email|max:255\"`\n- Model resources (`UserResource::from_user(user).to_json()`)\n- Built-in `Cors` middleware + auto OPTIONS preflight at every route\n\n## Frontend features\n\n- Optional — the backend has no dependency on `tars-frontend` / `tars-ui`\n- Cross-compiles to **web / desktop / mobile** (anything Dioxus targets)\n- Hooks: `use_signal()` (re-exported from Dioxus), `use_field()`,\n  `use_validation_errors()`, `use_route_params()`, `use_router_path()`\n- `\u003cLink to=\"/users\"\u003e…\u003c/Link\u003e` for client-side navigation\n- `use_router_path()`, `use_route_params()`, `navigate(\"/users\")`\n- File-based routing — drop a file in `resources/routes/`:\n  - `index.rs` → `/`\n  - `users.rs` → `/users`\n  - `users/[id].rs` → `/users/:id`\n  - `users/[id]/edit.rs` → `/users/:id/edit`\n- `Api::default_base()` JSON client (gloo-net on web)\n- `tars-ui` components (Button, Input, Card, Table, Alert, Form, …)\n  with a single bundled stylesheet (`tars_ui::STYLES`)\n- Reactive validation error map: `use_validation_errors()`\n\n## Running the example app\n\nThere are two ways to run the example. Both end up at the same set of\npages — pick whichever fits your workflow.\n\n### Option 1 — single-port (production-style)\n\nBuild the frontend once, then start the backend; it serves the frontend\nbundle at `/` and the JSON API at `/api/*` on the same port.\n\n```bash\ncd example-app/resources\ndx build --features web --release\n# Copy the build output into example-app/public/ (the dx 0.6 output path\n# is `target/dx/tars-example/release/web/public`).\ncp -r target/dx/tars-example/release/web/public/* ../public/\n\ncd ..\ncargo run --bin server\n# Open http://localhost:8000 — the frontend renders, the API is at /api/*.\n```\n\n### Option 2 — split dev servers (hot reload)\n\nBackend (terminal A):\n\n```bash\ncd example-app\ncargo run --bin server\n# Listens on 0.0.0.0:8000 (JSON API at /api/*).\n# Migrations auto-run. SQLite file at storage/app/database.sqlite.\n```\n\nFrontend (terminal B):\n\n```bash\n# Web (needs the Dioxus CLI: `cargo install dioxus-cli`)\ncd example-app/resources\ndx serve --features web\n# Listens on http://localhost:8080 with hot reload.\n\n# Desktop (needs gtk + webkit2gtk dev libs on Linux)\ncargo run -p example-resources --features desktop\n```\n\n\u003e Open the **frontend** URL (`:8080`), not the backend (`:8000`). The\n\u003e frontend calls `/api/...` cross-origin against `:8000` — CORS is\n\u003e permissive in dev.\n\nYou'll see:\n- `/` — Tailwind landing page with feature grid\n- `/users` — list with view / edit / delete actions\n- `/users/create` — form with field-level validation errors\n- `/users/:id` — show page\n- `/users/:id/edit` — edit form\n\n### Styling\n\nThe example app uses **Tailwind CSS** (loaded via the Tailwind Play CDN\nfrom `frontend/src/main.rs` — no npm needed). The bundled `tars-ui`\ncomponent stylesheet is also mounted, so you can mix utility classes\nwith `tars-ui` components freely. For a production build, replace the\nCDN script with a tailwindcss-CLI-compiled CSS file referenced from\n`Dioxus.toml`'s `[web.resource]` section.\n\n## CLI (artisan-like)\n\n```bash\ntars new my-app                 # scaffold a project\n\n# Generators\ntars make:controller PostController\ntars make:model Post\ntars make:migration create_posts_table\ntars make:seeder PostSeeder\ntars make:factory PostFactory\ntars make:request StorePostRequest\ntars make:resource PostResource\n\n# Backend lifecycle (wraps cargo)\ntars serve                      # cargo run --bin server\ntars serve --release            # cargo run --release --bin server\ntars migrate                    # cargo run --bin migrate\ntars db:seed                    # cargo run --bin seed\n\n# Frontend lifecycle (wraps the Dioxus CLI inside resources/)\ntars dev                        # dx serve --features web (hot reload)\ntars dev --port 3000            # forward --port to dx\ntars dev --platform desktop     # dx serve --features desktop\ntars build                      # dx build --features web\ntars build --release            # dx build --features web --release\ntars dx -- --help               # passthrough — anything dx accepts\n```\n\n## Tests\n\n```bash\ncargo test --workspace\n```\n\n## License\n\nBSD 3-Clause. See [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzyxnuel%2Ftars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmzyxnuel%2Ftars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzyxnuel%2Ftars/lists"}