Basic web technology


Recently, I've made web-app(notebook of words) for myself and found that the web is a very powerful tool. So I want to write down some key factors for making this app.

Framework & Cloud services

In this site, I use framework below
  -frontend: Angular
  -API server: Node.js & Express
  -PaaS: Heroku.com
  -DB server: MongoDB(mlab.com)
  -Authentification: firebase.com

Frontend (Angular) and Backend (Express)  are connected by RESTful API endpoint which I write lately.
I also use the official Node.js driver for connecting MongoDB(mlab.com) instead of using mongoose. Image is below.
I like server-based javascript language. Before a couple of years ago, I didn't know much about javascript but after using Angular, I've been fascinated by this language. I know object-based language through javascript and typescript. I think javascript is not what it was 10 years ago. It is a modern programing language, I think.

I also use VScode & GitHub. 
VScode is lighter than ATOM which I had used to and has powerful add-ons indicating the meaning of syntax of Angular etc so I can code efficiently.
GitHub is also an essential tool for me because I'm coding little by little, fix bugs, improving them, adding some functions. So if I didn't use it, I lost which are right codes. So I often "git push" not to lose my codes.
Chrome browser is also essential for its powerful debugging functions (it is available putting on the F12 button).

Getting back to what I was talking about.
A Framework like Angular, Node.js, Express, MongoDB also cloud services like Heroku, mlab.com firebase is a very powerful tool.
It's amazing that I can use them for free!

RESTful

RESTful is very important idea when we create web services.
It consists of four key factors (details are referred https://restfulapi.net/ )
 - Client-Server
 - Stateless
 - Cacheable
 - Uniform Interface
 - Layered system
 - Code on demand
And I think No2 & 4 are especially key concepts. By the No4 rule, I can reuse server.js' code at another programming.

And also No2 is essential for good coding. I'd used to program with C when around 1990 and I often checked global variables because these are shared by some codes. It is a little complex coding. But adapting the RESTful concept, I don't have to worry about global variables because I don't have to use these. I only ask something to another programing and get an answer, it's a simple solution.


CRUD, NoSQL

The Database is essential for web-services and recently we don't have to own our database server by using mlab.com, firebase, etc.

When I handle database, service.ts does HTTP request of "post" "get" "put" "delete" to server.js (express) and server.js order database cloud (mlab.com) of "C(reate)" "R(ead)" "U(pdate)" "D(elete)" . It's a very simple rule. 

And recently NoSQL DB becomes popular which is not needed SQL knowledge. NoSQL database handles data by JSON format which is very easily handled by javascript programmer. We can manage a database like documents and I like this concept very much. For example, in case of firebase, the database consists of collections, and each collection has some documents and each document is the same as record and a document consists of fields and I can add fields with the object-type format so we can handle data with JSON format. It has flexibility so we don't have to add field freely. We don't have to have special knowledge of databases and also reuse these codes. 

I think SQL is a good system but I like NoSQL DB.


DOM

This is the most important notion for web programming, I think. A recent framework like Angular supports DOM so we can handle template-component relationships without knowing DOM but understanding DOM brings me deeper understanding of what is happening at web service.
Web page (HTML in browser) display documents at a PC screen but HTML is not a mere document, it holds logical document tree inside so programs like javascript can handle documents (html&css) dynamically like a code. When I know this notion, I was amazing this idea and I like the javascript world very much.

Authentification

As we use real web-services, authentification is an essential technology because when we use a database at the company, we have to identify each user's identification, their branch name, their competence to access information and to do them, we have to identify each user so we have to use authentification mechanism.

We can make their own authentification system from scratch but it needs some amount of time, so it is a good idea to use authentification clouds. I like firebase cloud so I try to use firebase authentification which can be easily introduced to my web service. I like it very much!


Observable and Promise

Observable is a technology that I'm deeply moved. Observable handle data like "stream" and we can handle realtime data with an array of data. It's a big idea for web technology, I think. In relation to cloud service, there is a time-delay so this technology is a powerful tool to use cloud services.

Anyway, I want to continue writing about these technologies next time.


Comments

Popular posts from this blog

Pops

Earthquake happend in Japan

Goldsmith College, UK

Iga ueno city, Ninja museum

Our new family !