Skip to the content.

Smilr - Microservices Reference Project

Smilr is a multi component application & reference architecure. It has been designed to showcase microservices design patterns & deployment architectures. It consists of a front end single page application (SPA), two lightweight services, supporting database and back end data enrichment functions.

The Smilr app is simple, it allows users to provide feedback on events or sessions they have attended via a simple web & mobile interface. The feedback consists of a rating (scored 1-5) and supporting comments.

The app has been designed to be deployed to Azure, but the flexible nature of the design & chosen technology stack results in a wide range of deployment options and compute scenarios, including:

This application supports a range of demonstration, and learning scenarios, such as:


Table of Contents


Architecture & Core App Components

arch

Logical Components

The app consists of four logical components

Screenshot

screenshot

Getting Started

There are a number of ways to get started with this project depending on your goals. Below are some suggestions and pointers

Repository Structure

This repo contains multiple discreet but loosely dependant code bases. The top levels of the project repository directory tree are laid out as follows

/
├── archive            Older and experimental code archive 
├── azure              Supporting files for Azure deployment etc
│   ├── functionsv2      Azure Functions serverless implementation
│   ├── pipelines        Azure Pipelines for CI/CD
│   └── templates        Example ARM templates
├── docs               Documentation
├── etc                Supporting files, pictures and other artefacts 
├── go                 Work in progress re-write of the main services in Go
│   ├── data-api         Data API in Go
│   └── frontend         Frontend service in Go
├── kubernetes         Docs and files to support deployment to Kubernetes & AKS
│   ├── helm             Helm chart for deploying Smilr with Helm
│   ├── using-ingress    Deployment YAML for use with K8S Ingress
│   └── using-lb         Deployment YAML for use with K8S LoadBalancer
├── mobile             Nativescript + Vue.js mobile client 
├── node               Main microservices, written in Node.js
│   ├── data-api         Data API service source code
│   └── frontend         Frontend service source code
├── scripts            Supporting helper scripts
│   └── demoData         Load the database with demo data
└── vue                The main app frontend, a Vue.js SPA
    ├── src              Source code of Vue.js app
    └── mock-api         Provides a fake API and database for local testing

Stable Core Implementation

The stable & complete version of the Smilr app consists of Node.js implementations of the frontend server & data-api and the Vue.js SPA. There are alternative versions (detailed below) but currently the core of the project is represented this implementation:

:page_with_curl: Vue.js SPA - Documentation

:page_with_curl: Frontend Server - Documentation

:page_with_curl: Data API - Documentation

Notes on Security

As Smilr is commonly used in demos, workshops/labs and for self learning, it defaults to being unsecured and open. This makes it easier to deploy without additional configuration or authentication complications.

Should you want to secure Smilr, typically because you want to have a permanent “live” version hosted and accessible, this is also possible. Securing both single page applications and REST APIs presents some interesting challenges. The approach taken was to use Azure Active Directory v2 for identity, the OAuth2 Implicit Grant flow for authentication and OAuth2 bearer tokens for validation

Fundamentals

These docs covers some of the fundamental aspects of Smilr, which are independent of any particular implementation

:page_with_curl: API Reference & Data Model

:page_with_curl: Database Notes

Runtime Configuration & Settings

The primary configuration mechanism for this project is system environmental variables (or env vars). These env vars are used with the Node.js services, container runtime, Docker tools and helper scripts. This gives a flexible and cross platform way to inject runtime settings, it is also widely supported in Azure (e.g. Azure App Service Settings) and Docker/Kubernetes.

There are numerous ways to set & override environmental variables; in the operating system, the user profile or from command line tools. For local development purposes it is strongly recommended you create & use .env files. These are simple text files containing var=value pairs. Sample files named .env.sample are provided within the project, which you can rename and use. Note. .env files can often contain secrets so they are prevented from being committed to Git

Containers & Kubernetes

As containers and Kubernetes represents such an important build & deployment scenario, they have dedicated guides and documentation

:page_with_curl: Building Smilr as Containers

:page_with_curl: Running and deploying in Kubernetes

Public Images

Pre built images are available on Dockerhub. Using these will naturally mean you can get started deploying/running Smilr without needing to do anything. However building your own is still recommended, especially if you want to understand the build process in more detail.

Images for the Node.js data API and frontend (serving the Vue.js client) are available.

Smilr on Dockerhub 🡽

Deploying to Azure

See provided Azure Resource Manager (ARM) templates to allow you to deploy the complete Smilr app and all components to Azure. As all deployment scenarios are container based you also need to refer to the containers section described above

ARM Deployment Templates

DevOps & CI/CD

Automated CI/CD pipelines have been created using Azure Pipelines. These automatically build the various components as containers and releases them to Azure for testing. The current status of these builds & releases is shown below

Automated Build Status
Linux Images & Tests Build Status
Windows Images & Dockerhub Build Status

You can visit the Azure Devops Public Project where these pipelines reside, although keep in mind the source code repo remains here on GitHub.

DevOps Public Project - Smilr 🡽

If you want to try using Azure DevOps to build Smilr, the pipelines are provided as YAML for your own use. An Azure DevOps account/organisation is required to use these, but can be setup for free.

Sub Projects

There are several sub-projects and re-implementations of the Smilr architecture. Either at the backend, providing an API compatible with the data-api REST specification. Also the frontend has been implemented as a mobile app. All of these alternatives are considered experimental and for technology demo use cases

Changelog

High level project changes and overall history are recorded here: