Skip to content

Commit a7a279a

Browse files
authored
Doc: deployment options (#90)
* Deploy to AWS * Sync * Sync
1 parent a677a80 commit a7a279a

File tree

8 files changed

+5641
-655
lines changed

8 files changed

+5641
-655
lines changed

.changeset/young-games-dance.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"open-next": major
3+
---
4+
5+
Document deployment options

README.md

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<p align="center">
1717
<a href="https://open-next.js.org/">Website</a> |
18-
<a href="#quick-start">Quick start</a> |
18+
<a href="#deployment">Deployment</a> |
1919
<a href="#recommended-infrastructure-on-aws">Infrastructure</a> |
2020
<a href="#example">Example</a> |
2121
<a href="#faq">FAQ</a>
@@ -37,36 +37,6 @@ OpenNext aims to support all Next.js 13 features. Some features are work in prog
3737
- [x] [NextAuth.js](https://next-auth.js.org)
3838
- [x] [Running at edge](#running-at-edge)
3939

40-
## Quick start
41-
42-
1. Navigate to your Next.js app
43-
44-
```bash
45-
cd my-next-app
46-
```
47-
48-
2. Build the app
49-
50-
```bash
51-
npx open-next@latest build
52-
```
53-
54-
This will generate an `.open-next` directory with the following bundles:
55-
56-
```bash
57-
my-next-app/
58-
.open-next/
59-
assets/ -> Static files to upload to an S3 Bucket
60-
server-function/ -> Handler code for server Lambda Function
61-
image-optimization-function/ -> Handler code for image optimization Lambda Function
62-
```
63-
64-
3. Add `.open-next` to your `.gitignore` file
65-
```
66-
# OpenNext
67-
/.open-next/
68-
```
69-
7040
## How does OpenNext work?
7141

7242
When calling `open-next build`, OpenNext **runs `next build`** to build the Next.js app, and then **transforms the build output** to a format that can be deployed to AWS.
@@ -77,7 +47,17 @@ OpenNext runs the `build` script in your `package.json` file. Depending on the l
7747

7848
#### Transforming the build output
7949

80-
The build output is then transformed into a format that can be deployed to AWS. Files in `assets/` are ready to be uploaded to AWS S3. And the function code is wrapped inside Lambda handlers, ready to be deployed to AWS Lambda or Lambda@Edge.
50+
The build output is then transformed into a format that can be deployed to AWS. The transformed output is generated inside the `.open-next` folder within your Next.js app. Files in `assets/` are ready to be uploaded to AWS S3. And the function code is wrapped inside Lambda handlers, ready to be deployed to AWS Lambda or Lambda@Edge.
51+
52+
```bash
53+
my-next-app/
54+
.open-next/
55+
assets/ -> Static files to upload to an S3 Bucket
56+
server-function/ -> Handler code for server Lambda Function
57+
image-optimization-function/ -> Handler code for image optimization Lambda Function
58+
```
59+
60+
## Deployment
8161

8262
## Recommended infrastructure on AWS
8363

example/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev",
6+
"dev": "sst bind next dev",
77
"build": "next build",
88
"start": "next start"
99
},
@@ -16,5 +16,10 @@
1616
"remark": "^13.0.0",
1717
"remark-html": "^13.0.2",
1818
"swr": "^1.0.1"
19+
},
20+
"devDependencies": {
21+
"sst": "^2.5.3",
22+
"aws-cdk-lib": "2.72.1",
23+
"constructs": "10.1.156"
1924
}
20-
}
25+
}

0 commit comments

Comments
 (0)