{"id":16113987,"url":"https://github.com/alexichepura/lapa","last_synced_at":"2025-04-06T22:06:40.413Z","repository":{"id":177791906,"uuid":"660917831","full_name":"alexichepura/lapa","owner":"alexichepura","description":"Leptos Axum Prisma starter with Admin dashboard and SSR/SPA website","archived":false,"fork":false,"pushed_at":"2025-03-17T08:59:48.000Z","size":829,"stargazers_count":104,"open_issues_count":11,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T21:06:16.817Z","etag":null,"topics":["admin","axum","boilerplate","leptos","prisma","starter","webdev"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexichepura.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","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-07-01T08:02:08.000Z","updated_at":"2025-03-23T05:19:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0e088e1-156c-4802-9112-47008f9b45ab","html_url":"https://github.com/alexichepura/lapa","commit_stats":null,"previous_names":["alexichepura/lapa"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexichepura%2Flapa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexichepura%2Flapa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexichepura%2Flapa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexichepura%2Flapa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexichepura","download_url":"https://codeload.github.com/alexichepura/lapa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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":["admin","axum","boilerplate","leptos","prisma","starter","webdev"],"created_at":"2024-10-09T20:13:49.404Z","updated_at":"2025-04-06T22:06:40.392Z","avatar_url":"https://github.com/alexichepura.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"128\" alt=\"LAPA Logo\" src=\"https://github.com/alexichepura/lapa/assets/5582266/d13a532e-dd04-48a5-af49-d5f8e9e75c6e\"\u003e\n\n# LAPA - Leptos Axum Prisma starter with Admin dashboard and SSR/SPA website\n\nIntro: \u003chttps://youtu.be/6eMWAI1D-XA\u003e \\\nDemo site: \u003chttps://lapa.chepura.space\u003e\n\n\u003cimg width=\"360\" alt=\"Site Home\" src=\"https://github.com/alexichepura/lapa/assets/5582266/66326ce4-c61c-4fcc-a9f3-1f0548bb8c60\"\u003e\n\u003cimg width=\"360\" alt=\"Site Home\" src=\"https://github.com/alexichepura/lapa/assets/5582266/4a0f0d99-fd95-4abe-84bb-30e43c9aeeaa\"\u003e\n\n\u003cimg width=\"360\" alt=\"Admin Dashboard\" src=\"https://github.com/alexichepura/lapa/assets/5582266/cfb71304-9fdf-45c1-bd94-85ec90f07a0f\"\u003e\n\u003cimg width=\"360\" alt=\"Admin Posts\" src=\"https://github.com/alexichepura/lapa/assets/5582266/7f0219cf-f231-4559-bffe-faec6e7b9285\"\u003e\n\u003cimg width=\"360\" alt=\"Admin Post\" src=\"https://github.com/alexichepura/lapa/assets/5582266/d7ce5c3e-3686-4d41-9da3-e898ef7d2cad\"\u003e\n\u003cimg width=\"360\" alt=\"Admin Post\" src=\"https://github.com/alexichepura/lapa/assets/5582266/3f08bf40-9c80-4b6a-8a5b-b9b2b8732066\"\u003e\n\u003cimg width=\"360\" alt=\"Admin Settings\" src=\"https://github.com/alexichepura/lapa/assets/5582266/b2913992-bfb2-4454-83f3-f526a73fbb49\"\u003e\n\u003cimg width=\"90\" alt=\"Admin Mobile\" src=\"https://github.com/alexichepura/lapa/assets/5582266/96f10565-19da-4b8e-80c0-6125bb5a97ac\"\u003e\n\n## Motivation\n\nI want to have practical full-stack setup to build websites and services. \\\nUtilising type safety and performance of Rust opens the door for new era of web dev, that is taking off. \\\nEcosystem and standardized approach is helpful to develop scalable and future-proof apps. \\\nSome benefits:\n\n- strict types\n- enforced error and value management (Result and Option)\n- predictable performance (no garbage collector)\n- native performance\n- single bundler (cargo)\n- straight path to WebAssembly\n\n## 3 pillars\n\n### Leptos\n\n\u003chttps://leptos.dev\u003e \\\n[leptos-rs/leptos](https://github.com/leptos-rs/leptos) \\\nA cutting-edge, high-performance frontend framework SSR+SPA. Using reactive signals.\n\n### Axum\n\n[tokio-rs/axum](https://github.com/tokio-rs/axum) \\\nBackend framework built with Tokio, Tower, and Hyper. Focuses on ergonomics and modularity.\n\n### Prisma\n\n\u003chttps://www.prisma.io\u003e \\\n\u003chttps://prisma.brendonovich.dev\u003e \\\n[Brendonovich/prisma-client-rust](https://github.com/Brendonovich/prisma-client-rust) \\\nType-safe database access.\n\n## Features\n\n- project\n  - SEO site\n  - admin dashboard\n  - CLI with clap: settings-init, user-add, migrate\n  - prisma schema: user, session, post, image, settings\n  - ops scripts: build, upload, run (site, admin, cli)\n- site\n  - SSR + SPA hydrated\n  - open graph meta tags\n- prod features\n  - ratelimit with [benwis/tower-governor](https://github.com/benwis/tower-governor)\n  - compression with tower-http/compression\n  - precompression with [ryanfowler/precompress](https://github.com/ryanfowler/precompress) see ./ops scripts\n- admin auth and session with\n  - axum_session [AscendingCreations/AxumSessions](https://github.com/AscendingCreations/AxumSessions)\n  - axum_session_auth [AscendingCreations/AxumSessionsAuth](https://github.com/AscendingCreations/AxumSessionsAuth)\n  - custom prisma DatabasePool\n- post\n  - admin CRUDL\n  - published_at\n- images\n  - preview and upload\n  - resize and convert on backend\n  - order in gallery\n  - is_hero flag\n  - delete and alt update in \"dialog\"\n- settings\n  - robots.txt, site_url\n  - images sizes\n  - home_text\n- css\n  - based on \u003chttps://open-props.style\u003e\n  - dark and light themes\n  - mobile first\n  - sass, @custom-media, @container, see notes on css below\n- components\n  - forms, inputs and response messages\n  - input datetime-local usage with chrono library\n  - RoutingProgress\n  - Favicons\n\n## Run\n\n### Generate prisma client\n\n```sh\ncargo prisma db push # generate client and push schema to db\n# or\ncargo prisma generate # only generate client\n```\n\n### Init\n\n```sh\nRUST_LOG=\"debug\" cargo lapa settings-init\nRUST_LOG=\"debug\" cargo lapa user-add\n```\n\n### Dev\n\n```sh\nRUST_LOG=\"info,admin=debug\" cargo leptos watch -p admin\nRUST_LOG=\"info,site=debug\" cargo leptos watch -p site\n```\nTip to enable tower_http debug\n```sh\nRUST_LOG=\"info,tower_http=debug,admin=debug\" cargo leptos watch -p admin\nRUST_LOG=\"info,tower_http=debug,site=debug\" cargo leptos watch -p site\n```\n\n### Prod\n\nSee relevant tutorial and demo project.\n\u003chttps://github.com/alexichepura/leptos_axum_prisma_sozu\u003e\n\u003chttps://www.youtube.com/watch?v=KLg8Hcd3K_U\u003e\n\n```sh\ncargo leptos build --release\n```\n\nProduction with compress and ratelimit\n\n```sh\ncargo leptos build --release --features=\"compression,ratelimit\"\n# or\ncargo leptos build --release --features=\"prod\"\n```\n\n### Ops\n\n./ops folder contains example scripts to prepare production build and deploy it on server.\nCheck .env.example\nRequires \u003chttps://github.com/ryanfowler/precompress\u003e\n\n```sh\n./ops/site-deploy.sh \u0026\u0026 ./ops/site-run.sh # build, deploy and run site\n./ops/admin-deploy.sh \u0026\u0026 ./ops/admin-run.sh # build, deploy and run admin\n```\n\n```sh\n./ops/prisma-upload.sh # upload prisma folder with migrations to server\n./ops/cli-deploy.sh # upload cli to server\n```\n\n## Notes on CSS\n\nModern CSS is quite cool. Nesting, custom media, container queries. All that was used here before, but required cargo-leptos fork. As well another cli step to bundle everything into one css. For now returning to SASS.\nConsidering return back to CSS if/when cargo-leptos will support lightningcss config and bundling.\n\nSass PR \u003chttps://github.com/alexichepura/lapa/pull/24\u003e.\nLigntningcss bundle with cli proof of concept \u003chttps://github.com/alexichepura/lapa/pull/23\u003e.\n\n## Notes on prisma\n\nHow initial migration created\n\u003chttps://www.prisma.io/docs/guides/migrate/developing-with-prisma-migrate/add-prisma-migrate-to-a-project\u003e\n\n```sh\nmkdir -p prisma/migrations/0_init\ncargo prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script \u003e prisma/migrations/0_init/migration.sql\ncargo prisma migrate resolve --applied 0_init\n```\n\n## License\n\nThis project is licensed under the terms of the\n[MIT license](/LICENSE-MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexichepura%2Flapa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexichepura%2Flapa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexichepura%2Flapa/lists"}