The serverless starter template is built using AWS's cloud computing services, including API Gateway, Lambda, RDS, Cognito, VPC, ACM, Route53, S3 and Cloudfront. The infrastructure as code (IaC) approach ensures that the entire solution can be deployed and managed consistently and reliably, with changes made through version control.
Initially started the template in December 2022, and set a personal deadline to release a MVP before end of March 2023.
The idea was to learn about about the technologies and frameworks used in this template, and create a template I could open and share with the world.
Please feel free to open an issue if you would like to help extend and improve this template!
- Switch to devenv from nix shell
- Add more notes / documentation
- Create project logo
- Add acknowledgement section in README.md
- Setup contributing guidelines
- Improve code quality
- Improve Dashboard with light and dark mode
- Tests in API & Web Application
- CI/CD Integration
Feature | Description |
---|---|
AWS | Cloud Platform |
Terraform CDK | Infrastructure as Code |
Typescript | Codebase Language |
Nest.js | API Framework |
Angular 15 | Web App JS Framework |
Bootstrap 5 | Web App CSS Framework |
CoreUI | Web App Boilerplate Framework |
Nix | Package Management |
DevEnv | Nix Development Environment |
- AWS Route53
- AWS ACM
- AWS API Gateway
- AWS RDS PostgreSQL
- AWS Cognito
- AWS Cloudfront
- AWS Lamba
- AWS S3
- AWS VPC
- AWS IAM
Terraform is an open source Infrastructure as Code tool, created by HashiCorp.
Terraform supports a number of cloud infrastructure providers such as Amazon Web Services, Cloudflare, Microsoft Azure, IBM Cloud, Serverspace, Google Cloud Platform, DigitalOcean, Oracle Cloud Infrastructure, Yandex.Cloud, VMware vSphere, and OpenStack.
Cloud Development Kit for Terraform (CDKTF) lets you use familiar programming languages to define and provision infrastructure.
NestJS Framework built with TypeScript. A progressive NodeJS framework for building efficient and scalable server-side applications.
Angular is a development platform for building mobile and desktop web applications using TypeScript or JavaScript and other languages.
CoreUI is the fastest way to build a modern dashboard for any platforms, browser, or device. A complete UI Kit that allows you to quickly build eye-catching, high-quality, high-performance responsive applications.
Angular Components Library built on top of Bootstrap 5 and TypeScript.
PNPM fast, disk space efficient package manager for Node.js.
Nix powerful package manager for Linux and other Unix systems.
Nixpkgs is a collection of over 80,000 software packages that can be installed with the Nix package manager. It also implements NixOS, a purely-functional Linux distribution.
Fast, Declarative, Reproducible, and Composable Developer Environments using Nix
- AWS Account
- Registered root domain on AWS Route53
- Nix package manager
- Visual Studio Code (optional, but recommended)
An AWS account is required, sign up if you have don't have one:
https://portal.aws.amazon.com/billing/signup
A Route 53 hosted zone / root domain (example.com) is needed, follow the steps below if you don't have one:
-
Go to the AWS Management Console, look for Route53 service and Click on “Get started now” under the DNS management.
-
Click on “Create Hosted Zone” and enter the domain name which you would like to use.
# Linux (non-NixOS)
sh <(curl -L https://nixos.org/nix/install) --daemon
# Mac
sh <(curl -L https://nixos.org/nix/install)
# Windows (run in WSL - non-NixOS Linux distributions)
sh <(curl -L https://nixos.org/nix/install) --no-daemon
Highly recommended to follow the official nix package manager installation guide.
Higly recommend to following the official guide to enable automatic shell activation via direnv.
- NixOS - Homepage
- NixOS - Github
- Nixpkgs - Manual
- Nixpkgs - Github
- Nix - Manual
- Nix - Github
- Nix - Channels & Channel Status
- Nix - Devenv
- Nix - Devenv Automatic Shell Activation
Download & install VS Code:
VS Code extensions:
More extensions for Visual Studio Code can be found on the VS Code Marketplace.
-
Open a terminal and go to the root of the project directory, and create a copy of the .env-sample and rename it to .env, and fill in the details if needed.
-
Execute the following step, if direnv is not installed:
nix develop --impure
-
Install NodeJS dependencies for all sub-projects by executing the following in the root project directory:
npm install
-
Setup the local development environment services including PostgreSQL server:
Starting all services:
devenv up
Stopping all services, by killing the terminal which you executed
devenv up
. -
Start the local development environment API:
npm run api:start
-
Start the local development environment WEB APP:
npm run webapp:start
-
In the project root directory, create a copy the file
./terraform/lib/config/example.index.ts
and rename it to./terraform/lib/config/index.ts
.cp -v ./terraform/lib/config/example.index.ts ././terraform/lib/config/index.ts
-
Replace the values within the file
./terraform/lib/config/index.ts
with your preferred configuration. -
Execute the following in the
terraform
directory:# Terraform Synth npm run synth
-
Deploy the API stack from the project root directory, execute:
# Build API npm run api:build # Builds & Deploy API Stack npm run api:deploy
-
Deploy the WEBAPP stack from the project root directory, execute:
# Build App npm run webapp:build # Builds & Deploy App Stack npm run webapp:deploy
-
Backup Terraform stack state from the project root directory, execute:
# Backup Terraform State to S3 npm run tf:backup
Please note that all images used in the README.md are the property of the respective projects/technologies that are being referenced. I do not claim ownership of these images, and they are used solely for illustrative purposes to help describe the features and functionality of the starter template. If you believe that any image has been used inappropriately, please contact me immediately so that I can take appropriate action.