opennextjs / opennextjs-aws
Open-source Next.js adapter for AWS
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing opennextjs/opennextjs-aws in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler view--- Docs Description OpenNext takes the Next.js build output and converts it into packages that can be deployed across a variety of environments. Natively OpenNext has support for AWS Lambda, and classic Node.js Server. Features OpenNext aims to support all Next.js 15 features. Some features are work in progress. If you are running into any problems make sure to check the docs first before you open a new issue or visit our Discord to let us know! • [x] App & Pages Router • [x] API routes • [x] Dynamic routes • [x] Static site generation (SSG) • [x] Server-side rendering (SSR) • [x] Incremental static regeneration (ISR) • [x] Middleware • [x] Server actions • [x] Image optimization • [x] NextAuth.js • [x] Running at edge • [x] Almost no coldstart (\*) Who is using OpenNext? Gymshark UK, Udacity, TUDN, NHS England Configuration Configuration file For personalisation you need to create a file at the same place as your , and export a default object that satisfies the interface. It is possible to not have an open-next.config.ts file, the default configuration will then be applied automatically. Debug mode OpenNext can be executed in debug mode by setting the environment variable before your build. This will output A LOT of additional logs to the console. This also disable minifying in esbuild, and add source maps to the output. This can result in code that might be up to 2-3X larger than the production build. Do **not** enable this in production. You can read more about the configuration in the docs Preleases Besides the standard npm releases we also automatically publish prerelease packages on branch pushes (using ): • : Updated with every push to the branch, this prerelease contains the most up to date yet (reasonably) stable version of the package. • Updated with every push to the branch, this prerelease contains the latest experimental version of the package (containing features that we want to test/experiment on before committing to). Which you can simply install directly with your package manager of choice, for example: Contribute To run locally: • Clone this repository. • Build : • Run in watch mode: • Now, you can make changes in and build your Next.js app to test the changes. There is also a way to run OpenNext locally. You can read a guide about it here. Its mostly used for development/debugging purposes. Testing You can run unit tests with You can tun e2e locally with: And in a different shell: Coldstart OpenNext provide you with a warmer function that can be used to reduce cold start. On Lambda, there are multiple scenarios where a lambda will trigger a cold start even if you have some warmed instance. For example if you have more requests than warm instances you'll get a cold start. Also NextJs lazy load the routes, so even if you hit a warm instance, this specific route might not have been loaded yet. Acknowledgements We are grateful for the projects that inspired OpenNext and the amazing tools and libraries developed by the community: • nextjs-lambda by Jan for serving as inspiration for packaging Next.js's standalone output to Lambda. • CDK NextJS by JetBridge for its contribution to the deployment architecture of a Next.js application on AWS. • serverless-http by Doug Moscrop for developing an excellent library for transforming AWS Lambda events and responses. • serverless-nextjs by Serverless Framework for paving the way for serverless Next.js applications on AWS. Special shoutout to @khuezy and @conico974 for their outstanding contributions to the project. --- Maintained by SST. Join our community: Discord | YouTube | Twitter