TypeScript codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a fully fledged backend application built with TypeScript including CRUD operations, authentication, routing, pagination, and more.
We've gone to great lengths to adhere to the TypeScript community styleguides & best practices.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
This is an Express.js based web-application, written in TypeScript, that implements the RealWorld API endpoints.
It depends on Firestore, a Serverless document database available on Google Cloud. Hence, this app can only be deployed on the Google Cloud platform.
- Install
Node.js
andnpm
. - Install
Docker
. - Run
npm start
.
- Run
npm test
.
This process creates the projects, creates the Artifact Registry repository (in the Bootstrap project), enables the Cloud Build API, grants the iam.securityAdmin
to the Cloud Build Service Account, sets up the Build Pipeline in the development
project and the Deployment pipeline in the production
project.
- Create an Organization on Google Cloud.
- Create a Folder on your Organization to create your projects in.
- Create a Billing Account.
- Install terraform.
- Install the gcloud CLI.
- Run
gcloud auth login
. - Run
gcloud auth application-default login
. - Make sure you own a domain name and have access to it's DNS configuration. This will be necessary to enable HTTPS.
cd
into thedeployment/google-cloud/terraform/bootstrap
.- Comment out the entire contents of the
backend.tf
file. - Create a
terraform.tfvars
file and add your variables' values. - Run
terraform init
. - Run
terraform apply -target=module.bootstrap_project.google_project_service.enable_apis
. - Wait a few minutes until the APIs are enabled.
- Run
terraform apply -target=module.bootstrap_project
. - Uncomment the
backend.tf
file's contents and update thebucket
argument to the value of thetfstate_bucket
output. - Run
terraform init
and typeyes
. - Run
terraform apply -target=module.project
. - Manually connect the Github repositories via the console in CloudBuild. Do not create a Trigger, just click
DONE
once the repository is connected. - Run
terraform apply
.
- A Cloud Build shoud run to build and push a container image to Artifact Registry everytime you push a commit to the branch corresponding to the value you set for the
github_repo_branch
variable. - It will also deploy the system into a "Development" environment.
- After the system is deployed, set up HTTPS for the created Load Balancers.
- Create a Release on Github and tag the commit with a value matching the regex you used as the value of the
github_repo_commit_tag
variable. - This will run the Tag pipeline to tag the artifacts.
- It will also trigger a Deployment to Production.