TypeScript for Backend


Seiji Villafranca
developing Rest APIs using Nest Js
Seiji Villafranca
github.com/SeijiV13


Technical Lead, Frontier Software Asia Philippines
Trainer, RakSquad
Auth0 Ambassador
Community Lead, AngularPH,

seijivillafranca.com
Talks















Typescript and Nest


Let me tell you some JavaScript First

JavaScript?
Programming Language for the Web
Makes Web Pages Interactive

Can Validate Data
Without it, Pages our just Pages!
Well... Javascript is basically for Interacting with the UI
A little about History
Developed in 10 Days
Brendan Eich, September 1995
Mocha
LiveScript
JavaScript
JavaScript Vs. Java
Don't be confused they are not related to each other!

JavaScript is called JavaScript for marketing strategies
Some Facts!
Where is JavaScript Today?

Refrence: https://codeburst.io/javascript-trends-in-2020-b194bebc5ef8

Companies that uses JavaScript

Uses NodeJS on Azure Cloud Platform
Internet of Things (IoT)
Microsoft
Companies that uses JavaScript
Front End is Pure JavaScript
Developed KrakenJS (own version of express)


Companies that uses JavaScript
Gmail Web Client, Google Docs
Has own JS Framework AngularJS, Angular
Developed V8 for Chrome which is the heart of Node JS










Seeing JavaScript for the first time

Superset Languages
Prototypes
Dynamic Types

TypeScript
Generics
Interfaces
ES6
Types
A sample code here

class Student {
fullName: string;
constructor(public firstName: string, public middleInitial: string,
public lastName: string) {
this.fullName = firstName + " " + middleInitial + " " + lastName;
}
}
interface Person {
firstName: string;
lastName: string;
}
let user = new Student("Jane", "A", "Doe");Transpiler that provides JS the features of typing,


Object Oriented Programming
Catches Error and provides fixes before running code

Transpiler
Target: ES6/ES5

Browsers don't understand Typescript
Now on 4.2

Community

https://www.typescriptlang.org/community
Famous Frameworks /Libraries





Hybrid Frameworks


Mobile Apps



Desktop Apps

An open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine


Backend
has the capability to create Rest APIs and GraphQL and connect with databases
What in the world is RESTful APIs???



Node.js Backend
Client calls an endpoint
node gets data from database
Node sends back to client
Node retrieves data
Advantages of Creating Rest APIs in Node
Cost-effective
High-performance
Easy to Learn
Building Cross-Platform Applications
Different frameworks are created for node to introduce standards and improve maintainability



Back End Node Framework
Typescript Based
Shares many concepts with Angular that's why its called the perfect match

https://nestjs.com/

Module
Controllers
Providers
use of to organize the application structure.
responsible for handling incoming requests and returning responses
it can inject dependencies; this means objects can create various relationships with each other

Title Text



Flow
Prerequisites
npm install –g @nest/cli
https://nodejs.org/en/
Check npm verision
Check npm verision
npm -v
nest --version
Good to go?
Install Nest CLI
Install Node JS

Create a new Nest JS Project
nest new <project-name>
Let's Walk the Talk

Typescript fo Backend, developing Rest Apis using Nest Js
By Seiji Ralph Villafranca
Typescript fo Backend, developing Rest Apis using Nest Js
- 103