Crowdlinks project
Crowdlinks Infrastructure / DevOps
Work

Crowdlinks Infrastructure / DevOps

Feb 2021
Table of Contents

Tech Stack

Infrastructure / DevOps

TechnologyCategoryDescription
TerraformIaCManages most AWS resources (VPC, ECS, RDS, etc.) with code.
Serverless FrameworkIaCManages Lambda functions to simplify TypeScript handling.
AWSCloud ProviderHosting platform using ECS Fargate, RDS, etc.
DockerContainerizationContainerizes applications for consistent environments across dev and prod.
CircleCICI/CDAutomates Terraform plan/apply and application deployments.
MakefileTask RunnerAbstracts complex Terraform commands for easier developer operation.

Architecture Overview

infra-architecture

The infrastructure is designed for high availability and scalability, utilizing AWS managed services.

Infrastructure as Code (IaC) Strategy

We strictly enforce a “No Ops in Console” rule. All resources are managed via IaC tools to ensure reproducibility and prevent configuration drift.

Directory Structure: Environments vs Modules

To maximize code reusability and maintainability, we separated the codebase into modules and environments.

infrastructure-aws/
├── environments/
│   ├── dev/
│   │   ├── main.tf
│   │   ├── variables.tf
│   │   └── ...
│   └── prod/
│       ├── main.tf
│       ├── variables.tf
│       └── ...
├── modules/
│   ├── vpc/
│   ├── rds/
│   ├── ecs_task/
│   └── ...
└── Makefile

This structure allows us to:

Operational Abstraction with Makefile

Managing Terraform commands across multiple directories and environments can be complex and error-prone. To solve this, we implemented a Makefile to abstract these operations.

Key Benefits:

# Example from Makefile
plan-dev-web: ## terraform plan dev/web
	$(call terraform_init,${DEV_WEB_DIR})
	$(call terraform_plan,${DEV_WEB_DIR})

Monorepo Strategy

We adopted a Polyglot Monorepo strategy to manage the entire application lifecycle in a single repository. This includes:

crowdlinks/
├── backend-main       # Spring Boot (Kotlin)
├── frontend-main      # Nuxt.js (TypeScript)
├── frontend-admin     # Nuxt.js (TypeScript)
├── frontend-media     # Nuxt.js (TypeScript)
└── infrastructure-aws # Terraform & Serverless Framework

Benefits

Streamlined CI/CD Pipeline for monorepo

We utilize CircleCI with advanced configuration patterns to handle the complexity of a monorepo efficiently.

Dynamic Configuration & Selective Execution

To avoid unnecessary builds and reduce wait times, we implemented a Dynamic Configuration system.

  1. Change Detection: A custom script (.circleci/bin/is_changed_directory.sh) analyzes git diffs to identify which top-level directories (e.g., backend-main, infrastructure-aws) have changed.
  2. Config Generation: generate_circleci_config.sh dynamically generates the CircleCI configuration file, including only the jobs relevant to the changed components.
  3. Selective Execution: Only the necessary workflows run. For example, a change in infrastructure-aws will trigger Terraform jobs but skip the Spring Boot build.

Workflows

The pipeline is divided into distinct workflows for each component:

Automated Notifications

We integrated Slack notifications to keep the team informed:

This automated, intelligent pipeline ensures that our “No Ops in Console” rule is strictly followed while maintaining high developer velocity.

Related Projects

    Mike 3.0

    Send a message to start the chat!

    You can ask the bot anything about me and it will help to find the relevant information!

    Try asking: