Skip to content

szabodorka/terraform-eks-fullstack-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

187 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Logo

A StackOverflow-like fullstack web application deployed on AWS EKS with Terraform infrastructure automation.
Explore the documentation »

View Architecture · Setup Guide · Report Issue


Table of Contents

  1. About the Project
  2. Architecture Overview
  3. Tech Stack
  4. Getting Started
  5. Future Plans

About the Project

IHaQ – “I Have a Question” is a StackOverflow-like platform where users can:

  • Post questions
  • Answer other users’ questions
  • Earn points for contributions

This application was originally developed as a team project, the backend and frontend source code (including all commits) come from that earlier collaborative repository.

In this current project, my focus was entirely on the DevOps and cloud infrastructure side:

  • Dockerized the existing Java Spring Boot backend and React frontend
  • Created a Docker Compose setup for local development
  • Designed and implemented a Terraform-based AWS infrastructure including
    • VPC, Subnets, NAT Gateway
    • EKS Cluster and Node Groups
    • RDS PostgreSQL instance
    • IAM roles and OIDC setup
    • AWS Load Balancer Controller
    • ECR repository with automated build & push of frontend and backend images
  • Deployed workloads via Kubernetes manifests on EKS

(back to top)

Architecture Overview

The project runs on AWS Cloud:

  • EKS (Elastic Kubernetes Service) handles container orchestration
  • RDS (Relational Database Service) hosts the PostgreSQL database
  • ALB (Application Load Balancer) routes frontend and backend traffic
  • ECR (Elastic Container Registry) stores built Docker images

Infrastructure is fully provisioned with Terraform, and the app is deployed through Kubernetes manifests for backend, frontend, database migration, and ingress routing.

(back to top)

Tech Stack

Layer Technologies
Frontend ReactNginx
Backend Spring Boot Java
Database PostgreSQL AWS RDS
Infrastructure Terraform AWS
Containerization & Orchestration Docker Kubernetes

Getting Started

1. Fork the project and clone the repository

git clone https://github.com/<your-github-username>/<your-repo-name>.git

2. Provision infrastructure with Terraform

cd terraform
terraform init
terraform apply

This will:

  • Create a VPC with public/private subnets
  • Deploy an EKS cluster
  • Deploy an RDS PostgreSQL database
  • Set up IAM roles and the AWS Load Balancer Controller

⚠️ Prerequisites:

  • AWS CLI configured with credentials
  • Terraform installed
  • kubectl + helm installed

3. Deploy Application to Kubernetes

Insert RDS Endpoint and ECR repository URL from Terraform output into backend.yaml, db-init-job-yaml and frontend-deployment.yaml files.

Apply the Kubernetes manifests:

kubectl apply -f k8s/backend.yaml
kubectl apply -f k8s/frontend-deployment.yaml
kubectl apply -f k8s/ingress.yaml

4. Run Database Migration

Upload and apply the initial SQL script:

kubectl create configmap ihaq-migrations --from-file=startup.sql
kubectl apply -f k8s/db-init-job.yaml

5. Access the Application

Once the ALB is created, check the ingress:

kubectl get ingress ihaq-ingress -o wide

Open the given ALB URL in your browser

6. Cleanup

  • Remove all Kubernetes objects:
kubectl delete -f k8s
kubectl get ingress # must be empty

Monitor on AWS EC2 Console if Load Balancer, Target Group and Network Interface is removed

  • Destroy Terraform resources:
terraform destroy

(back to top)

Future plans

  • Add CI/CD pipeline (GitHub Actions or GitLab CI)
  • Implement TLS certificates for HTTPS
  • Add autoscaling for backend and frontend
  • Add monitoring with Prometheus & Grafana

About

Containerized a Java-Spring Boot-React fullstack app, I Have a Question with Docker and deployed to AWS EKS. AWS infrastructure created using Terraform: VPC, RDS PostgreSQL DB, EKS cluster, Load Balancer Controller, ECR. Application deployed with Kubernetes manifest files.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors