# Hands-on introduction to Phoesion Glow

Are you tired of struggling with complex micro-service architectures that slow deployment processes? If you're a developer looking for a streamlined, efficient solution for building and deploying dotnet microservices, look no further than **Phoesion Glow**.

**Phoesion Glow** is a cutting-edge microservice development framework that offers a complete solution for creating, deploying, and managing microservices. Designed with simplicity and efficiency in mind, **Phoesion Glow** is the perfect tool for developers of all skill levels who want to create high-performance, scalable applications.

One of the key features of **Phoesion Glow** is its intuitive interface, which simplifies the creation and deployment of microservices. With just a few clicks, you can create and deploy complex microservices. In addition, **Phoesion Glow** offers native support for Kubernetes, a powerful open-source container orchestration platform that enables you to scale and manage your microservices with ease. With **Phoesion Glow**, you can take advantage of the power and flexibility of Kubernetes, without the need for complex configuration or setup.

In this article, we will focus on the simplest deployment model using **Phoesion Glow**, which is using just one **Linux Virtual Machine (VM)** and setup **Phoesion Glow** as a **systemd** service.

# Prerequisites

1. A Windows machine with Visual Studio 2019/2022
    
2. [Phoesion Glow Blaze for Windows](xref:Downloads_Blaze.md) installed
    
3. A Linux (Ubuntu) machine *(that will host our services)*
    
4. A domain name\*
    

> \[NOTE\] If you do not have a domain registered you can either use the server's IP, edit your hosts file, or create a free domain using [Duck DNS (www.duckdns.org)](https://www.duckdns.org/) for testing

# Video Tutorial

%[https://www.youtube.com/watch?v=XQ-YWIoImHk] 

# Creating a **Hello-World** service

## 1\. Create a new Solution

Create a new solution using **Visual Studio** with a **Firefly Service Project** project.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676985442532/7feba767-b292-44ce-83dc-638538f2bf04.png align="center")

> \[NOTE\] If you can't find the **Firefly Service Project** template, make sure you have **Phoesion Glow Templates** visual studio extension installed. If not you can [get it from the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Phoesion.phoesion-glow-vstemplates)

## 2\. Configure new Project

Name your new project and solution :

