{"id":13812958,"url":"https://github.com/tonyfromundefined/nuxt-serverless","last_synced_at":"2025-05-14T22:31:23.488Z","repository":{"id":44164997,"uuid":"128418510","full_name":"tonyfromundefined/nuxt-serverless","owner":"tonyfromundefined","description":"Nuxt.js Serverless SSR Starter on AWS (Lambda + API Gateway + S3) with Serverless Framework","archived":true,"fork":false,"pushed_at":"2022-02-11T12:28:41.000Z","size":3222,"stargazers_count":253,"open_issues_count":22,"forks_count":32,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-12T20:18:31.798Z","etag":null,"topics":["aws","aws-api-gateway","aws-lambda","aws-s3","nuxt","serverless-framework","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tonyfromundefined.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-06T16:22:29.000Z","updated_at":"2025-04-12T00:20:11.000Z","dependencies_parsed_at":"2022-09-06T06:00:51.124Z","dependency_job_id":null,"html_url":"https://github.com/tonyfromundefined/nuxt-serverless","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyfromundefined%2Fnuxt-serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyfromundefined%2Fnuxt-serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyfromundefined%2Fnuxt-serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyfromundefined%2Fnuxt-serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tonyfromundefined","download_url":"https://codeload.github.com/tonyfromundefined/nuxt-serverless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254239559,"owners_count":22037726,"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":["aws","aws-api-gateway","aws-lambda","aws-s3","nuxt","serverless-framework","typescript"],"created_at":"2024-08-04T04:00:58.671Z","updated_at":"2025-05-14T22:31:18.452Z","avatar_url":"https://github.com/tonyfromundefined.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# 🚀 Nuxt.js SSR on AWS Serverless Stack (Lambda + API Gateway + S3)\n\nNuxt.js Serverless Server-side Rendering Starter on AWS Serverless Stack (Lambda + API Gateway + S3) with *Serverless Framework*\n\n### Pre-Installed\n- Nuxt.js 2.8.1\n- Serverless Framework\n- TypeScript\n- Sass (SCSS)\n- TSLint\n\nIf you have a feature request, please create a new issue. And also, pull requests are always welcome🙏\n\n### Caution\n- Libraries that are used in the client should be included in the `devDependencies` for Bundle size optimization. (because of Lambda Limit)\n- If you install a `module` for nuxt.js, it must be in a the `dependencies` not `devDependencies`\n- Auto generated URL `https://*.execute-api.{region}.amazonaws.com/{stage}/` will result in a JavaScript error. (routing problem) **Please use the Custom Domain.**\n- If you encounter `Cannot GET /` error message, the error log can be founded in the AWS CloudWatch.\n\n## Pre-requisites\n- 🔑 **IAM Account** for *Serverless framework* (Requires pre-configuration using `aws configure`)\n\n```bash\n$ aws configure\n```\n\n## Configuration\nEdit `serverless.yml`\n\n```yaml\nservice: nuxt-serverless  # 1. Edit whole service name\n\nplugins:\n  - serverless-s3-sync\n  - serverless-apigw-binary\n  - serverless-dotenv-plugin\n\npackage:\n  individually: true\n  excludeDevDependencies: true\n\nprovider:\n  name: aws\n  runtime: nodejs10.x\n  stage: ${opt:stage, 'dev'}\n  region: us-east-1  # 2. Edit AWS region name\n\ncustom:\n  #######################################\n  # Unique ID included in resource names.\n  # Replace it with a random value for every first distribution.\n  # https://www.random.org/strings/?num=1\u0026len=6\u0026digits=on\u0026loweralpha=on\u0026unique=on\u0026format=html\u0026rnd=new\n  stackId: abcdef  # 3. Update Random Stack ID\n  #######################################\n\n  buckets:\n    ASSETS_BUCKET_NAME: ${self:service}-${self:custom.stackId}-${self:provider.stage}-assets\n    STATIC_BUCKET_NAME: ${self:service}-${self:custom.stackId}-${self:provider.stage}-static\n  s3Sync:\n    - bucketName: ${self:custom.buckets.ASSETS_BUCKET_NAME}\n      localDir: .nuxt/dist/client\n    - bucketName: ${self:custom.buckets.STATIC_BUCKET_NAME}\n      localDir: static\n  apigwBinary:\n    types:\n      - '*/*'\n```\n\n## Build Setup\n```bash\n# Install dependencies\n$ yarn\n\n# Serve develop server at localhost:3000 using Nuxt.js\n$ yarn dev\n\n# Build\n$ yarn build\n\n# Prod server start with built assets\n$ yarn start\n\n## SERVERLESS DEPLOYMENT ##\n# Build and deploy the function and bundled assets\n$ yarn deploy:dev\n$ yarn deploy:stage\n$ yarn deploy:prod\n\n# Remove Deployment\n$ yarn undeploy:dev\n$ yarn undeploy:stage\n$ yarn undeploy:prod\n```\n\n## Environment Variables\n- update `.env.development`, `.env.production`.\n- If env variable key started with `NUXT_APP`, it injected to client in `this.$store.state.environments`.\n- WARNING!: Untrack the `.env.development` and the `.env.production` before commit\n\n## Folder Structure\n- `/api`: You can create a sub-API based on Express.js. dynamic ajax Set-Cookie is mainly used.\n  \u003e Let the URL be a `* .json` to distinguish it from the REST API that returns JSON.\n- `/pages`: File-based page routing. All ts files in `/pages` are only alias with `export {default}` to `/services/${serviceName}/pages/**`. all implementations should be done inside `/services`.\n\n  ```typescript\n  export { default } from '~/services/home/pages/index'\n  ```\n- `/services`: The application is divided into several services and should be implemented in a folder named by service name. (Example: `/home`, `/auth`, ...)\n  - Inside a Service: `/components`, `/queries`, `/pages`, `/helpers`, `/types`, ...\n- `/store`: One Store that is globally used.\n- `/types`: Declare only `.d.ts`. The type used for each service should be stored in `/types' in each service.\n\n## To-do\n- [x] optimize the lambda capacity (create SSR bundle with no dependencies)\n- [x] static file serve\n- [ ] gzip Compression\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonyfromundefined%2Fnuxt-serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonyfromundefined%2Fnuxt-serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonyfromundefined%2Fnuxt-serverless/lists"}