<?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: Maxwell ADANZOUNNON</title>
    <description>The latest articles on DEV Community by Maxwell ADANZOUNNON (@maxwelladn).</description>
    <link>https://dev.to/maxwelladn</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%2F216006%2Fde715ed9-622d-4714-ae75-e90c9fc2d93c.jpeg</url>
      <title>DEV Community: Maxwell ADANZOUNNON</title>
      <link>https://dev.to/maxwelladn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maxwelladn"/>
    <language>en</language>
    <item>
      <title>Build a PDF invoice template using only typescript and jspdf-autotable | No screen capture</title>
      <dc:creator>Maxwell ADANZOUNNON</dc:creator>
      <pubDate>Tue, 22 Feb 2022 08:26:13 +0000</pubDate>
      <link>https://dev.to/maxwelladn/build-a-pdf-invoice-template-using-only-typescript-and-jspdf-autotable-25gn</link>
      <guid>https://dev.to/maxwelladn/build-a-pdf-invoice-template-using-only-typescript-and-jspdf-autotable-25gn</guid>
      <description>&lt;p&gt;This is how i manage to create an pdf invoice template using only typescript and jspdf-autotable in my Accounting &amp;amp; billing software.&lt;/p&gt;

&lt;p&gt;The reason why i’m creating this tutorial is that i was not able to find anywhere a real tutorial that meet my needs a this time and i struggle a lot to come with this technique that use only table to create pdf without screen capture method.&lt;br&gt;
So maybe this can help.&lt;/p&gt;

&lt;p&gt;I wanted users to be able to select and copy the invoice content. The content is also render well using this way instead of screen capture.&lt;/p&gt;

&lt;p&gt;Start by importing these librairies&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install jspdf jspdf-autotable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// app.component.ts
import { Component } from '@angular/core';
import jsPDF from 'jspdf';
import autoTable from 'jspdf-autotable';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {

  public downloadInvoice(){

    const doc = new jsPDF();

    autoTable(doc, {
      body: [
        [
          {
            content: 'Company brand',
            styles: {
              halign: 'left',
              fontSize: 20,
              textColor: '#ffffff'
            }
          },
          {
            content: 'Invoice',
            styles: {
              halign: 'right',
              fontSize: 20,
              textColor: '#ffffff'
            }
          }
        ],
      ],
      theme: 'plain',
      styles: {
        fillColor: '#3366ff'
      }
    });

    autoTable(doc, {
      body: [
        [
          {
            content: 'Reference: #INV0001'
            +'\nDate: 2022-01-27'
            +'\nInvoice number: 123456',
            styles: {
              halign: 'right'
            }
          }
        ],
      ],
      theme: 'plain'
    });

    autoTable(doc, {
      body: [
        [
          {
            content: 'Billed to:'
            +'\nJohn Doe'
            +'\nBilling Address line 1'
            +'\nBilling Address line 2'
            +'\nZip code - City'
            +'\nCountry',
            styles: {
              halign: 'left'
            }
          },
          {
            content: 'Shipping address:'
            +'\nJohn Doe'
            +'\nShipping Address line 1'
            +'\nShipping Address line 2'
            +'\nZip code - City'
            +'\nCountry',
            styles: {
              halign: 'left'
            }
          },
          {
            content: 'From:'
            +'\nCompany name'
            +'\nShipping Address line 1'
            +'\nShipping Address line 2'
            +'\nZip code - City'
            +'\nCountry',
            styles: {
              halign: 'right'
            }
          }
        ],
      ],
      theme: 'plain'
    });

    autoTable(doc, {
      body: [
        [
          {
            content: 'Amount due:',
            styles: {
              halign:'right',
              fontSize: 14
            }
          }
        ],
        [
          {
            content: '$4000',
            styles: {
              halign:'right',
              fontSize: 20,
              textColor: '#3366ff'
            }
          }
        ],
        [
          {
            content: 'Due date: 2022-02-01',
            styles: {
              halign:'right'
            }
          }
        ]
      ],
      theme: 'plain'
    });

    autoTable(doc, {
      body: [
        [
          {
            content: 'Products &amp;amp; Services',
            styles: {
              halign:'left',
              fontSize: 14
            }
          }
        ]
      ],
      theme: 'plain'
    });

    autoTable(doc, {
      head: [['Items', 'Category', 'Quantity', 'Price', 'Tax', 'Amount']],
      body: [
        ['Product or service name', 'Category', '2', '$450', '$50', '$1000'],
        ['Product or service name', 'Category', '2', '$450', '$50', '$1000'],
        ['Product or service name', 'Category', '2', '$450', '$50', '$1000'],
        ['Product or service name', 'Category', '2', '$450', '$50', '$1000']
      ],
      theme: 'striped',
      headStyles:{
        fillColor: '#343a40'
      }
    });

    autoTable(doc, {
      body: [
        [
          {
            content: 'Subtotal:',
            styles:{
              halign:'right'
            }
          },
          {
            content: '$3600',
            styles:{
              halign:'right'
            }
          },
        ],
        [
          {
            content: 'Total tax:',
            styles:{
              halign:'right'
            }
          },
          {
            content: '$400',
            styles:{
              halign:'right'
            }
          },
        ],
        [
          {
            content: 'Total amount:',
            styles:{
              halign:'right'
            }
          },
          {
            content: '$4000',
            styles:{
              halign:'right'
            }
          },
        ],
      ],
      theme: 'plain'
    });

    autoTable(doc, {
      body: [
        [
          {
            content: 'Terms &amp;amp; notes',
            styles: {
              halign: 'left',
              fontSize: 14
            }
          }
        ],
        [
          {
            content: 'orem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitia'
            +'molestiae quas vel sint commodi repudiandae consequuntur voluptatum laborum'
            +'numquam blanditiis harum quisquam eius sed odit fugiat iusto fuga praesentium',
            styles: {
              halign: 'left'
            }
          }
        ],
      ],
      theme: "plain"
    });

    autoTable(doc, {
      body: [
        [
          {
            content: 'This is a centered footer',
            styles: {
              halign: 'center'
            }
          }
        ]
      ],
      theme: "plain"
    });

    return doc.save("invoice");

  }

}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//app.component.html
&amp;lt;button (click)="downloadInvoice()"&amp;gt;Download invoice&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is also a step by step video tutorial on how i build the PDF&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/QprgMLxUPTU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Good look!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>pdf</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Deploy .net core and angular in less than 5min. No vps setup</title>
      <dc:creator>Maxwell ADANZOUNNON</dc:creator>
      <pubDate>Mon, 15 Nov 2021 16:11:52 +0000</pubDate>
      <link>https://dev.to/maxwelladn/deploy-net-core-and-angular-in-less-than-5min-no-vps-setup-3kfe</link>
      <guid>https://dev.to/maxwelladn/deploy-net-core-and-angular-in-less-than-5min-no-vps-setup-3kfe</guid>
      <description>&lt;p&gt;Nowadays, web hosting companies for .net technologies are more and more rare, but with .net core technology, the problem is not getting any better. I have compiled a list of web hosting companies that support .net and .net core that I will share in another post but today I found smarterasp.net a platform that seems old fashioned but simple in approach and not at all expensive with a free plan (I am not sponsored).In less than 5 min I was able to deploy &lt;a href="https://ngxbill.twenty-ninex2.com/"&gt;NGX.BILL&lt;/a&gt; an Angular &amp;amp; .net core application&lt;br&gt;
Here is quickly how I did it&lt;/p&gt;

&lt;p&gt;Go to smarterasp.net and create your account.&lt;br&gt;
If you choose their free plan, you have to activate it on the dashboard by providing the requested info before doing anything &lt;/p&gt;

&lt;p&gt;After activating it, click on this icon to access the control panel &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DGMhmVXp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tfjhys2lcsjuuak475vz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DGMhmVXp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tfjhys2lcsjuuak475vz.png" alt="Image description" width="370" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the left you have your FTP connection information &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JDkaKGYe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fd0n7tejy2wpffjcvgvz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JDkaKGYe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fd0n7tejy2wpffjcvgvz.png" alt="Image description" width="334" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create the database&lt;/strong&gt;&lt;br&gt;
Click on database then mssql to create a new SQL Server database &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GDeRgAvM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z3i8uncf8ya5houdo8sd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GDeRgAvM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z3i8uncf8ya5houdo8sd.png" alt="Image description" width="735" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Get the connection string&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ur69xPXC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qp7e3mcky8wimzq9l9p0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ur69xPXC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qp7e3mcky8wimzq9l9p0.png" alt="Image description" width="159" height="56"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install dotnet core 3.1 in your local machine: &lt;a href="https://dotnet.microsoft.com/download/dotnet/3.1"&gt;Download .net core 3.1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use connection string provided in your appsettings.json (take into account your own project) to update the database in order to create the database with tables and default data.&lt;/p&gt;

&lt;p&gt;Open a command prompt in the api root folder and navigate to your api project root&lt;/p&gt;

&lt;p&gt;If you have a entity framework migrations execute them. this will create database, generate tables and default data inside the database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet ef database update 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the command below to create the deployment release&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet publish --configuration Release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You release will be at this path : your_dotnet_core_project\bin\Release\netcoreapp3.1\publish&lt;/p&gt;

