• This repository has been archived on 02/Jun/2023
  • Stars
    star
    143
  • Rank 249,690 (Top 6 %)
  • Language
    JavaScript
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A photo-sharing app built by NGINX and implemented using the Fabric Model from the Microservices Reference Architecture.

Project Status: Abandoned – Initial development has started, but there has not yet been a stable, usable release; the project has been abandoned and the author(s) do not intend on continuing development.

This repository has been archived. There will likely be no further development on the project and security vulnerabilities may be unaddressed.

Ingenious

Ingenious is a photo-sharing demo app created by NGINX to show the Fabric Model approach to application development. The app is designed to allow the user to login to a personalized account, and then store, view and delete their own pictures. It also includes a blog in which users can view the latest news and updates within the application.

Fabric Model from Microservices Reference Architecture

The Ingenious application is built with microservices and utilizes their inherent benefits to generate a robust, stable, independent, polyglot environment.

Specifically, the app is designed using the Fabric Model - the most sophisticated architecture in the MRA - to configure its services. Included in this configuration is an instance of NGINX running in every docker container. This allows for increased security without the typical decreased speed of communication between services. After an initial TLS/SSL handshake, a connection is then established and is able to be reused without any further overhead.

The Fabric Model suggests a new method of application development. Because NGINX Plus is running on both ends of every connection, capabilities of each service become a function of the app's network rather than capabilities of specific services or servers. NGINX Plus allows this network to be persistent, fast, and stable.

Microservice Reference Architecture diagram of services

The Ingenious application employs seven different services in order to create its functionality.

Pages is the foundational service built in PHP upon which the other services provide functionality. Pages makes calls directly to User Manager, Album Manager, Content Service, and Uploader.

User Manager is built completely using Python and backed by DynamoDB. It's use is to store and modify user information, allowing the app a login system. Login is done with Google and Facebook through OAuth, but also includes a system for local login when testing the system.

Album Manager is built using Ruby and backed by MySQL, and allows the user to upload albums of multiple images at once. Album Manager makes calls to the Uploader service and therefore the Resizer to upload and modify images specified by the user.

The Uploader service is built using Javascript and is used to upload images to an S3 bucket. Uploader then makes calls to the Resizer service with the previously generated id of the image within S3, and Resizer then makes copies of the image with size "Large", "Medium", and "Thumbnail".

Content Service is built in Go and backed by RethinkDB. The Content Service provides, retrieves, and displays content for the NGINX Ingenious application

Auth Proxy is a Python app that utilizes Redis' capabilities as a caching server. Making direct connections to both Pages and User Manager, Auth Proxy is used to validate the user's identity. It also serves as the gateway into the application, acting as the only public-facing service within the application.

Prerequisites

There are a few prerequisites that you need for your development environment

  • git
    • Notes for Windows users:

      • There are bash scripts that are executed by the CMD instruction in the Dockerfile. In order for these scripts to run, the core.autocrlf must be set to input so that the line endings are preserved. The command to set this configuration is:

      git config core.autocrlf input

      • Docker for Windows must be configured to share the drive, per the discussion here
  • docker
    • Note for Linux users:

      • The docker-compose file for this repository uses version 3, which requires docker engine 1.13/17.04 or higher, and the docker engine that is installed with Ubuntu 16.04, the version that we used for testing. The appropriate version of docker-compose can be installed with the command below from the docker-compose site:

      sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

      • For more information, check the compatibility matrix here.

Quick start

You can clone all the repositories of the NGINX Ingenious application using the command below:

git clone --recurse-submodules https://github.com/nginxinc/mra-ingenious.git

Once the repositories are cloned, be sure that you have the latest versions of the submodules by running:

git pull

There are detailed instructions for building the service below, and in order to get started quickly, you can follow these simple instructions to quickly build the image.

  1. (Optional) If you don't already have an NGINX Plus license, you can request a temporary developer license here. If you do have a license, then skip to the next step.
  2. Copy your licenses to the //nginx/ssl directory for all the services
  3. Modify your hosts file to include fake-s3. It should look like:
    127.0.0.1   fake-s3
    
  4. Go to the mra-ingenious directory and run the command docker-compose up.

At this point, you will have the Ingenious application running locally. You can access it in your browser with the url https://localhost/.

To build customized images for the different services or to set other options, please check the specific README for each service.

Three docker compose files are included with this service:

Makefile

A Makefile has been included in the project to make the process of building and running Ingenious as easy as possible. You can run make <action> to perform an action in a simple way.

Action Description
build Builds the Ingenious Docker images with NGINX Plus
build-oss Builds the Ingenious Docker images with NGINX OSS
build-clean Builds the Ingenious Docker images with NGINX Plus without using cache
build-clean-oss Builds the Ingenious Docker images with NGINX OSS without using cache
run-local Runs the Ingenious app in a local environment
stop Stop all the Ingenious app containers

