{"id":20944129,"url":"https://github.com/diversable/test-start-aws","last_synced_at":"2026-04-24T15:32:19.730Z","repository":{"id":234048216,"uuid":"731465816","full_name":"diversable/test-start-aws","owner":"diversable","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-14T06:40:56.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-29T16:19:59.888Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diversable.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}},"created_at":"2023-12-14T06:28:54.000Z","updated_at":"2023-12-14T06:28:59.000Z","dependencies_parsed_at":"2024-04-18T02:57:14.009Z","dependency_job_id":"566f43a0-1762-42bb-ab9c-c44b1a94c139","html_url":"https://github.com/diversable/test-start-aws","commit_stats":null,"previous_names":["diversable/test-start-aws"],"tags_count":0,"template":false,"template_full_name":"leptos-rs/start-aws","purl":"pkg:github/diversable/test-start-aws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversable%2Ftest-start-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversable%2Ftest-start-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversable%2Ftest-start-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversable%2Ftest-start-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diversable","download_url":"https://codeload.github.com/diversable/test-start-aws/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversable%2Ftest-start-aws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32228970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"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":[],"created_at":"2024-11-18T23:39:19.309Z","updated_at":"2026-04-24T15:32:19.711Z","avatar_url":"https://github.com/diversable.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n    \u003csource srcset=\"https://raw.githubusercontent.com/leptos-rs/leptos/main/docs/logos/Leptos_logo_Solid_White.svg\" media=\"(prefers-color-scheme: dark)\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/leptos-rs/leptos/main/docs/logos/Leptos_logo_RGB.svg\" alt=\"Leptos Logo\"\u003e\n\u003c/picture\u003e\n\n# Leptos Starter Template for AWS Lambda\n\nThis is a template for the [Leptos](https://github.com/leptos-rs/leptos) web framework managed with [cargo-leptos](https://github.com/akesson/cargo-leptos) and integrated with [Axum](https://github.com/tokio-rs/axum) for deployment on [AWS Lambda](https://aws.amazon.com/lambda/).\n\n## Creating your template repo\n\nIf you don't have `cargo-leptos` installed you can install it with\n\n```bash\ncargo install cargo-leptos\n```\n\nThen run\n\n```bash\ncargo leptos new --git leptos-rs/start-axum\n```\n\nto generate a new project template.\n\n```bash\ncd {{project-name}}\n```\n\nto go to your newly created project.  \nFeel free to explore the project structure, but the best place to start with your application code is in `src/app.rs`.  \nAdditionally, Cargo.toml may need updating as new versions of the dependencies are released, especially if things are not working after a `cargo update`.\n\n## Running your project\n\n```bash\ncargo leptos watch\n```\n\nThe `--release` flag enables the [axum-aws-lambda](https://github.com/lazear/axum-aws-lambda) layer,\nwhich only works within the AWS Lambda environment,\nso it should be avoided locally.\n\n## Installing Additional Tools\n\nBy default, `cargo-leptos` uses `nightly` Rust, `cargo-generate`, and `sass`. If you run into any trouble, you may need to install one or more of these tools.\n\n1. `rustup toolchain install nightly --allow-downgrade` - make sure you have Rust nightly\n2. `rustup target add wasm32-unknown-unknown` - add the ability to compile Rust to WebAssembly\n3. `cargo install cargo-generate` - install `cargo-generate` binary (should be installed automatically in future)\n4. `npm install -g sass` - install `dart-sass` (should be optional in future\n\n## Compiling for Release\n\n```bash\ncargo leptos build --release\n```\n\nWill generate your server binary in target/server/release and your site package in target/site\n\n## Testing Your Project\n\n```bash\ncargo leptos end-to-end\n```\n\n```bash\ncargo leptos end-to-end --release\n```\n\nCargo-leptos uses Playwright as the end-to-end test tool.  \nTests are located in end2end/tests directory.\n\n## Deploying Your Project\n\nTo build and deploy your project to AWS, you'll need [cargo-lambda](https://www.cargo-lambda.info/).\nThey provide [installation instructions](https://www.cargo-lambda.info/guide/installation.html) on their site.\n\nLet's start by building the project with `cargo-leptos`:\n\n```bash\ncargo leptos build --release\n```\n\nWe won't use the server binary that it builds, since\nthe Lambda function requires a particular architecture that\n`cargo-lambda` will handle for us. If you'd rather not build the server twice,\nyou'll have to manage the WASM build and optimization yourself.\n\nNext, let's build the production server binary:\n\n```bash\nLEPTOS_OUTPUT_NAME={{project-name}} cargo lambda build --no-default-features --features=ssr --release\n```\n\nThis should produce a binary at `target/lambda/{{project-name}}/bootstrap`.\n`Cargo.toml` exposes all the required environment variables to `cargo-lambda`\nso that the server can run in production.\n\nFinally, we can deploy the project to AWS:\n\n```bash\ncargo lambda deploy --include target/site --enable-function-url\n```\n\nAfter a few seconds, `cargo-lambda` should print out the URL of your deployed function!\n\nThis template provides a GitHub action that handles all these steps automatically.\nTo use it, you'll need to provide your AWS credentials as [repository secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).\nYou'll also need to provide the project name as a variable.\n\n## Notes\n\n### Credentials\n\nYou'll need AWS credentials with some permissions for IAM and Lambda operations.\n`cargo-lambda` provides the [minimum requirements here](https://www.cargo-lambda.info/commands/deploy.html#user-profile).\n\nSetting up permissions can be a bit onerous if this is your first time working with AWS.\nFor a quick and dirty setup, you can:\n\n1. Create a new user in the IAM service (Access Management \u003e Users)\n2. Click \"Attach policies directly\" on the \"Set permissions\" page\n3. Add the \"AWSLambda_FullAccess\" and \"IAMFullAccess\" policies, and complete the user creation\n4. Create an access key for the user (don't worry about the warning)\n5. Place the access key and secret key in `~/.aws/credentials` (or wherever the\n   appropriate location is for your system):\n\n```\n[default]\naws_access_key_id = AKIAQYLPMN5HCTNK35FD\naws_secret_access_key = rbWHpaI/lJnXdLteWHNnTVZpQztMB2+pdbb+KVgr\n```\n\n### State\n\nSince AWS Lambda is a serverless platform, you'll need to be more careful about how\nyou manage long-lived state. Writing to disk or using an axum state extractor will\nnot work reliably across requests. Instead, you'll need a database or other\nmicroservices that you can query from the Lambda function.\n\n### Optimizations\n\nServing static files from a lambda function is not the best approach.\nIdeally, you should upload your files to a CDN and configure\nyour project to serve them from that location.\nAWS has an article on deploying [React with SSR](https://aws.amazon.com/blogs/compute/building-server-side-rendering-for-react-in-aws-lambda/).\n\nIt's also pretty easy to set up edge compute with Lambda@Edge,\nwhich should improve latency for users around the world.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiversable%2Ftest-start-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiversable%2Ftest-start-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiversable%2Ftest-start-aws/lists"}