Overview
Website build with full stack framework NuxtJS 4.2 with SSR (server site rendering) deployed as AWS Lambda function that deliver all its features:
- server site rendered HTML
- static content
- API calls for managing and reading content
- simple authentication for content and statistics access
- simple statistics
How is it implemented?
- Deployment via CI/CD from GitHub Action that on push (or merge) to master branch execute
sls deploy - Serverless Framework (as IaC) that consists of:
ssrLambda function that have custom handler that returns response from built Nuxt application withaws-lambdapreset- DynamoDB Table (with 1 GSI) that follows 'one table design' principals with 'on-demand' billing mode. It is holding: content of pages, or fragment of pages, pages structure, users info, and high level summary of statistics
- SQS queue for buffering of ingested and calculated statistics
compactLambda function that runs schedule and read from queue above to ingest and calculate statisticsserverless-scriptable-pluginthat runs before deployment and build Nuxt application forssrfunction as well buildcompactfunction (Typescript to NodeJS)
Pros:
- low maintenance - very simple infrastructure
- very low cost of usage - perfect for low traffic with spikes
- scalability by design
- fast SSR response time (in 10s of milliseconds) and easy to keep it warm
Cons:
- static content delivered by Lambda, however this is balanced by simplification of infrastructure - beneficial for low traffic or not images intensive websites