Going Forward

We intend to maintain and build on this Microservices Reference Architecture by cleaning up things we may have missed, merging your pull requests, and evolving the application as we build microservices technologies. Other examples of our work with microservices include:

You can also learn more about the NGINX Microservices Network Architectures on our blog:

As described above, the first release of the NGINX Microservices Reference Architecture, Ingenious, is built using the Fabric Model. Our next major release will include instructions for building the MRA using the Router Mesh Model.

In the meantime, we have open sourced simple builds of the Fabric Model and Router Mesh. These repositories are succinct examples of using the Fabric Model and Router Mesh and focus on the NGINX configuration aspect of each.

A Note About Security

tl;dr: The Ingenious application is designed to be a reference architecture and should be run only on a local machine or private server. Do not run in a production environment

From the time that it was ideated, the Ingenious application was designed to be a reference architecture for building microservices-based applications using NGINX as the service mesh to facilitate communication to and among each of the microservices.

As such, our focus has been to develop an application which demonstrates the functionality described above in a simple way. In so doing, the code that we have created has not been tested for use in a production environment.

In fact, we recommend that the Ingenious application be run on a local machine or private server. If you run the application on a publicly available server, you do so at your own risk.

That being said, please have fun learning while you build microservices using NGINX!

More Repositories

1

kubernetes-ingress

NGINX and NGINX Plus Ingress Controllers for Kubernetes
Go
4,540
star
2

docker-nginx

Official NGINX Dockerfiles
Shell
3,076
star
3

nginx-prometheus-exporter

NGINX Prometheus Exporter for NGINX and NGINX Plus
Go
1,441
star
4

NGINX-Demos

NGINX and NGINX Plus demos
HTML
1,232
star
5

nginx-ldap-auth

Example of LDAP authentication using ngx_http_auth_request_module
Python
678
star
6

ngx-rust

Rust binding for NGINX
Rust
673
star
7

kic-reference-architectures

MARA: Modern Application Reference Architecture
Python
625
star
8

crossplane

Quick and reliable way to convert NGINX configurations into JSON and back.
Python
620
star
9

ansible-role-nginx

Ansible role for installing NGINX
Shell
615
star
10

nginmesh

Istio compatible service mesh using NGINX
Go
611
star
11

nginx-s3-gateway

NGINX S3 Caching Gateway
JavaScript
442
star
12

nginx-gateway-fabric

NGINX Gateway Fabric provides an implementation for the Gateway API using NGINX as the data plane.
Go
361
star
13

docker-nginx-unprivileged

Unprivileged NGINX Dockerfiles
Shell
352
star
14

nginx-wiki

ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com
HTML
286
star
15

docker-nginx-amplify

Official NGINX and Amplify Dockerfiles
Shell
230
star
16

nginx-amplify-doc

Public documentation for Amplify
Makefile
201
star
17

nginx-openid-connect

Reference implementation of OpenID Connect integration for NGINX Plus
JavaScript
188
star
18

ansible-role-nginx-config

Ansible role for configuring NGINX
Jinja
144
star
19

rtapi

Real time API latency analyzer - Create a PDF report and HDR histogram of your APIs
Go
133
star
20

nginx-otel

Perl
123
star
21

nginx-service-mesh

A service mesh powered by NGINX Plus to manage container traffic in Kubernetes environments.
Go
93
star
22

nginx-ingress-operator

WARNING - DEPRECATION NOTICE: The NGINX Ingress Operator has been updated to be a Helm based operator. This repo has been deprecated and will soon be archived - the new NGINX Ingress Operator repo can be found at https://github.com/nginxinc/nginx-ingress-helm-operator.
Go
65
star
23

ansible-collection-nginx

Ansible collection for NGINX
63
star
24

nginx-loadbalancer-kubernetes

A Kubernetes Controller to synchronize NGINX+ Resources with Kubernetes Ingress Resources
Go
57
star
25

nginx-asg-sync

NGINX Plus Integration with Cloud Autoscaling
Go
53
star
26

bank-of-sirius

Bank of Sirius
Java
52
star
27

nginx-plus-go-client

A client for NGINX Plus API for Go
Go
47
star
28

helm-charts

NGINX Helm Charts repository
47
star
29

nginx-openshift-router

NGINX and NGINX Plus OpenShift Routers
HTML
42
star
30

nginx-ingress-helm-operator

NGINX Ingress Operator for NGINX and NGINX Plus Ingress Controllers. Based on the Helm chart for NGINX Ingress Controller - https://github.com/nginxinc/helm-charts
Mustache
33
star
31

nginx-go-crossplane

A library for working with NGINX configs in Go
Go
31
star
32

docker-nginx-controller

Docker support for NGINX Controller Agent in Containers
Dockerfile
29
star
33

microservices-march

Examples from the Microservices March lectures and exercises.
26
star
34

nginx-ingress-workshops

Nginx Ingress Controller Hands on Workshops, with Lab Exercises and Guides
Shell
26
star
35

ngx-istio-mixer

NGINX module for Istio mixer
Rust
24
star
36

new-relic-agent

A new relic agent for NGINX Plus metrics
Python
23
star
37

nginx-saml

Perl
19
star
38

router-mesh-architecture

NGINX Router Mesh Network Architecture for Microservices
CSS
19
star
39

ansible-role-nginx-app-protect

Ansible role to install and configure NGINX App Protect (WAF and DoS) for NGINX Plus on your target host
Jinja
17
star
40

aws-ha-elastic-ip

Active-Passive HA Deployment on AWS Using an Elastic IP Address
Shell
17
star
41

website-resources-conf

content for nginx.com/resources/conf/ -- configuration files shared in blog posts, etc.
16
star
42

nginx-plus-dashboard

HTML
15
star
43

fabric-model-architecture

Repository for the NGINX Fabric Model Architecture
CSS
15
star
44

ngxinfo

Python
13
star
45

nginx-management-suite-iac

NMS IAC repo
HCL
12
star
46

Community-Code-of-Conduct

NGINX Open Source Community's Code of Conduct
11
star
47

nginx-amplify-agent

NGINX Amplify Agent
Python
11
star
48

mra-user-manager

User manager
HTML
10
star
49

snarejs

Snare.js
JavaScript
10
star
50

nginx-ns1-gslb

ARCHIVED - NGINX Plus Integration with NS1 GSLB
Go
10
star
51

mra-auth-proxy

Auth proxy for MRA
Jinja
9
star
52

nginx-wrapper

NGINX Event Process Wrapper
Go
9
star
53

ngx-stream-nginmesh-dest

Nginx module to get dest ip and port
C
8
star
54

ansible-role-nginx-unit

Ansible role for NGINX Unit
Jinja
7
star
55

ansible-role-nginx-management-suite

Ansible role for the NGINX Management Suite
Jinja
7
star
56

nginx-for-azure-deploy-action

Github Actions to sync NGINX configs into the NGINX for Azure service.
TypeScript
7
star
57

ebook-managing-kubernetes-nginx

Shell
7
star
58

template-repository

A template repository for new NGINX projects
7
star
59

nginx-unsupported-modules

Container builds of unsupported NGINX modules
Shell
6
star
60

nginx-hugo-theme

A hugo theme for NGINX documentation
CSS
6
star
61

mra-content-service

Go
6
star
62

mra-photouploader

HTML
5
star
63

ansible_collection_nginx_controller

Collection of NGINX Controller Roles for Ansible
5
star
64

mra-photoresizer

HTML
5
star
65

mra-pages

JavaScript
4
star
66

nginx-controller-lab

Shell
4
star
67

.github

4
star
68

mra-album-manager

Ruby
4
star
69

nginxaas-for-azure-snippets

Example ARM templates for common NGINX for Azure use cases
Python
3
star
70

ansible_role_nginx_controller_agent

Ansible role for installing the NGINX Controller agent
Jinja
3
star
71

ansible-role-nginx_controller_application

Jinja
3
star
72

nap-dos-arbitrator-helm-chart

Smarty
3
star
73

nginx-plus-install-tools

NGINX Plus Install tools
Shell
3
star
74

ansible-role-nginx_controller_publish_api

Jinja
2
star
75

kic-test-containers

Docker containers used by the KIC team
Go
2
star
76

ansible-role-nginx_controller_user

Jinja
2
star
77

ansible-role-nginx_controller_environment

Managing environments within NGINX Controller
Jinja
2
star
78

ansible-role-nginx_controller_api_definition_import

Jinja
2
star
79

ansible-role-nginx-controller-gateway

Jinja
2
star
80

ansible-role-nginx_controller_location

Jinja
2
star
81

ansible_role_nginx_controller_install

Ansible role for installing NGINX Controller
Jinja
2
star
82

ansible-role-nginx-controller-certificate

Jinja
2
star
83

ansible-role-nginx-controller-component

Jinja
2
star
84

ansible_role_nginx_controller_generate_token

Jinja
2
star
85

ansible-role-nginx-controller-license

Jinja
2
star
86

ansible-role-nginx_controller_integration

Jinja
2
star
87

nginx-aws-signature

NGINX AWS Signature Library to authenticate AWS services such as S3 and Lambda via NGINX and NGINX Plus.
JavaScript
2
star
88

nginx-basics-workshops

HTML
2
star
89

homebrew-tap

Ruby
1
star
90

ansible-role-nginx_controller_user_role

Jinja
1
star
91

ansible-role-nginx_controller_forwarder

Jinja
1
star