Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 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
41b9708
Optimize guide page rendering by implementing dynamic rendering and c…
github-user-name Jun 25, 2025
2977e02
Implement parallel data fetching and caching to optimize guide page p…
github-user-name Jun 25, 2025
d36bd5f
logging
github-user-name Jun 25, 2025
0874341
logging
github-user-name Jun 25, 2025
3d7d7f8
Merge remote-tracking branch 'origin/main' into DEV-2340-guides-perfo…
github-user-name Jul 1, 2025
8cbe4a7
Merge branch 'main' into DEV-2340-guides-performance
tommaso1 Jul 1, 2025
e8cf35d
update lock
MarcoPonchia Jul 1, 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
5 changes: 5 additions & 0 deletions .changeset/cyan-cycles-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Optimize guide page performance with parallel data fetching and caching
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/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
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
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const Page = async ({ params }: { params: Params }) => {
seo,
bodyConfig,
} = guideProps;

const props: ProductGuidePageProps = {
...page,
product,
Expand Down Expand Up @@ -135,6 +136,22 @@ const Page = async ({ params }: { params: Params }) => {
things: [convertSeoToStructuredDataArticle(seo)],
});

const breadcrumbs = [
...productPageToBreadcrumbs(props.product, [
{
translate: true,
name: 'devPortal.productHeader.guides',
path: props.product.hasGuideListPage
? `/${props.product.slug}/guides`
: '/',
},
{
name: props.guide.name,
path: props.guide.path,
},
]),
];

return (
<ProductLayout
product={props.product}
Expand All @@ -144,21 +161,7 @@ const Page = async ({ params }: { params: Params }) => {
>
<GitBookTemplate
menuName={props.guide.name}
breadcrumbs={[
...productPageToBreadcrumbs(props.product, [
{
translate: true,
name: 'devPortal.productHeader.guides',
path: props.product.hasGuideListPage
? `/${props.product.slug}/guides`
: '/',
},
{
name: props.guide.name,
path: props.guide.path,
},
]),
]}
breadcrumbs={breadcrumbs}
versionName={props.version.name}
{...props}
/>
Expand Down
31 changes: 25 additions & 6 deletions apps/nextjs-website/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,35 @@ async function manageUndefinedAndAddProducts<T>(props: undefined | null | T) {
return { ...manageUndefined(props), products: await getProducts() };
}

// Cache to avoid duplicate calls between metadata generation and page rendering
const guidePageCache = new Map<string, any>();

export async function getGuidePage(
guidePaths: ReadonlyArray<string>,
productSlug: string
) {
const products = await getProducts();
const guideProps = await getGuidePageProps(
guidePaths.length > 0 ? guidePaths[0] : '',
productSlug
);
const guidesMetadata = await getGuidesMetadata();
const cacheKey = `${productSlug}-${guidePaths.join('/')}`;

// Check cache first to avoid duplicate work
if (guidePageCache.has(cacheKey)) {
const cached = guidePageCache.get(cacheKey);
return cached;
}

// Fetch data in parallel instead of sequential
const [products, guideProps, guidesMetadata] = await Promise.all([
getProducts(),
getGuidePageProps(guidePaths.length > 0 ? guidePaths[0] : '', productSlug),
getGuidesMetadata(),
]);

// Path construction
const guidePath = [
`/${guideProps.product.slug}`,
'guides',
...guidePaths,
].join('/');

const parsedGuidePage = manageUndefined(
await parseS3GuidePage({
guideProps,
Expand All @@ -61,6 +75,11 @@ export async function getGuidePage(
products,
})
);

// Cache the result to avoid duplicate work
// eslint-disable-next-line functional/no-expression-statements
guidePageCache.set(cacheKey, parsedGuidePage);

return parsedGuidePage;
}

Expand Down
9 changes: 7 additions & 2 deletions apps/nextjs-website/src/lib/cmsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,17 @@ export const getQuickStartGuidesProps = async () => {
};

export const getUrlReplaceMapProps = async () => {
return withCache(
const result = await withCache(
getCacheKey('getUrlReplaceMapProps'),
async () => {
const strapiUrlReplaceMap = await fetchUrlReplaceMap(buildEnv);
return makeUrlReplaceMap(strapiUrlReplaceMap);
const processed = makeUrlReplaceMap(strapiUrlReplaceMap);
return processed;
},
CACHE_EXPIRY_IN_SECONDS
);

return result;
};

export const getApiDataListPagesProps = async () => {
Expand Down Expand Up @@ -261,7 +264,9 @@ export const getGuidePageProps = async (
// eslint-disable-next-line functional/no-throw-statements
throw new Error('Failed to fetch data');
}

const guidesProps = makeGuidesProps(strapiGuides);

return guidesProps[0];
};

Expand Down
Loading