Skip to content

Change Next.js deploy to standalone mode #1296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 105 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
70ba8b1
Use standalone
MarcoPonchia Jan 10, 2025
a5fc7ba
Set reactStrictMode to false
marcobottaro Jan 13, 2025
fa36661
fix: use env secret
christian-calabrese Jan 14, 2025
a75ad86
fix: parse secrets temporarily
christian-calabrese Jan 14, 2025
5fdb318
fix: linting
christian-calabrese Jan 15, 2025
d5fe0e7
make dynamic pages: webinars, guide and soltuion
MarcoPonchia Jan 22, 2025
11938fd
use env instead of secrets to building locally
MarcoPonchia Jan 22, 2025
826ef06
Merge branch 'main' into poc-standalone
MarcoPonchia Feb 10, 2025
f44020a
refactor guide using S3
MarcoPonchia Feb 13, 2025
ba3c44c
Fix env var management
MarcoPonchia Feb 18, 2025
b2f5375
Merge branch 'main' into tmp-poc-standalone
MarcoPonchia Feb 19, 2025
515bc69
remove sitemap
MarcoPonchia Feb 19, 2025
acc9481
Add verbose build info
MarcoPonchia Feb 19, 2025
1df6ac1
add env var logs
MarcoPonchia Feb 20, 2025
d15523c
add log
MarcoPonchia Feb 20, 2025
babcfb8
move log
MarcoPonchia Feb 20, 2025
7caea3e
Update package json
MarcoPonchia Feb 21, 2025
cde5311
update config
MarcoPonchia Feb 21, 2025
e21ed07
Fix config
MarcoPonchia Feb 21, 2025
32ab88b
[DEV-2132] Poc standalone improve s3 fetch guide (#1354)
MarcoPonchia Mar 3, 2025
2330fb2
[DEV-2184] Poc standalone fix guide version (#1365)
MarcoPonchia Mar 4, 2025
6375bbc
Merge remote-tracking branch 'origin/main' into poc-standalone
MarcoPonchia Mar 5, 2025
e6c795b
Add debug logs
MarcoPonchia Mar 5, 2025
244622c
Update logs
MarcoPonchia Mar 6, 2025
6ca1679
Use secret for bucket
MarcoPonchia Mar 6, 2025
8c74dc6
update yaml
MarcoPonchia Mar 6, 2025
2af511f
Fix fetch from strapi using secrets
MarcoPonchia Mar 17, 2025
07c8f6c
Fix fetch from strapi using secrets
MarcoPonchia Mar 17, 2025
d1f6052
remove debug log
MarcoPonchia Mar 17, 2025
c8728ce
Fix build locallu
MarcoPonchia Mar 18, 2025
b9855d4
[DEV-2129] Sitemap for standalone version (#1368)
tommaso1 Mar 20, 2025
6af2417
Fix sitemap
MarcoPonchia Mar 28, 2025
56c2d6e
[DEV-2196] Update generate metadata functions (#1392)
MarcoPonchia Apr 15, 2025
77a664a
[DEV-2226] Fix doc s3 parser (#1407)
MarcoPonchia Apr 15, 2025
1a6335f
[DEV-2131] fix dompurify warning (#1418)
MarcoPonchia Apr 15, 2025
8de135c
[DEV-2243] parse single guide page (#1411)
MarcoPonchia May 9, 2025
4f401ee
Add sst configuration
christian-calabrese May 19, 2025
da8a323
Merge branch 'main' into poc-standalone
MarcoPonchia May 23, 2025
cba457d
replaced aplifiy with open next new module
uolter May 26, 2025
4dc87de
refactory condition with for static parts
uolter May 27, 2025
adcf961
module outputs and first draft stendalone deploy action
uolter May 27, 2025
8607f11
update github action permission and bug fixing
uolter May 27, 2025
205af95
update build commands
uolter May 27, 2025
15fbba6
[DEV-2311] add basic isr to next (#1450)
MarcoPonchia May 27, 2025
c053850
Improve debug logs
MarcoPonchia May 27, 2025
b04d70c
update package json file
uolter May 28, 2025
6c0ae08
Add session token to client s3 credentials
MarcoPonchia May 28, 2025
41f7a74
add force dynamic
MarcoPonchia May 28, 2025
364940e
update deploy standalone action with permissions
uolter May 28, 2025
7e590af
deploy standalone assign aws env variables
uolter May 28, 2025
9228af6
deploy standalone setup node npm cache
uolter May 28, 2025
9fa21a4
Remove force dynamic
MarcoPonchia May 28, 2025
f118657
remove guide entrypoint static generation
MarcoPonchia May 28, 2025
2fbb023
update deploy stanalone action
uolter May 29, 2025
b9fbf01
Merge branch 'poc-standalone' of https://github.com/pagopa/developer-…
uolter May 29, 2025
f1e2ca4
deploy standalone copy assets, cache and zip all functions
uolter May 29, 2025
3d28942
update deploy lambda policy, s3 bucket to deploy code, deploy opennex…
uolter May 29, 2025
2f48359
update deploy standalone action
uolter May 29, 2025
b2df1b9
update action deploy standalone: deploy all functions
uolter May 29, 2025
af0151a
git action deploy standalone, remvoved the package part
uolter May 29, 2025
fe46fa3
update iam policy to deploy opennext
uolter May 30, 2025
f5977d5
deploy standalone create new version and update alias
uolter May 30, 2025
a130fba
fix deploy standalone action cache step
uolter Jun 3, 2025
0fa7a72
update invoke command: it requires an outfile param
uolter Jun 3, 2025
ed301f1
website cdn new s3 origin for standalone content
uolter Jun 3, 2025
8d08e2a
update bucket content policy and cloud front aliases
uolter Jun 4, 2025
bbb67b3
Fix metadata cache
MarcoPonchia Jun 4, 2025
51f16f1
update lambda server env variables
uolter Jun 4, 2025
b6d4a7d
Merge branch 'poc-standalone' of https://github.com/pagopa/developer-…
uolter Jun 4, 2025
3579c3b
rebase with main
uolter Jun 6, 2025
5e8adfe
[DEV-2323] Fetch data using CDN (#1462)
MarcoPonchia Jun 6, 2025
ba8febe
terrform lock file update
uolter Jun 6, 2025
00ea57c
Merge branch 'poc-standalone' of https://github.com/pagopa/developer-…
uolter Jun 6, 2025
cf34316
fix linting error
MarcoPonchia Jun 6, 2025
58acd80
Enable cacheInterception
christian-calabrese Jun 6, 2025
79516b5
open next lambda new env var: NEXT_PUBLIC_FEEDBACK_FORM_ENABLED
uolter Jun 10, 2025
e7fc20a
new strapi secret in parameter store
uolter Jun 10, 2025
59370b2
rebase ../../nextjs-website/src/app/[productSlug]/guides/[...productG…
uolter Jun 10, 2025
2d8447f
fix terraform template and secret parameter
uolter Jun 10, 2025
d9693b2
[DEV-2324] Fix absolute url path transform (#1472)
marcobottaro Jun 10, 2025
9523b97
Fix linting
MarcoPonchia Jun 10, 2025
1b4d0e2
update caching policy for static content cdn
uolter Jun 10, 2025
dedbc78
set cors configuration for static-contents
uolter Jun 10, 2025
e6154d3
update cloufront cors headers with full domains
uolter Jun 11, 2025
be63001
alarm for opennext lambda errors
uolter Jun 11, 2025
e8852f2
config opennext instrumentation
uolter Jun 11, 2025
23e72db
config opennext instrumentation
uolter Jun 11, 2025
cf26290
instrumentation configs
uolter Jun 11, 2025
ce6959d
fix linting
uolter Jun 11, 2025
f65d994
rollback confgurations to instrument next.js with telemetry
uolter Jun 11, 2025
af99b16
rollback package.json nextjs website
uolter Jun 12, 2025
769bbb1
Merge branch 'main' into poc-standalone
MarBert Jun 12, 2025
4eaec99
[DEV-2350] Add logs in guide pages (#1476)
MarBert Jun 12, 2025
8486e41
update iam policy to invalidate cloudfront opennext cache
uolter Jun 13, 2025
11ea22e
update action deploy standalow: clean up configurations
uolter Jun 13, 2025
a0e60f7
[CAI-437] - Fix user feedback bug (#1459)
mdciri Jun 12, 2025
81667b8
[CAI-445] - API documents in the index (#1466)
mdciri Jun 12, 2025
2ca7459
[DEV-2344] Fix call order in fetch local docs (#1474)
MarBert Jun 12, 2025
0b0cd1b
rebase poc stanalone
uolter Jun 16, 2025
ed49306
Run standalone build in self hosted runner
christian-calabrese Jun 17, 2025
bf1f112
[DEV-2347] Convert to static pages coming from gitbook (#1473)
MarcoPonchia Jun 19, 2025
141e8b6
Merge branch 'main' into poc-standalone
MarcoPonchia Jun 23, 2025
f14c0f4
[DEV-2342] Add generic nextjs error (#1486)
MarBert Jun 25, 2025
afd5950
Merge branch 'main' into poc-standalone
MarcoPonchia Jun 26, 2025
6042ba8
Merge branch 'main' into poc-standalone
uolter Jun 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clever-emus-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": minor
---

Use CDN instead of S3 client to get data from gitbook
6 changes: 6 additions & 0 deletions .changeset/curly-files-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"gitbook-docs": minor
"nextjs-website": minor
---

Update sitemap and add metadata generate functions for release-notes and solutions
6 changes: 6 additions & 0 deletions .changeset/five-birds-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"gitbook-docs": minor
"nextjs-website": minor
---

Update render of guide from gitbook
5 changes: 5 additions & 0 deletions .changeset/fluffy-bats-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": minor
---

Fix guide version subpages and release note pages
5 changes: 5 additions & 0 deletions .changeset/gentle-humans-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": major
---

Refactor pages that use gitbook to fetch data using S3
5 changes: 5 additions & 0 deletions .changeset/gold-rockets-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook-docs": patch
---

Fix absolute url path transform
5 changes: 5 additions & 0 deletions .changeset/odd-dragons-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Add logs to guides
5 changes: 5 additions & 0 deletions .changeset/perfect-kiwis-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"infrastructure": patch
---

Fixed codebuild cicd lambda permissions
5 changes: 5 additions & 0 deletions .changeset/shaggy-lizards-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Fix S3 doc parser to match file path that ends like site path
5 changes: 5 additions & 0 deletions .changeset/sharp-rivers-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Add error page for generic Nextjs errors
5 changes: 5 additions & 0 deletions .changeset/shiny-poets-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook-docs": minor
---

Fix json metadata generation skipping SUMMARY files
5 changes: 5 additions & 0 deletions .changeset/smooth-papayas-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": minor
---

Add ISR to Next.JS
6 changes: 6 additions & 0 deletions .changeset/tender-clocks-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"gitbook-docs": patch
"nextjs-website": patch
---

Refactor sitemap generation to use new environment variable for guide metadata path and add script for generating guide metadata from S3 and Strapi.
5 changes: 5 additions & 0 deletions .changeset/thirty-wasps-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Fix dompurify warning
5 changes: 5 additions & 0 deletions .changeset/witty-wombats-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Set content coming from gitbook as static page
8 changes: 8 additions & 0 deletions .github/actions/build-nextjs-website/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ inputs:
strapi_api_token:
description: 'The API key to use to invoke Strapi endpoint'
required: true
s3_access_key_id:
description: 'The access key to use to upload files to S3'
required: true
s3_secret_access_key:
description: 'The secret key to use to upload files to S3'
required: true
fetch_from_strapi:
description: 'If true, then fetch content from Strapi; otherwise, use only static contents'
required: false
Expand Down Expand Up @@ -99,6 +105,8 @@ runs:
NEXT_PUBLIC_MATOMO_SCRIPT_SRC: ${{ inputs.matomo_script_src }}
STRAPI_ENDPOINT: ${{ inputs.strapi_endpoint }}
STRAPI_API_TOKEN: ${{ inputs.strapi_api_token }}
S3_ACCESS_KEY_ID: ${{ inputs.s3_access_key_id }}
S3_SECRET_ACCESS_KEY: ${{ inputs.s3_secret_access_key }}
FETCH_FROM_STRAPI: ${{ inputs.fetch_from_strapi }}
shell: bash
run: |
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/deploy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ inputs:
strapi_api_token:
description: 'The API key to use to invoke Strapi endpoint'
required: true
s3_access_key_id:
description: 'The access key to use to upload files to S3'
required: true
s3_secret_access_key:
description: 'The secret key to use to upload files to S3'
required: true
fetch_from_strapi:
description: 'If true, then fetch content from Strapi; otherwise, use only static contents'
required: false
Expand Down Expand Up @@ -126,6 +132,8 @@ runs:
NEXT_PUBLIC_CHATBOT_ACTIVE: ${{ inputs.chatbot_active }}
STRAPI_ENDPOINT: ${{ inputs.strapi_endpoint }}
STRAPI_API_TOKEN: ${{ inputs.strapi_api_token }}
S3_ACCESS_KEY_ID: ${{ inputs.s3_access_key_id }}
S3_SECRET_ACCESS_KEY: ${{ inputs.s3_secret_access_key }}
FETCH_FROM_STRAPI: ${{ inputs.fetch_from_strapi }}
shell: bash
run: npm run build -w nextjs-website
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/chatbot_reindex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
cognito_aws_region: 'eu-south-1'
strapi_endpoint: ${{ vars.STRAPI_ENDPOINT }}
strapi_api_token: ${{ secrets.STRAPI_API_TOKEN }}
s3_access_key_id: ${{ secrets.S3_ACCESS_KEY_ID }}
s3_secret_access_key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
fetch_from_strapi: ${{ vars.FETCH_FROM_STRAPI }}

- name: Chatbot Vector Index
Expand Down Expand Up @@ -144,6 +146,8 @@ jobs:
cognito_aws_region: 'eu-south-1'
strapi_endpoint: ${{ vars.STRAPI_ENDPOINT }}
strapi_api_token: ${{ secrets.STRAPI_API_TOKEN }}
s3_access_key_id: ${{ secrets.S3_ACCESS_KEY_ID }}
s3_secret_access_key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
fetch_from_strapi: ${{ vars.FETCH_FROM_STRAPI }}

- name: Chatbot Vector Index
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/code_review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,7 @@ jobs:
cognito_aws_region: 'eu-south-1'
strapi_endpoint: ${{ vars.STRAPI_ENDPOINT }}
strapi_api_token: ${{ secrets.STRAPI_API_TOKEN }}
s3_access_key_id: ${{ secrets.S3_ACCESS_KEY_ID }}
s3_secret_access_key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
fetch_from_strapi: ${{ vars.FETCH_FROM_STRAPI }}
webinar_question_lifetime_in_seconds: ${{ vars.NEXT_PUBLIC_WEBINAR_QUESTION_LIFETIME_IN_SECONDS }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy_standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
deploy:
name: Deploy standalone website ${{ matrix.environment }}
if: ${{ needs.setup.outputs.matrix != '' }}
runs-on: ubuntu-24.04
runs-on: codebuild-${{ matrix.environment }}-github-runner-${{ github.run_id }}-${{ github.run_attempt }}
needs: [ setup ]

strategy:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/deploy_website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
allow_crawler: ${{ vars.ALLOW_CRAWLER }}
iam_role: ${{ secrets.DEPLOY_IAM_ROLE }}
bucket: ${{ vars.S3_BUCKET_NAME }}
static_contents_url: ${{ vars.STATIC_CONTENTS_URL }}
cloudfront_distribution_id: ${{ vars.CLOUDFRONT_DISTRIBUTION_ID }}
cognito_user_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_USER_POOL_ID }}
cognito_identity_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_IDENTITY_POOL_ID }}
Expand All @@ -77,6 +78,8 @@ jobs:
chatbot_active: ${{ vars.NEXT_PUBLIC_CHATBOT_ACTIVE }}
strapi_endpoint: ${{ vars.STRAPI_ENDPOINT }}
strapi_api_token: ${{ secrets.STRAPI_API_TOKEN }}
s3_access_key_id: ${{ secrets.S3_ACCESS_KEY_ID }}
s3_secret_access_key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
fetch_from_strapi: ${{ vars.FETCH_FROM_STRAPI }}
matomo_script_src: ${{ vars.NEXT_PUBLIC_MATOMO_SCRIPT_SRC }}
webinar_question_lifetime_in_seconds: ${{ vars.NEXT_PUBLIC_WEBINAR_QUESTION_LIFETIME_IN_SECONDS }}
Expand Down Expand Up @@ -152,6 +155,7 @@ jobs:
allow_crawler: ${{ vars.ALLOW_CRAWLER }}
iam_role: ${{ secrets.DEPLOY_IAM_ROLE }}
bucket: ${{ vars.S3_BUCKET_NAME }}
static_contents_url: ${{ vars.STATIC_CONTENTS_URL }}
cloudfront_distribution_id: ${{ vars.CLOUDFRONT_DISTRIBUTION_ID }}
cognito_user_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_USER_POOL_ID }}
cognito_identity_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_IDENTITY_POOL_ID }}
Expand All @@ -165,6 +169,8 @@ jobs:
chatbot_active: ${{ vars.NEXT_PUBLIC_CHATBOT_ACTIVE }}
strapi_endpoint: ${{ vars.STRAPI_ENDPOINT }}
strapi_api_token: ${{ secrets.STRAPI_API_TOKEN }}
s3_access_key_id: ${{ secrets.S3_ACCESS_KEY_ID }}
s3_secret_access_key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
fetch_from_strapi: ${{ vars.FETCH_FROM_STRAPI }}
matomo_script_src: ${{ vars.NEXT_PUBLIC_MATOMO_SCRIPT_SRC }}
webinar_question_lifetime_in_seconds: ${{ vars.NEXT_PUBLIC_WEBINAR_QUESTION_LIFETIME_IN_SECONDS }}
3 changes: 3 additions & 0 deletions .github/workflows/deploy_website_content.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
allow_crawler: ${{ vars.ALLOW_CRAWLER }}
iam_role: ${{ secrets.DEPLOY_IAM_ROLE }}
bucket: ${{ vars.S3_BUCKET_NAME }}
static_contents_url: ${{ vars.STATIC_CONTENTS_URL }}
cloudfront_distribution_id: ${{ vars.CLOUDFRONT_DISTRIBUTION_ID }}
cognito_user_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_USER_POOL_ID }}
cognito_identity_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_IDENTITY_POOL_ID }}
Expand All @@ -68,5 +69,7 @@ jobs:
chatbot_active: ${{ vars.NEXT_PUBLIC_CHATBOT_ACTIVE }}
strapi_endpoint: ${{ vars.STRAPI_ENDPOINT }}
strapi_api_token: ${{ secrets.STRAPI_API_TOKEN }}
s3_access_key_id: ${{ secrets.S3_ACCESS_KEY_ID }}
s3_secret_access_key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
fetch_from_strapi: ${{ vars.FETCH_FROM_STRAPI }}
matomo_script_src: ${{ vars.NEXT_PUBLIC_MATOMO_SCRIPT_SRC }}
4 changes: 3 additions & 1 deletion apps/chatbot/src/modules/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,12 @@ def chat_generate(
else:
engine_response = self.engine.chat(query_str, chat_history)

response_str = self._get_response_str(engine_response)
retrieved_contexts = []
for node in engine_response.source_nodes:
url = WEBSITE_URL + node.metadata["filepath"]
retrieved_contexts.append(f"URL: {url}\n\n{node.text}")

response_str = self._get_response_str(engine_response)
except Exception as e:
response_str = (
'{"response": "Scusa, non posso elaborare la tua richiesta. '
Expand All @@ -292,6 +293,7 @@ def chat_generate(
response_str = response_str[7:-3]
response_str = response_str.strip()
response_json = json.loads(response_str)

if "contexts" not in response_json.keys():
response_json["contexts"] = retrieved_contexts

Expand Down
18 changes: 18 additions & 0 deletions apps/chatbot/src/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
)


def get_logger(name: str) -> logging.Logger:
formatter = logging.Formatter(
fmt="%(asctime)s %(levelname)s [%(name)s] [%(funcName)s]: %(message)s"
)

handler = logging.StreamHandler()
handler.setFormatter(formatter)

logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)

if not logger.handlers: # Prevent adding multiple handlers
logger.addHandler(handler)
logger.propagate = False

return logger


def get_ssm_parameter(name: str | None, default: str | None = None) -> str | None:
"""
Retrieves a specific value from AWS Systems Manager's Parameter Store.
Expand Down
2 changes: 1 addition & 1 deletion apps/infrastructure/src/refacotr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ import {
id = "STRAPI_API_TOKEN"
}

*/
*/
4 changes: 4 additions & 0 deletions apps/nextjs-website/.env.default
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ NEXT_PUBLIC_ORGANIZATION_NAME='PagoPA',
NEXT_PUBLIC_ORGANIZATION_LOGO='https://1603831084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvKmQOwMmwOgFq0L2Rf0Q%2Flogo%2FgCUQ6tWtEoMqS8uZcWOP%2FpagoPA.svg?alt=media&token=2405d6bd-94df-4129-8bcd-8dd0f52272d9',
# each link is separated by a comma
NEXT_PUBLIC_ORGANIZATION_SOCIAL_LINKS='https://x.com/PagoPA,https://www.instagram.com/pagopaspa/,https://www.linkedin.com/company/pagopa/,https://medium.com/pagopa-spa'

S3_GUIDES_METADATA_JSON_PATH=guides-metadata.json
S3_SOLUTIONS_METADATA_JSON_PATH=solutions-metadata.json
S3_RELEASE_NOTES_METADATA_JSON_PATH=release-notes-metadata.json
6 changes: 6 additions & 0 deletions apps/nextjs-website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,9 @@ storybook-static/
# End of https://www.toptal.com/developers/gitignore/api/node,emacs,macos,storybookjs,intellij+all,nextjs

.idea/

# sst
.sst

# open-next
.open-next
4 changes: 2 additions & 2 deletions apps/nextjs-website/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
NextJS reference: https://nextjs.org/docs/advanced-features/compiler#module-transpilation
*/
const nextConfig = {
reactStrictMode: true,
output: 'export',
reactStrictMode: false,
output: 'standalone',
trailingSlash: false,
images: {
unoptimized: true,
Expand Down
17 changes: 17 additions & 0 deletions apps/nextjs-website/open-next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { OpenNextConfig } from '@opennextjs/aws/types/open-next';
const config = {
default: {
// override: {
// // This is necessary to enable lambda streaming, defaults to aws-lambda
// wrapper: 'aws-lambda-streaming',
// },
},
dangerous: {
// Enable the cache interception. Every request will go through the cache interceptor, if it is found in the cache,
// it will be returned without going through NextServer. Not every feature is covered by the cache interceptor and
// it should fallback to the NextServer if the cache is not found.
enableCacheInterception: true,
},
} satisfies OpenNextConfig;

export default config;
17 changes: 10 additions & 7 deletions apps/nextjs-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "7.0.0",
"private": true,
"scripts": {
"download-docs": "./scripts/fetch-docs.sh docs/from-gitbook",
"update-docs-ci": "./scripts/update-docs-ci.sh",
"update-docs": "./scripts/fetch-local-docs.sh",
"build": "next build --debug",
"compile": "tsc --noEmit",
"dev": "next dev",
"build": "next build",
"start": "npx serve@latest out",
"download-docs": "./scripts/fetch-docs.sh docs/from-gitbook",
"lint": "next lint",
"test": "jest -i"
"start": "next start",
"test": "jest -i",
"update-docs": "./scripts/fetch-local-docs.sh",
"update-docs-ci": "./scripts/update-docs-ci.sh"
},
"dependencies": {
"@apidevtools/swagger-parser": "^10.1.0",
Expand All @@ -26,15 +26,17 @@
"@mui/lab": "5.0.0-alpha.140",
"@mui/material": "5.14.5",
"@mui/utils": "5.14.5",
"@opennextjs/aws": "^3.6.3",
"@pagopa/mui-italia": "1.0.1",
"@stoplight/elements": "^7.9.0",
"@strapi/blocks-react-renderer": "^1.0.1",
"aws-amplify": "^5.3.11",
"dompurify": "^3.2.5",
"fp-ts": "^2.13.1",
"gitbook-docs": "*",
"io-ts": "^2.2.20",
"io-ts-types": "^0.5.19",
"isomorphic-dompurify": "^2.3.0",
"isomorphic-dompurify": "^2.24.0",
"jsdom": "^25.0.0",
"mermaid": "^10.9.0",
"monocle-ts": "^2.3.13",
Expand All @@ -46,6 +48,7 @@
"react-dom": "18.2.0",
"react-syntax-highlighter": "^15.5.0",
"schema-dts": "^1.1.2",
"sst": "3.14.25",
"swagger-ui": "^5.9.1",
"swiper": "^11.2.4",
"swr": "^2.2.4"
Expand Down
3 changes: 3 additions & 0 deletions apps/nextjs-website/src/BrowserConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as t from 'io-ts';
import { pipe } from 'fp-ts/lib/function';
import * as E from 'fp-ts/lib/Either';
import * as PR from 'io-ts/lib/PathReporter';
import { secrets } from './config';

const BrowserConfigCodec = t.type({
NEXT_PUBLIC_COGNITO_REGION: t.string,
Expand All @@ -19,8 +20,10 @@ export type BrowserConfig = t.TypeOf<typeof BrowserConfigCodec>;
export const publicEnv = {
NEXT_PUBLIC_COGNITO_REGION: process.env.NEXT_PUBLIC_COGNITO_REGION,
NEXT_PUBLIC_COGNITO_USER_POOL_ID:
secrets.NEXT_PUBLIC_COGNITO_USER_POOL_ID ||
process.env.NEXT_PUBLIC_COGNITO_USER_POOL_ID,
NEXT_PUBLIC_COGNITO_IDENTITY_POOL_ID:
secrets.NEXT_PUBLIC_COGNITO_IDENTITY_POOL_ID ||
process.env.NEXT_PUBLIC_COGNITO_IDENTITY_POOL_ID,
};

Expand Down
Loading
Loading