```plaintext
Project name : Foompany.Services.HelloWorld
Location : <Set your location>
Solution name : Foompany.Services
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676985458770/c9404049-8af3-4452-9ea2-4f13ac355c82.png align="center")

## 3\. Create a **Firefly Module**

Now we need to create a firefly module with an action.

In the folder **Modules**, delete the **Sample.cs** that was generated by the template and create a new module named **Greeter.cs** like so

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676985468548/b0922607-651e-4b39-a825-9de3bcd9521c.png align="center")

## 4\. Create an **Action**

In the new **Greeter.cs**, delete the **Action1** function that was created by the template and add the following :

```cs
[Action(Methods.GET)]
public string SayHello()
{
    return "Hello world!";
}
```

**Rebuild the solution** and make sure everything **compiles without any errors**

## 5\. Test/Debug your service locally

To start your service simply set it a **Startup Project** in Visual Studio and press **F5**. Wait until you see the **Service Started!** message, then you can test it by opening a browser and going to

* [http://localhost:16000/HelloWorld/Greeter/SayHello](http://localhost:16000/HelloWorld/Greeter/SayHello)
    

You should see a "Hello World" message in your browser.

# Create a **Phoesion Glow Project**

Next, we need to create a new **Phoesion Glow Project**.  
A glow project is a JSON that contains the services' configuration and file locations.

* To create a new project start the app **Phoesion Glow Project Editor** from your windows start menu or desktop.
    
* Click **New Project**
    
* Save the new project in the **same folder as your solution**, with the name **GlowProject**
    
* Now that the new project has been created, you need to configure the services.
    
    1. Set for Namespace : **Foompany.Services**.
        
    2. Click the **Add** button in the **Services** section.
        
    3. Select your c# service project file (*Foompany.Services.HelloWorld.csproj*).
        
    4. Click save and close the project editor.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676985589713/fd959f44-e90d-42dd-9adc-1c9be7f88965.png align="center")
        

# Setup the **Linux Server**

## Installing cloud entities on Ubuntu

In this section, you will install and setup the components needed to create a full micro-service ecosystem on a Linux machine.

#### 1\. Install the Repository key

```bash
wget -qO - https://packages.phoesion.com/apt.key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/phoesion.gpg
```

#### 2\. Add Repository

```bash
echo "deb [signed-by=/usr/share/keyrings/phoesion.gpg] https://packages.phoesion.com/phoesion.glow linux main" | sudo tee /etc/apt/sources.list.d/phoesion.glow-main.list
sudo apt-get update
```

#### 3\. Install cloud entities packages :

```bash
sudo apt-get install -y phoesion.glow.kaleidoscope
sudo apt-get install -y phoesion.glow.lighthouse
sudo apt-get install -y phoesion.glow.prism
sudo apt-get install -y phoesion.glow.firefly
```

> \[NOTE\]  
> Services will be installed under a new service user with username the entity name (eg. firefly), so you can adjust the rights for each entity service as you wish
> 
> Phoesion Glow **Lighthouse** default port is **15000**, so make sure your developers can reach this port!

## Create an administrator account for Lighthouse

To be able to remotely connect to the Lighthouse you need to create an admin account. You can do this using the lighthouse-cli tool.

#### 1\. Start lighthouse-cli

```bash
lighthouse-cli
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676985913892/48fabc2a-09bd-4f9b-9e9f-f955f7985ce5.png align="center")

#### 2\. Create a new administrator user

```bash
user add admin
```

#### 3\. Setup new administrator user

Enter the information for admin user

```plaintext
Password : YOUR_PASSWORD
Re-enter password : YOUR_PASSWORD
Role : 1
Name (optional) : Administrator
Email (optional) : myemail@myprovider.com
Description (optional) : My Administrator Account

Leave Allowed IP empty, so you can login to the admin account remotely
```

> \[!WARNING\] Make sure for **Role** you enter is for an **Administrator** . Otherwise you will create a normal user with limited capabilities

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676985933809/dbe8fbe8-ee3d-490f-b366-720b867efbf7.png align="center")

# Deploy to the Phoesion Glow Lighthouse.

To deploy our services we need to connect from our dev-machine **Phoesion Glow Blaze** *(Windows)* to the **Lighthouse** that is now running on the server-machine *(Linux)*. After we connect we can setup the environment and deploy our services.

## 1\. Create a **Lighthouse** connection profile

To create a connection profile in **Blaze** for the *admin* **Lighthouse account** :

1. Launch the **Phoesion Glow Blaze** app from the start menu.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676986425489/48217996-4d3c-41a7-9a64-6c80052ceae5.png align="center")
    
2. Create a new lighthouse connection profile
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676986449512/fdcf1e1f-56df-45d2-a3c4-59b99edcdea2.png align="center")
    
3. * Fill in the configuration page
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676986374343/8edf6685-316f-48d3-b071-b555338c510e.png align="center")
        
        ```plaintext
        Connection Name : My Linux Server
        Hostname : [YOUR_SERVER_IP]
        Username : admin
        For Authentication Method select Password
        Password : [YOUR_PASSWORD]
        For Security Method select RSA/AES
        ```
        
        > \[NOTE\] Replace **\[YOUR\_SERVER\_IP\]** and **\[YOUR\_PASSWORD\]** with your own values
        
    * Click the **Get** button to retrieve the public RSA key from the lighthouse.
        
    * Click **Save**
        
4. The new connection profile has been saved and is now available on the main screen. Click on it to connect to your **Lighthouse instance**.
    

## 2\. Create a new Quantum Space

Your cloud can run more than one set of services.  
Think of a **Quantum Space** as an isolated box that contains a set of micro-services and spans across your cloud servers.  
For more in-depth info you can [read about Quantum Spaces here.](https://glow-docs.phoesion.com)

#### 2.1 Create a new **Quantum Space**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676986488702/59cae192-4679-4611-b7de-6193282e73a5.png align="center")

#### 2.2 Setup new **Quantum Space**

We will create a new quantum space named 'Testing' and we will bind the domain 'localhost' *(since we are testing on the local machine)* to it.  
*(if 'localhost' is used by another qSpace, you can use 127.0.0.2 (see notes))*

```plaintext
Quantum Space Name : Testing
Add Domain
Domain : localhost
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676986506432/9e0332b4-8dee-4c9c-878e-e11517d8852d.png align="center")

> Replace **\[my\_domain\]** with your domain, eg. services.mycompany.com

#### 2.3 Verify and create

Verify the information of your new Quantum Space and click 'Create' to create it.

#### 2.4 Open the new Quantum Space

Once the new Quantum Space is created, you will be able to see it in the list. Click on it to open it.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676986630312/9955d85c-fe7e-421a-8209-d0b06a0d881c.png align="center")

## 3\. Deploy 'Hello World' Sample Services

Now we are ready to deploy the sample in the 'Testing' quantum space.

#### 3.1 Start deploy wizard

Click the 'Deploy' button to start the deployment wizard.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676986640938/3ed4a296-7b9f-46fa-aba4-a83ff4d9d263.png align="center")

#### 3.2 Start deploy wizard

* For *Project* select the **project.pgproject** file from the sample.
    
* Set the *Build* to **Debug** or *Release*.
    
* Click 'Next'
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676986648990/88eaa87a-1218-4f74-9ac7-1c1841236f02.png align="center")
    

#### 3.3 Deploy services

Once the project is compiled into a *hologram*, it can be deployed to the Lighthouse.  
Click the 'Start Deploy' button to start the deployment.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676986658494/0a9f2f5c-bf50-4805-92e9-7d92e621a481.png align="center")

# Test your services

To test that your services are up and running open a browser and go to one of the following :

* [http://my\_domain/HelloWorld/Greeter](http://my_domain/HelloWorld/Greeter)
    
* [http://my\_domain/HelloWorld/Greeter/SayHello](http://my_domain/HelloWorld/Greeter/SayHello)
    
    *( where* `my_domain` is your real domain )
    

# Summary

In this article, we demonstrated how easy it is to setup a scalable, micro-service deployment platform on your server and create/deploy a new micro-service.

With this setup now in place, creating more micro-services and deploying them into our **Quantum-Space** can be achieved with a few clicks. Using the **Phoesion Glow Blaze** GUI tool we can monitor the health of our services and view logs or other incidents.

**Phoesion Glow** isn't just about ease of use - it's also a powerful, flexible platform that can handle even the most complex applications. With support for a wide range of frameworks and technologies, **Phoesion Glow** is the perfect tool for building any type of micro-service, from small, focused initiatives to large-scale, mission-critical applications. It offers robust monitoring and reporting capabilities, giving you complete visibility into the performance and health of your applications. With detailed metrics and alerts, you can quickly identify and resolve any issues that arise, ensuring that your microservices are always performing at their best.

In conclusion, if you're a developer looking for a powerful, flexible, and easy-to-use solution for building and deploying microservices, **Phoesion Glow** is the perfect tool for you. With its intuitive interface, native support for Kubernetes, and robust monitoring and reporting capabilities, **Phoesion Glow** makes it easy to build high-performance, scalable microservices, no matter what your level of experience may be.

This was the first step of our cloud-service development journey!  
For more information, you can dive into the [documentation](https://glow-docs.phoesion.com/) and [sample repo](https://github.com/Phoesion/Glow-Samples).
