Skip to content

This development exercise shows how to build a deployable and scalable architecture for backend purposes. Using Go, MongoDB, Docker, and Kubernetes to manage cloud and local resources for a scalable business.

Notifications You must be signed in to change notification settings

SimonGrishin/Backend-Task-Scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Backend-Task-Scheduler

Task scheduling system using Golang, RESTful API, MongoDB, Docker, and Kubernetes.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage

About The Project

This project was seperated into 5 exercises:

  1. Configure task driven scheduler in Golang
  2. Building a RESTful API with Gin
  3. MongoDB: Integrating MongoDB with the Gin API
  4. Docker: Containerizing the API with Docker
  5. Kubernetes: Depolying the Containerized API on Kubernetes

The purpose of this project is to build a task scheduling system that builds upon itself to upgrade functionality. This README will explain each step with visuals and Command-Line arguments to run the applications.

Built With

Tools and Frameworks with links to learning resources

References to each tool and language is provided above.

(back to top)

Getting Started

The IDE used for this project is Microsoft's Visual Studio Code It is able to run CLI and the extension manager is able to create dockerfiles, go files, YAML and JSON needed for configuration

Prerequisites

you will need to download Go, VScode, Docker Desktop, and Postman

you will need to set up MongoDB demo account

Installation

These are the instructions for cloning the repository and installing any dependencies

  1. Clone the repo

    git clone https://github.com/SimonGrishin/Backend-Task-Scheduler.git
  2. For any issues with required modules

    go get <module_name>@latest

(back to top)

Exercise 1: Configure task driven scheduler in Go

Develop a basic Go program that acts as a task scheduler. The program will read tasks and their types from a YAML configuration file, and execute these tasks based on their defined type. This exercise introduces basic Go syntax, enums, file operations, and working with YAML configurations.

Running the task_scheduler.go:

go run task_scheduler.go

Exercise 2: Building a RESTful API with Gin

Expand upon the knowledge gained from the first exercise by developing a RESTful API using the Gin framework. This API will manage a collection of tasks (similar to the ones in the first exercise) with the ability to Create, Read, Update, and Delete (CRUD) tasks

Running the restful_api.go:

go run restful_api.go

Exercise 3: MongoDB: Integrating MongoDB with Gin API

Enhance the task management API developed in the previous exercise by integrating MongoDB for persistent data storage. This involves setting up a MongoDB database, connecting it with the Go application, and modifying the API to perform CRUD operations on the database.

Running chat.go:

go run chat.go

Exercise 4: Docker: Containerize the API with Docker

Gain practical experience in Docker by containerizing the Gin-based API with MongoDB integration. This exercise focuses on Docker usage, creating Docker images, and managing containers while ensuring the API is accessible from outside the container.

Build the docker image:

docker build . -t go-container-test:latest

you can change go-container-test to any name but keep it consistent

Run the docker container using the image:

docker run -e PORT=9000 -p 9000:9000 go-container-test:latest

you can test endpoints using: https://0.0.0.0.9000/tasks

Exercise 5: Kubernetes: Deploying the containerized API on Kubernetes

Learn the basics of Kubernetes by deploying the previously Dockerized Gin-based API onto a local Kubernetes cluster. This exercise introduces Kubernetes concepts like pods, deployments, services, and basic cluster management.

Apply the kubernetes deployment and service manifests:

  kubectl apply -f bb-admin.yaml

Check deployed containers:

kubectl get deployments

Usage

Deploying Kubernetes with Docker containers has multiple practical applications from running applications on unknown operating systems and managing resources.

In combination with cloud data storage and kubernetes resource allocation, applications can run completely in the cloud and efficiently use the local hardware. This is an affordable and simple approach to scalable applications for backend developement

Contact

Simon Grishin - @LinkedIn - simon.grishin@gmail.com

(back to top)

About

This development exercise shows how to build a deployable and scalable architecture for backend purposes. Using Go, MongoDB, Docker, and Kubernetes to manage cloud and local resources for a scalable business.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages