This open-source project introduces a monorepo tailored for the development, management, and deployment of my website, serving as a showcase for various web development concepts, it is an embodiment of efficiency, automation, and scalability.
At its core, the Monorepo architecture consolidates the code of different services, the website itself, and configurations within a single repository, simplifying versioning and dependency management. Embracing Serverless architecture, powered by AWS Lambda functions, ensures a cost-effective approach to handling tasks triggered by events like content updates or scheduled GitHub data retrieval.
Cloud-native principles drive the utilization of AWS services such as SQS and S3, optimizing scalability and integration. The project also adheres to Infrastructure as Code (IaC) practices, defining the entire infrastructure for reproducibility and simplified change management. Static Site Generation enhances website performance, and pre-rendering content to boost user experience and search engine visibility.
The project's Event-driven approach adeptly responds to changes in content or the codebase. Continuous Integration and Continuous Deployment (CI/CD) pipelines, incorporating Quality Gates like build, test, and deployment processes, automate workflows seamlessly. Security remains paramount through the implementation of the Principle of Least Privilege, effectively minimizing potential risks.
Notably, the project also incorporates a Headless CMS approach for flexible content management and Containerization for efficient deployment and scalability. Website implements Single Page Application (SPA) architecture supporting Hybrid Rendering to strike a balance between server-side generation and client-side rendering for optimal performance.
This simplified yet comprehensive project benefits from efficient content management, automated workflows, and a scalable, cost-effective infrastructure. It stands as a practical template, showcasing best practices in modern web development, and provides an inclusive solution for developers seeking to elevate their projects.
- Editor changes the content in Contentful
- Contentful triggers Contentful Webhook Lambda
- Contentful Webhook sends a message to SQS Queue
- see C) Static Site Generation
- EventBridge Update GitHub Rule triggers Update GitHub Function Lambda by schedule (once a day)
- Update GitHub Function gets data from GitHub API
- GitHub API resolves personal access token to a particular user's GitHub Profile and returns user data
- Update GitHub Function writes GitHub file (if not changed) to S3 Data Bucket
- Data Bucket sends a Put Object notification in the form of a message to SQS Queue
- see C) Static Site Generation
- SQS Queue waits for a batch of messages for 5 minutes and triggers Web App Function Lambda
- Web App Function gets GitHub file from S3 Data Bucket
- Web App Function gets Contentful data from Contentful Delivery API
- Contentful Delivery API gets data from Contentful and returns
- Web App Function builds Web App static assets and deploys them to S3 Web App Bucket
- Developer pushes tag to GitHub Repository
- GitHub Repository triggers GitHub CD Action
- GitHub CD Action builds artifacts and uploads them to AWS Infrastructure
- GitHub CD Action deploys Lambdas from artifacts uploaded