<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Olasubomi Onasanwo</title>
    <description>The latest articles on DEV Community by Olasubomi Onasanwo (@subby_c11289).</description>
    <link>https://dev.to/subby_c11289</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2798117%2Fc18726da-1bc9-49ec-9ad2-014c162f99cc.png</url>
      <title>DEV Community: Olasubomi Onasanwo</title>
      <link>https://dev.to/subby_c11289</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/subby_c11289"/>
    <language>en</language>
    <item>
      <title>Microservices Application Containerization and Infrastructure Automation</title>
      <dc:creator>Olasubomi Onasanwo</dc:creator>
      <pubDate>Wed, 19 Mar 2025 13:46:20 +0000</pubDate>
      <link>https://dev.to/subby_c11289/microservices-application-containerization-and-infrastructure-automation-21kb</link>
      <guid>https://dev.to/subby_c11289/microservices-application-containerization-and-infrastructure-automation-21kb</guid>
      <description>&lt;p&gt;Project Overview&lt;br&gt;
This project successfully accomplished the containerization and automated deployment of a microservices-based TODO application. The implementation followed modern DevOps practices, utilizing container technologies, infrastructure as code, and configuration management to create a seamless deployment pipeline.&lt;br&gt;
Key Achievements&lt;br&gt;
Application Containerization&lt;/p&gt;

&lt;p&gt;Forked and enhanced the original TODO application repository&lt;br&gt;
Created optimized Dockerfiles for each microservice component:&lt;/p&gt;

&lt;p&gt;Frontend (Vue.js)&lt;br&gt;
Auth API (Go)&lt;br&gt;
Todos API (Node.js)&lt;br&gt;
Users API (Java/Spring Boot)&lt;br&gt;
Log Message Processor (Python)&lt;br&gt;
Redis Queue&lt;/p&gt;

&lt;p&gt;Implemented a comprehensive docker-compose.yml configuration for single-command application startup&lt;br&gt;
Configured Traefik as a reverse proxy with automated SSL certificate management&lt;br&gt;
Established secure endpoints with proper domain routing&lt;/p&gt;

&lt;p&gt;Infrastructure Automation&lt;/p&gt;

&lt;p&gt;Developed a dedicated infrastructure repository with Terraform and Ansible configurations&lt;br&gt;
Created modular Terraform code for provisioning cloud resources with appropriate security configurations&lt;br&gt;
Implemented Ansible roles for:&lt;/p&gt;

&lt;p&gt;System dependencies installation (Docker, Docker Compose)&lt;br&gt;
Application deployment and configuration&lt;br&gt;
SSL/TLS setup with Traefik integration&lt;/p&gt;

&lt;p&gt;Achieved complete end-to-end automation with single-command deployment&lt;br&gt;
Produced detailed documentation for infrastructure setup and management&lt;/p&gt;

&lt;p&gt;Technical Implementation Details&lt;br&gt;
The solution implements a modern microservices architecture with containerized components, each running in its own Docker container. The infrastructure code provisions the necessary cloud resources and configures the deployment environment, ensuring consistency and repeatability. The entire system can be deployed with a single terraform apply -auto-approve command, demonstrating the power of infrastructure as code.&lt;br&gt;
Technologies Used&lt;/p&gt;

&lt;p&gt;Docker and Docker Compose for containerization&lt;br&gt;
Terraform for infrastructure provisioning&lt;br&gt;
Ansible for configuration management&lt;br&gt;
Traefik for reverse proxy and SSL management&lt;br&gt;
Various programming languages (Vue.js, Go, Node.js, Java, Python)&lt;/p&gt;

&lt;p&gt;Results&lt;br&gt;
The completed project demonstrates a production-ready microservices application with proper security measures, scalable architecture, and automated deployment capabilities. This implementation showcases advanced DevOps skills and provides a solid foundation for future enhancements.&lt;br&gt;
Project Links&lt;/p&gt;

&lt;p&gt;Application Repository: &lt;a href="https://github.com/hngprojects/DevOps-Stage-4.git" rel="noopener noreferrer"&gt;https://github.com/hngprojects/DevOps-Stage-4.git&lt;/a&gt;&lt;br&gt;
Infrastructure Repository: &lt;a href="https://github.com/sdrock83/DevOps-Stage-4-Infrastructure.git" rel="noopener noreferrer"&gt;https://github.com/sdrock83/DevOps-Stage-4-Infrastructure.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This project successfully met all the requirements specified in the Stage 4 task, including containerization, secure domain configuration, infrastructure automation, and single-command deployment.&lt;/p&gt;

&lt;p&gt;Task&lt;br&gt;
DevOps Stage 4 Task: Containerize, Deploy, and Automate a Microservices TODO ApplicationOverview&lt;br&gt;
This task consists of two parts:&lt;br&gt;
    1. Containerizing a microservices application (in a forked repository)&lt;br&gt;
    2. Creating infrastructure automation code (in a new repository)&lt;br&gt;
Part 1: Application Containerization&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Repository Setup
• Fork the original application repository from: GITHUB REPOSITORY
• Clone your forked repository to your local machine
• Make all containerization changes in this repository&lt;/li&gt;
&lt;li&gt;Application Components
• Frontend (Vue.js)
• Auth API (Go)
• Todos API (Node.js)
• Users API (Java/Spring Boot)
• Log Message Processor (Python)
• Redis Queue&lt;/li&gt;
&lt;li&gt;Containerization Tasks
• Create Dockerfiles for each service in their respective folders
• Set up docker-compose.yml in the root directory
• Ensure the application builds with a single command:
docker-compose up -d&lt;/li&gt;
&lt;li&gt;Domain &amp;amp; SSL Configuration
• Configure a custom domain for the application
• Set up Traefik as reverse proxy
• Implement HTTP to HTTPS redirection
• Configure endpoints:
    ◦ Frontend: &lt;a href="https://domain.com" rel="noopener noreferrer"&gt;https://domain.com&lt;/a&gt;
    ◦ Auth API: &lt;a href="https://auth.domain.com%C2%A0or%C2%A0https://domain.com/api/auth" rel="noopener noreferrer"&gt;https://auth.domain.com or https://domain.com/api/auth&lt;/a&gt;
    ◦ Todos API: &lt;a href="https://todos.domain.com%C2%A0or%C2%A0https://domain.com/api/todos" rel="noopener noreferrer"&gt;https://todos.domain.com or https://domain.com/api/todos&lt;/a&gt;
    ◦ Users API: &lt;a href="https://users.domain.com%C2%A0or%C2%A0https://domain.com/api/users" rel="noopener noreferrer"&gt;https://users.domain.com or https://domain.com/api/users&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Expected Behaviors
• Login page should be accessible at your custom domain
• Successful login should redirect to TODO dashboard
• Direct API access should return:
    ◦ Auth API: "Not Found" response
    ◦ Todos API: "Invalid Token" message
    ◦ Users API: "Missing or invalid Authorization header"&lt;/li&gt;
&lt;li&gt;Push Changes
• Commit and push all your changes to your forked repository
Part 2: Infrastructure as Code and Configuration Management&lt;/li&gt;
&lt;li&gt;New Repository Creation
• Create a new repository specifically for infrastructure code
• This repository should contain all Terraform and Ansible files&lt;/li&gt;
&lt;li&gt;Terraform Module
• Create Terraform configurations to:
    ◦ Provision cloud server(s)
    ◦ Configure security groups
    ◦ Dynamically create Ansible inventory files
    ◦ Trigger Ansible playbook execution after provisioning&lt;/li&gt;
&lt;li&gt;Ansible Module
Create Ansible roles for:
• Dependencies Role:
    ◦ Installing Docker, Docker Compose, and other required dependencies
• Deployment Role:
    ◦ Cloning the application repository (your forked repo from Part 1)
    ◦ Executing Docker Compose to deploy the application
    ◦ Setting up SSL/TLS with Traefik&lt;/li&gt;
&lt;li&gt;Single Command Deployment
• The entire infrastructure setup and application deployment should be executable with a single command:
terraform apply -auto-approve
• This command should provision infrastructure, configure the server, and deploy the application automatically&lt;/li&gt;
&lt;li&gt;README Documentation
• Create a detailed README.md file in the infrastructure repository with:
    ◦ Setup instructions
    ◦ Requirements
    ◦ Description of the infrastructure and deployment process
    ◦ Any environment variables or configuration needed
Submission Requirements&lt;/li&gt;
&lt;li&gt;Repository URLs
• Forked application repository URL (Part 1)
• New infrastructure repository URL (Part 2)&lt;/li&gt;
&lt;li&gt;Required Screenshots
• Login page at domain.com
• TODO dashboard after successful login
• Successful Terraform and Ansible playbook execution&lt;/li&gt;
&lt;li&gt;URLs to Submit
• Both GitHub repository links
• Frontend application URL
Grading Criteria&lt;/li&gt;
&lt;li&gt;Application Repository Validation
• Proper Dockerfile configuration for all services
• Working docker-compose.yml
• All required services present and properly containerized&lt;/li&gt;
&lt;li&gt;Infrastructure Repository Validation
• Well-structured Terraform modules
• Properly implemented Ansible roles
• Successful single-command deployment (terraform apply -auto-approve)&lt;/li&gt;
&lt;li&gt;Endpoint and Functionality Validation
• Working application with proper routing
• Secure endpoints (HTTPS)
• Successful login and TODO dashboard access&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Deploying a FastAPI Application with Docker and Nginx: A Comprehensive Guide</title>
      <dc:creator>Olasubomi Onasanwo</dc:creator>
      <pubDate>Mon, 17 Feb 2025 23:47:53 +0000</pubDate>
      <link>https://dev.to/subby_c11289/deploying-a-fastapi-application-with-docker-and-nginx-a-comprehensive-guide-5hi</link>
      <guid>https://dev.to/subby_c11289/deploying-a-fastapi-application-with-docker-and-nginx-a-comprehensive-guide-5hi</guid>
      <description>&lt;p&gt;This project demonstrates the deployment of a modern web API using FastAPI, a high-performance Python web framework, integrated with industry-standard DevOps practices. The core application is a book management system that allows users to perform CRUD (Create, Read, Update, Delete) operations on a collection of books, with each book containing details such as title, author, publication year, and genre. The system maintains data consistency through a structured schema and provides RESTful endpoints for interacting with the book inventory.&lt;br&gt;
The deployment architecture showcases the implementation of containerization using Docker and reverse proxy configuration using Nginx, essential components in modern web application deployment. The solution utilizes Docker Compose for container orchestration, managing two main services: the FastAPI application and an Nginx reverse proxy. This setup ensures proper request routing, header management, and service isolation, while maintaining high availability and scalability. The deployment process includes comprehensive configuration of server headers, network settings, and proper integration between the FastAPI service and Nginx proxy, demonstrating a production-ready implementation that follows DevOps best practices.&lt;/p&gt;

&lt;p&gt;Prerequisites&lt;/p&gt;

&lt;p&gt;AWS EC2 instance (Ubuntu 22.04)&lt;br&gt;
Basic knowledge of Python, Docker, and Nginx&lt;br&gt;
Domain name (optional)&lt;/p&gt;

&lt;p&gt;System Architecture&lt;br&gt;
Our deployment stack consists of:&lt;/p&gt;

&lt;p&gt;FastAPI application serving the API&lt;br&gt;
Nginx acting as a reverse proxy&lt;br&gt;
Docker containers for isolation and portability&lt;br&gt;
Docker Compose for service orchestration&lt;/p&gt;

&lt;p&gt;Step 1: Server Setup&lt;br&gt;
1.1 Launch EC2 Instance&lt;/p&gt;

&lt;p&gt;Launch Ubuntu 22.04 EC2 instance&lt;br&gt;
Configure security groups:&lt;br&gt;
HTTP (80)   : 0.0.0.0/0&lt;br&gt;
HTTPS (443) : 0.0.0.0/0&lt;br&gt;
SSH (22)    : Your IP&lt;/p&gt;

&lt;p&gt;1.2 Connect to Server&lt;br&gt;
ssh -i your-key.pem ubuntu@your-ec2-public-ip&lt;/p&gt;

&lt;p&gt;1.3 Update System&lt;br&gt;
sudo apt update&lt;br&gt;
sudo apt upgrade -y&lt;/p&gt;

&lt;p&gt;Step 2: Installing Required Software&lt;br&gt;
2.1 Install Python and Virtual Environment&lt;/p&gt;

&lt;h1&gt;
  
  
  Install Python 3
&lt;/h1&gt;

&lt;p&gt;sudo apt install python3 python3-pip -y&lt;/p&gt;

&lt;h1&gt;
  
  
  Install venv
&lt;/h1&gt;

&lt;p&gt;sudo apt install python3.10-venv -y&lt;/p&gt;

&lt;h1&gt;
  
  
  Create virtual environment
&lt;/h1&gt;

&lt;p&gt;python3 -m venv venv&lt;/p&gt;

&lt;h1&gt;
  
  
  Activate virtual environment
&lt;/h1&gt;

&lt;p&gt;source venv/bin/activate&lt;/p&gt;

&lt;p&gt;2.2 Install Docker and Docker Compose&lt;/p&gt;

&lt;h1&gt;
  
  
  Install Docker
&lt;/h1&gt;

&lt;p&gt;sudo apt install docker.io -y&lt;/p&gt;

&lt;h1&gt;
  
  
  Install Docker Compose
&lt;/h1&gt;

&lt;p&gt;sudo apt install docker-compose -y&lt;/p&gt;

&lt;h1&gt;
  
  
  Add user to docker group
&lt;/h1&gt;

&lt;p&gt;sudo usermod -aG docker $USER&lt;/p&gt;

&lt;h1&gt;
  
  
  Verify installations
&lt;/h1&gt;

&lt;p&gt;docker --version&lt;br&gt;
docker-compose --version&lt;/p&gt;

&lt;p&gt;Step 3: Application Setup&lt;br&gt;
3.1 Clone and Configure Project&lt;/p&gt;

&lt;h1&gt;
  
  
  Clone project repository
&lt;/h1&gt;

&lt;p&gt;git clone your-repository-url&lt;br&gt;
cd fastapi-book-project&lt;/p&gt;

&lt;h1&gt;
  
  
  Create project structure
&lt;/h1&gt;

&lt;p&gt;mkdir -p api/db api/routes&lt;/p&gt;

&lt;p&gt;3.2 Create Application Files&lt;br&gt;
main.py&lt;br&gt;
from fastapi import FastAPI&lt;br&gt;
from fastapi.middleware.cors import CORSMiddleware&lt;br&gt;
from api.router import router&lt;/p&gt;

&lt;p&gt;app = FastAPI(&lt;br&gt;
    title="Book Management API",&lt;br&gt;
    description="A simple API for managing books",&lt;br&gt;
    version="1.0.0"&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;app.add_middleware(&lt;br&gt;
    CORSMiddleware,&lt;br&gt;
    allow_origins=["&lt;em&gt;"],&lt;br&gt;
    allow_credentials=True,&lt;br&gt;
    allow_methods=["&lt;/em&gt;"],&lt;br&gt;
    allow_headers=["*"],&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;app.include_router(router)&lt;/p&gt;

&lt;p&gt;api/router.py&lt;br&gt;
from fastapi import APIRouter&lt;br&gt;
from api.routes import books&lt;/p&gt;

&lt;p&gt;router = APIRouter()&lt;/p&gt;

&lt;p&gt;router.include_router(&lt;br&gt;
    books.router,&lt;br&gt;
    prefix="/api/v1/books",&lt;br&gt;
    tags=["books"]&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;Step 4: Docker Configuration&lt;br&gt;
4.1 Create Dockerfile&lt;br&gt;
FROM python:3.12-slim&lt;br&gt;
WORKDIR /app&lt;br&gt;
COPY requirements.txt .&lt;br&gt;
RUN pip install --no-cache-dir -r requirements.txt&lt;br&gt;
COPY . .&lt;br&gt;
EXPOSE 8000&lt;br&gt;
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]&lt;/p&gt;

&lt;p&gt;4.2 Create docker-compose.yml&lt;br&gt;
version: '3.8'&lt;br&gt;
services:&lt;br&gt;
  fastapi-app:&lt;br&gt;
    build: .&lt;br&gt;
    container_name: fastapi_app&lt;br&gt;
    restart: always&lt;br&gt;
    networks:&lt;br&gt;
      - app_network&lt;/p&gt;

&lt;p&gt;nginx:&lt;br&gt;
    image: nginx:alpine&lt;br&gt;
    container_name: fastapi_nginx&lt;br&gt;
    ports:&lt;br&gt;
      - "80:80"&lt;br&gt;
    volumes:&lt;br&gt;
      - ./nginx.conf:/etc/nginx/conf.d/default.conf&lt;br&gt;
    depends_on:&lt;br&gt;
      - fastapi-app&lt;br&gt;
    networks:&lt;br&gt;
      - app_network&lt;/p&gt;

&lt;p&gt;networks:&lt;br&gt;
  app_network:&lt;br&gt;
    driver: bridge&lt;/p&gt;

&lt;p&gt;Step 5: Nginx Configuration&lt;br&gt;
5.1 Create nginx.conf&lt;br&gt;
server {&lt;br&gt;
    listen 80;&lt;br&gt;
    server_name your-domain;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;proxy_hide_header Server;
add_header Server nginx always;

location /api/v1/books {
    proxy_pass http://fastapi-app:8000/api/v1/books/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

location / {
    proxy_pass http://fastapi-app:8000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Step 6: Deployment&lt;br&gt;
6.1 Build and Start Services&lt;/p&gt;

&lt;h1&gt;
  
  
  Build images
&lt;/h1&gt;

&lt;p&gt;docker-compose build&lt;/p&gt;

&lt;h1&gt;
  
  
  Start services
&lt;/h1&gt;

&lt;p&gt;docker-compose up -d&lt;/p&gt;

&lt;h1&gt;
  
  
  Verify services
&lt;/h1&gt;

&lt;p&gt;docker-compose ps&lt;/p&gt;

&lt;p&gt;6.2 Check Logs&lt;/p&gt;

&lt;h1&gt;
  
  
  Check FastAPI logs
&lt;/h1&gt;

&lt;p&gt;docker-compose logs fastapi-app&lt;/p&gt;

&lt;h1&gt;
  
  
  Check Nginx logs
&lt;/h1&gt;

&lt;p&gt;docker-compose logs nginx&lt;/p&gt;

&lt;p&gt;Step 7: Testing&lt;br&gt;
7.1 API Endpoint Testing&lt;/p&gt;

&lt;h1&gt;
  
  
  Test list endpoint
&lt;/h1&gt;

&lt;p&gt;curl &lt;a href="http://your-domain/api/v1/books/" rel="noopener noreferrer"&gt;http://your-domain/api/v1/books/&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Test single book endpoint
&lt;/h1&gt;

&lt;p&gt;curl &lt;a href="http://your-domain/api/v1/books/1" rel="noopener noreferrer"&gt;http://your-domain/api/v1/books/1&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Test server headers
&lt;/h1&gt;

&lt;p&gt;curl -I &lt;a href="http://your-domain/api/v1/books/" rel="noopener noreferrer"&gt;http://your-domain/api/v1/books/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;7.2 Browser Testing&lt;br&gt;
Navigate to &lt;a href="http://your-domain/docs" rel="noopener noreferrer"&gt;http://your-domain/docs&lt;/a&gt;&lt;br&gt;
Test endpoints through Swagger UI&lt;/p&gt;

&lt;p&gt;Step 8: Maintenance and Monitoring&lt;br&gt;
8.1 View Container Stats&lt;br&gt;
docker stats&lt;br&gt;
8.2 Monitor Logs&lt;br&gt;
docker-compose logs -f&lt;/p&gt;

&lt;p&gt;8.3 Backup Configuration&lt;/p&gt;

&lt;h1&gt;
  
  
  Backup important files
&lt;/h1&gt;

&lt;p&gt;tar -czf backup.tar.gz docker-compose.yml nginx.conf Dockerfile&lt;/p&gt;

&lt;p&gt;Best Practices&lt;/p&gt;

&lt;p&gt;Security&lt;/p&gt;

&lt;p&gt;Keep Docker and system packages updated&lt;br&gt;
Use specific container versions&lt;br&gt;
Implement proper firewall rules&lt;/p&gt;

&lt;p&gt;Performance&lt;/p&gt;

&lt;p&gt;Enable Nginx caching when appropriate&lt;br&gt;
Monitor resource usage&lt;br&gt;
Implement rate limiting&lt;/p&gt;

&lt;p&gt;Maintenance&lt;/p&gt;

&lt;p&gt;Regular backups&lt;br&gt;
Log rotation&lt;br&gt;
Health checks&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
This deployment architecture provides a robust, scalable solution for hosting FastAPI applications. The combination of Docker containers and Nginx reverse proxy ensures:&lt;/p&gt;

&lt;p&gt;Isolated application environment&lt;br&gt;
Proper request handling&lt;br&gt;
Scalability options&lt;br&gt;
Easy maintenance&lt;/p&gt;

&lt;p&gt;Regular monitoring and maintenance will ensure optimal performance and reliability of your deployed application.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Number Classification API: A Smart Way to Classify Numbers</title>
      <dc:creator>Olasubomi Onasanwo</dc:creator>
      <pubDate>Fri, 07 Feb 2025 11:07:38 +0000</pubDate>
      <link>https://dev.to/subby_c11289/number-classification-api-a-smart-way-to-classify-numbers-15dj</link>
      <guid>https://dev.to/subby_c11289/number-classification-api-a-smart-way-to-classify-numbers-15dj</guid>
      <description>&lt;p&gt;Number Classification API: A Smart Way to Classify Numbers&lt;/p&gt;

&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;Numbers are more than just digits; they have fascinating properties that make them unique. Whether a number is prime, perfect, or an Armstrong number, these properties can reveal interesting mathematical patterns. To automate this classification process, we built the Number Classification API, a powerful yet simple API that categorizes numbers based on their mathematical properties and even provides fun facts about them!&lt;/p&gt;

&lt;p&gt;This blog post will walk you through the features, use cases, and how you can start using the API today.&lt;/p&gt;

&lt;p&gt;What is the Number Classification API?&lt;/p&gt;

&lt;p&gt;The Number Classification API is a RESTful web service that allows users to classify numbers based on predefined mathematical rules. Given any number as input, the API will return structured JSON output containing its properties and an interesting fact.&lt;/p&gt;

&lt;p&gt;Key Features&lt;/p&gt;

&lt;p&gt;✅ Checks if a number is prime&lt;br&gt;
✅ Identifies perfect numbers&lt;br&gt;
✅ Detects Armstrong numbers&lt;br&gt;
✅ Computes the sum of digits&lt;br&gt;
✅ Provides an interesting fun fact about the number&lt;br&gt;
✅ Simple and lightweight API with fast response times&lt;/p&gt;

&lt;p&gt;How It Works&lt;/p&gt;

&lt;p&gt;The API takes a number as input via a simple HTTP request and returns a JSON response with detailed classifications.&lt;/p&gt;

&lt;p&gt;Example Request&lt;/p&gt;

&lt;p&gt;curl "&lt;a href="http://your-api-domain/api/classify-number?number=153" rel="noopener noreferrer"&gt;http://your-api-domain/api/classify-number?number=153&lt;/a&gt;"&lt;/p&gt;

&lt;p&gt;Example Response&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
    "number": 153,&lt;br&gt;
    "is_prime": false,&lt;br&gt;
    "is_perfect": false,&lt;br&gt;
    "properties": ["armstrong", "odd"],&lt;br&gt;
    "digit_sum": 9,&lt;br&gt;
    "fun_fact": "153 is a narcissistic number."&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Deployment &amp;amp; Technology Stack&lt;/p&gt;

&lt;p&gt;The Number Classification API is hosted on an AWS EC2 instance and is powered by:&lt;/p&gt;

&lt;p&gt;Flask (Python) – for the backend framework&lt;/p&gt;

&lt;p&gt;Gunicorn &amp;amp; Nginx – for efficient web server performance&lt;/p&gt;

&lt;p&gt;Ubuntu – as the cloud-hosted environment&lt;/p&gt;

&lt;p&gt;Deployment Architecture&lt;/p&gt;

&lt;p&gt;The Flask application runs behind Gunicorn, a Python WSGI server.&lt;/p&gt;

&lt;p&gt;Nginx is used as a reverse proxy to forward client requests to Gunicorn.&lt;/p&gt;

&lt;p&gt;The API is hosted on AWS EC2, making it publicly accessible.&lt;/p&gt;

&lt;p&gt;Use Cases &amp;amp; Applications&lt;/p&gt;

&lt;p&gt;The Number Classification API can be integrated into various applications:&lt;/p&gt;

&lt;p&gt;🎯 Math Education Apps – Helps students explore number properties interactively.&lt;br&gt;
🎯 Data Science Projects – Useful for classifying numerical datasets based on their properties.&lt;br&gt;
🎯 Puzzle &amp;amp; Game Development – Can be used to generate challenges and logic-based puzzles.&lt;br&gt;
🎯 Trivia &amp;amp; Chatbots – Enhances AI bots with number-based trivia.&lt;/p&gt;

&lt;p&gt;How to Get Started&lt;/p&gt;

&lt;p&gt;You can start using the Number Classification API in just a few simple steps:&lt;/p&gt;

&lt;p&gt;1️⃣ Clone the repository from GitHub:&lt;/p&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/yourusername/number-classification-api.git" rel="noopener noreferrer"&gt;https://github.com/yourusername/number-classification-api.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2️⃣ Install dependencies:&lt;/p&gt;

&lt;p&gt;cd number-classification-api&lt;br&gt;
python3 -m venv venv&lt;br&gt;
source venv/bin/activate&lt;br&gt;
pip install -r requirements.txt&lt;/p&gt;

&lt;p&gt;3️⃣ Start the API locally:&lt;/p&gt;

&lt;p&gt;python3 app.py&lt;/p&gt;

&lt;p&gt;4️⃣ Deploy on an EC2 instance and set up Nginx &amp;amp; Gunicorn for production.&lt;/p&gt;

&lt;p&gt;Future Enhancements&lt;/p&gt;

&lt;p&gt;We plan to enhance the API with:&lt;/p&gt;

&lt;p&gt;Factorization feature – Breaking down numbers into their prime factors.&lt;/p&gt;

&lt;p&gt;More mathematical classifications – Including sequences and perfect squares.&lt;/p&gt;

&lt;p&gt;User authentication &amp;amp; rate limiting – For better security and API access control.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;The Number Classification API is a practical tool for number lovers, educators, and developers. Whether you’re working on a math-related project or just curious about the properties of numbers, this API provides instant insights.&lt;/p&gt;

&lt;p&gt;🚀 Give it a try, integrate it into your projects, and let us know your thoughts!&lt;/p&gt;

&lt;p&gt;👉 Check out the GitHub Repo: &lt;a href="https://github.com/Subby12/apiserver" rel="noopener noreferrer"&gt;https://github.com/Subby12/apiserver&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Documenting My Experience with NGINX Installation and Configuration</title>
      <dc:creator>Olasubomi Onasanwo</dc:creator>
      <pubDate>Fri, 31 Jan 2025 16:33:12 +0000</pubDate>
      <link>https://dev.to/subby_c11289/documenting-my-experience-with-nginx-installation-and-configuration-4hmo</link>
      <guid>https://dev.to/subby_c11289/documenting-my-experience-with-nginx-installation-and-configuration-4hmo</guid>
      <description>&lt;p&gt;Introduction&lt;br&gt;
This post details the installation and configuration of the NGINX web server as part of a DevOps assignment, enhancing technical skills and offering insights into web server management.&lt;br&gt;
Approach to Completing the Task&lt;/p&gt;

&lt;p&gt;Step 1: Launching an Ubuntu Instance on AWS&lt;br&gt;
The process began by logging into the AWS Management Console and launching an Ubuntu Server instance. The t2.micro instance type was selected for the free tier, with the security group configured to allow HTTP traffic on port 80.&lt;/p&gt;

&lt;p&gt;Step 2: Connecting to the Instance&lt;br&gt;
After launching the instance, the connection was established using SSH, authenticating with the key pair created during setup.&lt;/p&gt;

&lt;p&gt;Step 3: Installing NGINX&lt;br&gt;
With a successful connection, the package index was updated, and NGINX was installed using:&lt;/p&gt;

&lt;p&gt;sudo apt update&lt;br&gt;
sudo apt install nginx -y&lt;/p&gt;

&lt;p&gt;Step 4: Starting and Enabling NGINX&lt;br&gt;
Once installed, the service was started and enabled to launch on boot:&lt;/p&gt;

&lt;p&gt;sudo systemctl start nginx&lt;br&gt;
sudo systemctl enable nginx&lt;br&gt;
The status of NGINX was checked to confirm it was running without errors.&lt;/p&gt;

&lt;p&gt;Step 5: Creating a Custom HTML Page&lt;br&gt;
A custom HTML page was created to serve as the default welcome message. The index.html file was placed in the /var/www/html directory with the following content:&lt;/p&gt;

&lt;p&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;br&gt;
 &amp;lt;​meta charset="UTF-8"&amp;gt;&lt;br&gt;
 Welcome Page&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
 &lt;h1&gt;Welcome to DevOps Stage 0 - Onas/Subomi&lt;/h1&gt;
&lt;br&gt;
&lt;br&gt;


&lt;p&gt;Step 6: Testing the NGINX Configuration&lt;br&gt;
To ensure proper setup, the configuration was tested for syntax errors:&lt;/p&gt;

&lt;p&gt;sudo nginx -t&lt;/p&gt;

&lt;p&gt;NGINX was then reloaded to apply changes, allowing access to the custom page via the public IP address of the instance.&lt;/p&gt;

&lt;p&gt;Challenges Faced and Solutions&lt;br&gt;
Firewall Configuration&lt;br&gt;
An initial challenge involved ensuring the security group rules allowed HTTP traffic. This was resolved by adjusting the settings in the AWS console.&lt;br&gt;
Syntax Errors in HTML&lt;br&gt;
A mistake in the HTML tag structure caused rendering issues. After testing the NGINX configuration, the error was identified and corrected.&lt;/p&gt;

&lt;p&gt;Contribution to Learning and Professional Goals&lt;/p&gt;

&lt;p&gt;This task significantly contributed to learning and professional goals:&lt;br&gt;
Hands-on Experience: Practical experience in deploying a web server is crucial for any DevOps Engineer . “Visit: &lt;a href="https://hng.tech/hire/devops-engineers" rel="noopener noreferrer"&gt;https://hng.tech/hire/devops-engineers&lt;/a&gt;"&lt;/p&gt;

&lt;p&gt;Problem-Solving Skills: Overcoming challenges improved troubleshooting abilities.&lt;/p&gt;

&lt;p&gt;Understanding Web Technologies: This exercise deepened understanding of web technologies and their interactions.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
In summary, the installation and configuration of NGINX provided valuable learning experiences that enhanced technical skills and problem-solving abilities, beneficial for future projects and career pursuits in DevOps.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
