Giter Site home page Giter Site logo

jobsite's Introduction

Description

This is a simple application that represents a hypothetical job-aggregation web application. It is meant to demonstrate the difference between request/response architecture and the event-driven methodology when designin a microservices application. The application is written in Python and uses Kubernetes for constructing the infrastructure. However, the code can easily be ported to other languages.

Request/Response paradigm

Installation

Without using Docker and Kubernetes

The application is designed so that it can run natively on your laptop, through Docker containers and through Kubernetes. If you intend to run it on your local machine without using containers you just have to start each application in the following order:

The job sites

They simulate real job-site APIs. The data is hardcoded so that we don't need to use a data store. Note The names used here are just examples for demonstration purposes only. The stored data is not real. There is no affilation of any kind to any of the real sites whose names are mentioned here.

LinkedIn
cd linkedin
python3 app/main.py
Wuzzuf
cd wuzzuf
python3 app/main.py
JobZilla
cd jobzilla
python3 app/main.py

The client services

Feeds service

This is the service responsible for getting the job feed from each site.

cd feeds
python3 app/main.py
Sources

This service is responsible for getting the Job sources that the user follows

cd sources
python3 app/main.py
Manager
cd manager
python3 app/main.py

Building Docker images

If you are using Docker without Kubernetes, you can use docker-compose to orchestrate the containers on a single node. Docker-compose is not covered in this lab. You will need to build the Docker images in any order of your choice. But you have to start them in the above order:

docker_id="your_docker_id"
for d in *; do
    docker build -t $docker_id/$d .
    docker push $docker_id/$d 
done

Deploying to Kubernetes

You can deploy this application to any Kubernetes cluster. Just make sure you change the Docker image id in each deployment file if you don't want to use the one hosted in Magalix You need to apply the deployments as follows:

cd k8s/deployments
kubectl apply -f linkedin.yml
kubectl apply -f jobzilla.yml
kubectl apply -f wuzzuf.yml
kubectl apply -f feeds.yml
kubectl apply -f sources.yml
kubectl apply -f manager.yml

Usage

If you are deploying it to your local machine (no Kubernetes), you can use any HTTP client to request http://localhost If you are using Kubernetes on one of the cloud providers, you can issue the request to http://node_ip:32001 Just make sure that port 32001 is open on the firewall

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.