/api-rest-ts-aks

A repository with a simple REST API application written in TypeScript and deployed to Azure Kubernetes Service (AKS) using Terraform and GitHub Actions for CI/CD.

Primary LanguageTypeScriptMIT LicenseMIT

TypeScript REST API Application with AKS

A repository with a simple REST API application written in TypeScript and deployed to Azure Kubernetes Service (AKS) using Terraform and GitHub Actions for CI/CD.

🚀 Resources Used

🔥 How to run the application locally?

Before to run the Docker command, you will need to create in the root of the project a file called: .env and inside this file, you will need to add the following environment variables below:

PORT=3000

MONGODB_URL=mongodb://root:password123@mongodb_container:27017/?authSource=admin
MONGODB_LOCAL_URL=mongodb://root:password123@localhost:27017/?authSource=admin
MONGODB_DATABASE_NAME=employees-database

You will need to change the values of the environment variables above according to your MongoDB configuration.

We are using Docker to run the application locally. For that, run the following commands below:

docker compose up -d

And to see if the container is running, run the following command below:

docker ps

Now, in the root of the project, you will notice that there is a folder called: rest-client. Inside this folder, there is a file called: employees.http. This file is an HTTP request file that can be executed directly in Visual Studio Code. To execute this file, just click on the button: Send Request that is located in the upper right corner of the file. For testing purposes, create some employee records. And then, test the other HTTP requests.

To stop the container, run the following command below:

docker compose down -- volumes

About the Application

  • SOLID Concepts
  • Clean Architecture
  • Using MongoDB as Database
  • Using Docker and Docker Compose
  • Using GitHub Packages as Docker Registry

❓ Questions? Comments?

If you have any questions about the code developed, feel free to open an ISSUE HERE. We'll get back to you soon!