Skip to content
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

SSR Refactoring #6

Merged
merged 27 commits into from
Dec 4, 2024
Merged

SSR Refactoring #6

merged 27 commits into from
Dec 4, 2024

Conversation

AaronAgility
Copy link
Contributor

@AaronAgility AaronAgility commented Nov 5, 2024

Prerequesites
Node v20+

Installation
Clone this Repository
npm install to install the Node Modules

Environmental Variables
You will need to get the following from the Agility Manager;
GUID API_PREVIEW_KEY API_FETCH_KEY LOCALE SITEMAP

https://manager.agilitycms.com/settings/apikeys

You will need to populate an .env file in the root of your project as follows.

This will use dotenv.config.json to write your environment.ts and environment.prod.ts files required by Angular. This approach avoids exposing your API keys to your Git repository.


AGILITY_GUID=e13c7b01-u
AGILITY_PREVIEW=true
AGILITY_API_PREVIEW_KEY=AngularPreview.6617c54b87588d941d32416a9dfb1e8fd9e556439984e8236ac75896e47ae02a
AGILITY_API_FETCH_KEY=AngularFetch.a20b40fd8cd25e02ba62ca5c3acbaae5512c1d633b51ea104ac28f9bc3b9d44d
AGILITY_LOCALE=en-us
AGILITY_SITEMAP=website


Build Commands
npm run dev start the development server
npm run build pre-renders the routes via agility-routes.txt then builds the production server
npm run start starts the production server
npm run prerender:routes just pre-renders the agility-routes.txt

Key Features

Dynamic SSR Supports server-side rendering for dynamic pages generated from an Agility CMS.

Pre-rendering and TransferState Improves initial page load performance and reduces redundant requests.

Hybrid SSR Uses a blend of SSR and client-side routing for optimal load times and user experience.

Seamless Agility CMS Integration Designed to fit naturally with Agility’s headless CMS ecosystem, making it easier to manage content dynamically.

DotEnv Support Improves environmental variable loading and allows keys to be stored at server level

Major ground up refactoring to ensure SSR capabilities in app.

Also includes a custom agility-routes prerendering tool to handle dynamic pages
Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agilitycms-angular-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 5:54pm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to add this file to your .gitignore

@DakotahGodfrey DakotahGodfrey self-requested a review November 20, 2024 18:35
@AaronAgility AaronAgility merged commit 6495bff into main Dec 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants