Overview:
Purple Stack is a devstack that is designed for developing large and complex serverless applications on AWS. It is built based on the experience of the Purple team with over 5 years of serverless app development. The stack includes a combination of frontend and backend components, such as Next.js, AWS AppSync, Amazon API Gateway, and more. It also offers features like TypeScript, Serverless Framework, Monorepo, Code Linting, GraphQL API, REST API, CI/CD, and many others.
Features:
- TypeScript: Allows developers to write serverless applications using TypeScript, providing type safety and better code organization.
- Serverless Framework: Utilizes the Serverless Framework to simplify the deployment and management of serverless applications on AWS.
- Next.js: A popular JavaScript framework for building server-side rendered React applications, used for the frontend part of the stack.
- React.js: A JavaScript library for building user interfaces.
- Webpack: A module bundler that enables developers to bundle and optimize their JavaScript code.
- Monorepo - Lerna: Enables managing multiple related projects in a single repository, improving code sharing and collaboration.
- Code Linting - ESlint + Prettier: Enforces code quality and conventions by automatically identifying and fixing common errors and formatting issues.
- GraphQL API - AWS AppSync: Offers a powerful and flexible API for querying and manipulating data, using AWS AppSync.
- REST API - Amazon API Gateway: Provides a scalable and serverless way to build RESTful APIs, utilizing Amazon API Gateway.
- Complex background processes - AWS Step Functions: Allows developers to define and orchestrate complex serverless workflows using AWS Step Functions.
- IaC - CloudFormation: Uses AWS CloudFormation to define and provision AWS resources as code, ensuring infrastructure consistency and reliability.
- CI/CD - CircleCI: Supports continuous integration and continuous deployment, enabling automated testing and deployments.
- Dependencies patching - Renovate: Automates the process of updating and patching dependencies, ensuring applications are up-to-date and secure.
- IaC Security Scanning - Checkov: Performs security scanning and checks on Infrastructure as Code (IaC) templates to identify and address security vulnerabilities.
- Static Application Security Testing (SAST) - ESlint Security Plugins: Enhances application security by scanning and identifying potential security vulnerabilities in the codebase.
- Unit Tests - Jest: Provides a powerful and easy-to-use testing framework for JavaScript applications, ensuring the reliability and correctness of the code.
- Conventional Commits - Commitlint: Enforces conventional commit messages, promoting better commit practices and improving codebase maintainability.
- GraphQL TypeScript Types - GraphQL Code Generator: Generates TypeScript types based on GraphQL schema, enabling type safety and improved developer experience.
Installation:
To install the Purple Stack, follow the steps below:
Create a
.envfile in the root folder of your project.Update the necessary settings in the
.envfile:- Replace
REGIONincommon.regionwith the desired AWS region for deployment. - Create an S3 bucket for serverless deployments and fill the bucket’s name in
common.deploymentBucket. - Replace
purple-stack.cominfrontend.domainwith the desired domain for your application. Ensure that a hosted zone exists for this domain in AWS Route53. - Create a wildcard certificate in the N. Virginia region for the
frontend.domainand fill the certificate ARN infrontend.certificate. - Modify the VPC configuration (if needed) by updating the
vpcvalue or replacing it with~if not required. - Modify
common.projectNameto better identify your application. - Modify
common.dnsRandomStringto improve the security of your feature deployments. - If you want monitoring enabled, specify the stages to monitor in
monitoring.stagesand fill the desired topic ARN inmonitoring.topic.
- Replace
Remove any unnecessary settings or commands related to CircleCI, NPM authentication, or branch filtering as per your requirements.
Summary:
Purple Stack is a comprehensive devstack designed for building large and complex serverless applications on AWS. It provides a wide range of features and tools, including TypeScript, Next.js, React.js, Monorepo, Code Linting, AWS AppSync, Amazon API Gateway, AWS Step Functions, CloudFormation, CI/CD with CircleCI, dependency patching with Renovate, security scanning with Checkov and ESlint Security Plugins, unit testing with Jest, and more. Its modular architecture and extensive configuration options make it a versatile solution for serverless development.