&lt;p&gt;In your_angular_project/src/environments/environment.prod.ts replace the value of with what will be your domain url&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiHost: 'http://yourdomain.com/api',
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download an install in your local machine the latest node.js: &lt;a href="https://nodejs.org/en/download/"&gt;Link&lt;/a&gt;&lt;br&gt;
After nodejs installation, run the command below to install angular cli locally in your machine&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g @angular/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to the angular root project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the installation completed, In the same path, run the command below to generate the release&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will generate the release at this path: you_angular_project\dist\your_angular_project\&lt;/p&gt;

&lt;p&gt;Use an FTP File transfert client or download WinSCP to connect to the server: &lt;a href="https://winscp.net/eng/download.php"&gt;https://winscp.net/eng/download.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upload the content of your api your_dotnet_core_project\bin\Release\netcoreapp3.1\publish  to the server and then the content of the client in the dist folder inside the wwwroot folder of your api on the server. &lt;/p&gt;

&lt;p&gt;That's all. Use the url provided to test your site then connect your domain name.&lt;/p&gt;

&lt;p&gt;Hope this will help! &lt;/p&gt;

&lt;p&gt;For more see: &lt;a href="http://blog.twenty-ninex2.com/"&gt;http://blog.twenty-ninex2.com/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Deploying .net core, angular and sql server to ubuntu</title>
      <dc:creator>Maxwell ADANZOUNNON</dc:creator>
      <pubDate>Fri, 12 Nov 2021 14:31:16 +0000</pubDate>
      <link>https://dev.to/maxwelladn/deploying-net-core-angular-and-sql-server-to-ubuntu-2a6h</link>
      <guid>https://dev.to/maxwelladn/deploying-net-core-angular-and-sql-server-to-ubuntu-2a6h</guid>
      <description>&lt;p&gt;In this article I will share with you how I deploy &lt;a href="https://ngxbill.twenty-ninex2.com/"&gt;NGX.BILL&lt;/a&gt; a .net core/SQL Server and angular application to ubuntu using nginx&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;:  &lt;em&gt;You must have an Ubuntu 16.04, 18.04, or 20.04 machine with at least 2 GB of memory.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Create your own private server and choose ubuntu  16.04, 18.04, or 20.04&lt;br&gt;
You can use this &lt;a href="https://bit.ly/3FjylD7"&gt;link&lt;/a&gt; to get a free credit with digital ocean to start&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Connect to the same server as the database using an ssh client.&lt;br&gt;
Example of ssh client: &lt;a href="https://www.putty.org/"&gt;Putty&lt;/a&gt; &lt;/p&gt;
&lt;h1&gt;
  
  
  Create a new user
&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;adduser USER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Changing the user information for USER
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Give admin rights to the user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;usermod -a -G sudo USER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the ssh key the new user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp -r ~/.ssh /home/USER/
sudo chown -R USER:USER /home/USER/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart the SSH service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service ssh restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exit the server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Login again as the new user&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/ssh USER@YOUR_IP_ADDRESS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type "Enter" for the passphrase&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter passphrase for key 'C:\Users\USER/.ssh/id_rsa':
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Install SQL Server
&lt;/h1&gt;

&lt;p&gt;Import the public repository GPG keys.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Register the Microsoft SQL Server Ubuntu repository for SQL Server 2019.&lt;br&gt;
For Ubuntu 16.04:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Ubuntu 18.04:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Ubuntu 20.04:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install SQL Server&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install -y mssql-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the package installation finishes, run mssql-conf setup and follow the prompts to set the SA password and choose your edition.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo /opt/mssql/bin/mssql-conf setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Make sure to specify a strong password for the SA account and keep this information somewhere for later&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once the configuration is done, verify that the service is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl status mssql-server --no-pager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install the SQL Server command-line tools&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use the following steps to install SQL Server command-line tools (mssql-tools)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update 
sudo apt install curl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Import the public repository GPG keys.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Ubuntu 16.04:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Ubuntu 18.04:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Ubuntu 20.04:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update the sources list and run the installation command with the unixODBC developer package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update sudo apt-get install mssql-tools unixodbc-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Optional&lt;/strong&gt;: Add /opt/mssql-tools/bin/ to your PATH environment variable in a bash shell.&lt;br&gt;
To make sqlcmd/bcp accessible from the bash shell for login sessions, modify your PATH in the ~/.bash_profile file with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo 'export PATH="$PATH:/opt/mssql-tools/bin"' &amp;gt;&amp;gt; ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make sqlcmd/bcp accessible from the bash shell for interactive/non-login sessions, modify the PATH in the ~/.bashrc file with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo 'export PATH="$PATH:/opt/mssql-tools/bin"' &amp;gt;&amp;gt; ~/.bashrc
source ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Connect to the SQL Server instance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following steps use sqlcmd to locally connect to your new SQL Server instance.&lt;/p&gt;

&lt;p&gt;Run sqlcmd with parameters for your SQL Server name (-S), the user name (-U), and the password (-P). In this tutorial, you are connecting locally, so the server name is localhost. The user name is SA and the password is the one you provided for the SA account during setup.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sqlcmd -S localhost -U SA -P '&amp;lt;YourPassword&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To exit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;QUIT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Tip: You can omit the password on the command line to be prompted to enter it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tip: If you later decide to connect remotely, specify the machine name or IP address for the -S parameter, and make sure port 1433 is open on your firewall&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Install .net core
&lt;/h1&gt;

&lt;p&gt;Install the Microsoft package sources&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install the .NET 3.1 SDK&lt;/strong&gt;: take into account your own version&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-3.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check that dotnet is correctly installed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet --info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Upload the release
&lt;/h1&gt;

&lt;p&gt;Install dotnet core 3.1 in your local machine: &lt;a href="https://dotnet.microsoft.com/download/dotnet/3.1"&gt;Download .net core 3.1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make the connection string in your appsettings.json (take into account your own project) to update the database in order to create the database with tables and default data. Use the IP Address of the server because early with set it up to host the database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"LocalConnectionString":"Server=YOUR_IP_ADDRESS;Database=database;Uid=user;Pwd=your_password"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open a command prompt in the api root folder and navigate to your api project root&lt;/p&gt;

&lt;p&gt;If you have a entity framework migrations execute them. this will create database, generate tables and default data inside the database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet ef database update 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the migration update success, update again the connection string and replace only the IP Address with "localhost"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"LocalConnectionString":"Server=localhost;Database=database;Uid=user;Pwd=your_password"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the command below to create the deployment release&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet publish --configuration Release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You release will be at this path : your_dotnet_core_project\bin\Release\netcoreapp3.1\publish&lt;/p&gt;

&lt;p&gt;In your_angular_project/src/environments/environment.prod.ts replace the value of with what will be your domain url&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiHost: 'http://yourdomain.com/api',
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download an install in your local machine the latest node.js: &lt;a href="https://nodejs.org/en/download/"&gt;Link&lt;/a&gt;&lt;br&gt;
After nodejs installation, run the command below to install angular cli locally in your machine&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g @angular/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to the angular root project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the installation completed, In the same path, run the command below to generate the release&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will generate the release at this path: you_angular_project\dist\your_angular_project\&lt;/p&gt;

&lt;p&gt;Create /var/www/ directory in the server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir /var/www/
sudo chown -R &amp;lt;&amp;lt;user&amp;gt;&amp;gt;:www-data /var/www/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use an FTP File transfert client or download WinSCP: &lt;a href="https://winscp.net/eng/download.php"&gt;https://winscp.net/eng/download.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Connect to the server using your IP Address and user credentials&lt;/p&gt;

&lt;p&gt;Upload the content of your api your_dotnet_core_project\bin\Release\netcoreapp3.1\publish  to the server: /var/www/ and then the content of the client the dist folder inside the wwwroot folder of your api on the server. &lt;/p&gt;

&lt;h1&gt;
  
  
  Install NGINX on the server
&lt;/h1&gt;

&lt;p&gt;Install nginx&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start nginx service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service nginx start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enter the IP address  in your browser to see nginx welcome page&lt;br&gt;
SSL Certificate for your domain name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx 
sudo certbot --nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit the site config to forward request to the app&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/nginx/sites-available/default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the old content with following content&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    server_name   _;
    location / {
       root /var/www/wwwroot;
       index index.html;
       #try_files $uri $uri/ /index.html;
       }
    location /api/{
       proxy_pass http://localhost:5000/api/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection keep-alive;
       proxy_set_header Host $host;
       proxy_cache_bypass $http_upgrade;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       }
       error_log /var/www/error.log warn;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable the site config&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run command below to edit nginx.conf&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/nginx/nginx.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Include site config to nginx.conf&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http{    
    ...    
    include /etc/nginx/sites-available/default;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart nginx&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service nginx restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the server navigate to www folder&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/www
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the project for test&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet your_project-api.dll
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type in your browser your IP address to see the app and after type ctrl + c to stop the app running &lt;/p&gt;

&lt;h1&gt;
  
  
  The web app service
&lt;/h1&gt;

&lt;p&gt;Create the service file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/systemd/system/app_name.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fill the service infos&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description=Service description

[Service]
WorkingDirectory=/var/www
ExecStart=/usr/bin/dotnet /var/www/your_project_api.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=app_name
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gill full right to the folder&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R www-data:www-data /var/www/
sudo setfacl -R -d -m u:www-data:rwx,g:www-data:rwx,o::r /var/www/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service app_name start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check if service is running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service app_name status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the web app is running. No need to run the app with dotnet command to access it. &lt;/p&gt;

&lt;p&gt;Hope this will help! &lt;/p&gt;

&lt;p&gt;For more see: &lt;a href="http://blog.twenty-ninex2.com/"&gt;http://blog.twenty-ninex2.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>dotnet</category>
      <category>angular</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
