This project implements a customer management microservice designed with modern Software Engineering and DevOps practices.
It implements a production-ready RESTful service for managing customer accounts while showcasing the full Software Development Lifecycle (SDLC) — from Agile planning and Test-Driven Development (TDD) to automated CI/CD pipelines, containerization, and deployment on Kubernetes/OpenShift.
- Backend: Python, Flask, SQLAlchemy
- Database: PostgreSQL
- Architecture: RESTful microservice, MVC
- CI/CD: GitHub Actions (CI), Tekton Pipelines (CD)
- Containers & Deployment: Docker, Kubernetes
- Testing: Pytest + Coverage
- Quality Gates: Linting, type checks, test coverage enforcement
- Security: Secure headers, CORS policy, dependency scanning workflow
- Observability: Structured logging, health endpoints
This project was built in several sprints, covering the following engineering achievements:
- Utilized a Kanban board (ZenHub/GitHub Projects) to manage the product backlog, tracking progress from "To Do" to "Done".
- Created detailed User Stories and managed sprints effectively.
Figure 1: Agile Kanban Board showing user stories moved to Done/Closed through the sprints.
- Adopted a TDD approach, writing test cases before business logic.
- Implemented unit tests for all CRUD operations (
Create,Read,Update,Delete,List). - Achieved >95% code coverage to ensure reliability.
Figure 2: Unit test execution report demonstrating high code coverage standards.
- Configured GitHub Actions to trigger automated workflows on pull requests.
- Workflows include installing dependencies, linting (PEP8), and running unit tests automatically.
- Integrated Security Headers using
Flask-Talisman. - Established CORS policies using
Flask-Corsto secure API access. - Adhered to strict coding standards verified by linting tools.
- Created optimized
Dockerfilefor the microservice. - Deployed the containerized application to a Kubernetes/OpenShift cluster.
- Built a fully automated Tekton Pipeline for Continuous Deployment.
- Pipeline tasks include: Cloning, Linting, Testing, Building Image, and Deploying to the cluster automatically upon code changes.
Figure 3: A successful execution of the Tekton CD pipeline, showing all tasks (clone, test, build, deploy) completing quickly and successfully.
The application follows the Model-View-Controller (MVC) pattern:
├── service/ <- Microservice package
│ ├── common/ <- Log and error handlers
│ ├── config.py <- Flask configuration
│ ├── models.py <- Database models (Business Logic)
│ └── routes.py <- REST API routes (Controller)
├── tests/ <- Test Suite (TDD)
│ ├── factories.py <- Data factories for testing
│ ├── test_models.py <- Model unit tests
│ └── test_routes.py <- Route unit tests
├── tekton/ <- Tekton Pipeline definitions
└── Dockerfile <- Container definition
These labs are designed to be executed in the IBM Developer Skills Network Cloud IDE with OpenShift.
Once you are in the lab environment, you can initialize it with bin/setup.sh by sourcing it. (Note: DO NOT run this program as a bash script. It sets environment variable and so must be sourced):
source bin/setup.shThis will install Python 3.9, make it the default, modify the bash prompt, create a Python virtual environment and activate it.
After sourcing it you prompt should look like this:
(venv) theia:project$You can activate the Python 3.9 environment with:
source ~/venv/bin/activateThese dependencies are installed as part of the setup process but should you need to install them again, first make sure that the Python 3.9 virtual environment is activated and then use the make install command:
make installThe labs use Postgres running in a Docker container. If for some reason the service is not available you can start it with:
make dbYou can use the docker ps command to make sure that postgres is up and running.
The Account resource includes:
| Name | Type | Optional |
|---|---|---|
| id | Integer | False |
| name | String(64) | False |
| String(64) | False | |
| address | String(256) | False |
| phone_number | String(32) | True |
| date_joined | Date | False |
This repo can also be used for local Kubernetes development. It is not advised that you run these commands in the Cloud IDE environment. The purpose of these commands are to simulate the Cloud IDE environment locally on your computer.
At a minimum, you will need Docker Desktop installed on your computer. For the full development environment, you will also need Visual Studio Code with the Remote Containers extension from the Visual Studio Marketplace. All of these can be installed manually by clicking on the links above or you can use a package manager like Homebrew on Mac of Chocolatey on Windows.
-
Bring up a local K3D Kubernetes cluster
$ make cluster
-
Install Tekton
$ make tekton
-
Install the ClusterTasks that the Cloud IDE has
$ make clustertasks
You can now perform Tekton development locally, just like in the Cloud IDE lab environment.
This project is licensed under the Apache 2.0 License. This repository contains the final Capstone Project for the IBM DevOps and Software Engineering Professional Certificate. Original starter code provided by IBM Skills Network. Implementation and DevOps pipelines developed by Agnaldo Silva Lima. LinkedIn Coursera Portfolio
