{"id":13505683,"url":"https://github.com/vvo/nextjs-vercel-aws-cdk-example","last_synced_at":"2026-03-05T07:32:23.398Z","repository":{"id":42969604,"uuid":"288231280","full_name":"vvo/nextjs-vercel-aws-cdk-example","owner":"vvo","description":"Example Next.js project deployed on Vercel with AWS services for database, cron jobs and asynchronous jobs","archived":false,"fork":false,"pushed_at":"2020-10-08T23:03:59.000Z","size":271,"stargazers_count":76,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-05T16:35:22.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://nextjs-vercel-aws-cdk-example.vercel.app","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/vvo.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":"2020-08-17T16:31:09.000Z","updated_at":"2025-02-02T20:45:46.000Z","dependencies_parsed_at":"2022-09-24T05:12:16.793Z","dependency_job_id":null,"html_url":"https://github.com/vvo/nextjs-vercel-aws-cdk-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vvo/nextjs-vercel-aws-cdk-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvo%2Fnextjs-vercel-aws-cdk-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvo%2Fnextjs-vercel-aws-cdk-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvo%2Fnextjs-vercel-aws-cdk-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvo%2Fnextjs-vercel-aws-cdk-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vvo","download_url":"https://codeload.github.com/vvo/nextjs-vercel-aws-cdk-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvo%2Fnextjs-vercel-aws-cdk-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30114248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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-08-01T00:01:11.570Z","updated_at":"2026-03-05T07:32:23.368Z","avatar_url":"https://github.com/vvo.png","language":"JavaScript","funding_links":[],"categories":["Training Materials and Sample Code"],"sub_categories":["Multi-accounts setup"],"readme":"# nextjs-vercel-aws-cdk-example [![Mentioned in Awesome CDK](https://awesome.re/mentioned-badge.svg)](https://github.com/eladb/awesome-cdk)\n\n_Companion project of the article at https://dev.to/vvo/coding-the-jamstack-missing-parts-databases-crons-background-jobs-1bpj_\n\nThis is a Next.js example coupled with AWS services to provide:\n- database ([RDS](https://aws.amazon.com/rds/))\n- cron jobs ([EventBridge](https://aws.amazon.com/eventbridge/) + [Lambda](https://aws.amazon.com/lambda/))\n- background jobs ([SNS](https://aws.amazon.com/sns/) + [Lambda](https://aws.amazon.com/lambda/))\n\nThe goal is to have Next.js being deployed on Vercel, with resources being deployed on AWS via [AWS Cloud Development Kit](https://aws.amazon.com/cdk/). The AWS stack is described and deployed via a single JavaScript file ([infra/ExampleStack.js](./infra/ExampleStack.js)) thanks to AWS CDK's infrastructure as code (IaC) features.\n\nThis example provides local tools to replicate the AWS services in development mode.\n\n## Requirements\n\n- Node.js via nvm: https://github.com/nvm-sh/nvm#installing-and-updating\n- Yarn: https://classic.yarnpkg.com/en/docs/install#alternatives-stable\n- An AWS account: https://portal.aws.amazon.com/billing/signup\n- Installed and configured AWS CLI: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html\n- [Docker Desktop](https://www.docker.com/products/docker-desktop) for ease of running a local database\n- [overmind](https://github.com/DarthSim/overmind) for ease of running multiple local services\n\n## How to use\n\n1. Fork this repository, add it to your Vercel projects, deploy it\n2. Clone the repository locally and run\n\n```bash\nyarn\nyarn cdk deploy # first run can be long\n```\n\nThis will deploy the services to AWS.\n\n3. Add necessary env variables to your Vercel project:\n\nYou need to add `SECRET_AWS_ACCESS_KEY_ID`, `SECRET_AWS_SECRET_ACCESS_KEY` and `SECRET_AWS_REGION` to Vercel, see https://vercel.com/blog/environment-variables-ui on how to do it.\n\n1. Verify it's working:\n\nYou can check in CloudWatch logs at https://console.aws.amazon.com/cloudwatch/home that your functions are called:\n- every 5 minutes for jobs/checkTwitter.js\n- when you click on the \"Generate Pdf\" button in your production Vercel application for jobs/generatePdf.js.\n\n## Local development\n\nIn local development, all you have to do is:\n\n```bash\novermind start\n```\n\nBy reading the [Procfile](./Procfile) This will start:\n- The Next.js app in development mode\n- The PostgreSQL database via Docker\n- The cron jobs defined in [cron-jobs.js](./cron-jobs.js)\n\n## Tips and docs\n\n- Once your database is deployed, you can get its endpoint and credentials via https://console.aws.amazon.com/rds/home and https://console.aws.amazon.com/secretsmanager/home\n- If your stack is in an unstable situation (cannot deploy or destroy), then go to https://console.aws.amazon.com/cloudformation and delete it manually.\n- CDK API: https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html\n- CDK guide: https://docs.aws.amazon.com/cdk/latest/guide/home.html\n- CDK command line: https://docs.aws.amazon.com/cdk/latest/guide/cli.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvo%2Fnextjs-vercel-aws-cdk-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvvo%2Fnextjs-vercel-aws-cdk-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvo%2Fnextjs-vercel-aws-cdk-example/lists"}