הוק חד

מאת DukeCode
בתאריך 11 אוקטובר, 2018

פרוייקט נסיוני למציאת סביבת פיתוח חדשה בקוד פתוח

הוק חד

A full-stuck example of Vue.js web app consuming REST API running on node.js using KNEX, Postgres and Express, and secured authentication by JWT implementation

View on GitHub

VUE-AUTH-SKELETON

This project is a side product of testing and examining my next fullstuck environment, programing language… for web application development

Server - JWT implementation using KNEX and Express on Node.js

Client - Vue.js using Vue-router, Vuex and Axios

;TLDR

After many years of using Microsoft Visual Studio, coding c#, asp.net for IIS & MS-SQL on windows machines, I’m looking for an open-source solution. I decided that my next fullstuck template will be node.js based. front-end: Vue.js Shell that supports most PWA features on client side. server-side: Express.js for REST API.

In order to understend the current web technology arichtecture let’s take a brief of the evolution of the web or “FROM STATIC TO DYNAMIC”.

My first server side language was ASP3 (vb script). Things got match better when .NET born, the simple WS SOAP based integration, OOP, separation between layout and logic was great! But the basic architecture did not chage, Microsoft ASP.NET (web forms) was still postback based, the old school architecture was to render the HTML for every click, and then load the complete page, which mean low performence specially because the IIS renders the whole page for every click. Since then, more and more open source libraries took significant part on both client and server side and Microsoft release MVC and other open source inspired or combind starter-kits and good solutions like web api.

This project architecture is a Single Page Web Application, that makes Http json request to REST APIs from different sources, some public and some Token based - the SPA layout loads only one time, and content change by replacing only the data inside the selected layout commponent, driven by a callback response or user action. A big gratitude to Haim Lankry for guiding and supporting my (C#) => {JavaScript} transformation.

Install

Server

I’m developing on Linux Ubuntu 16.04

postgres sql instalation

create db: sudo -u postgres createdb pgmem.

config knexfile.js (user and pass).

npm install.

npm run knex migrate:latest.

npm run dev.

Client

npm install.

npm run dev.

because i’m running both project on same localhost machine, it is nessesary to open two instance of node.js, and run each on a different port, there for the client code must be modify here.

Production

npm run build, and then copy the file to /home/ubuntu/example/dist/

SSL

sudo apt-get install python-certbot-nginx

add-apt-repository ppa:certbot/certbot

sudo certbot –nginx -d domainname.com

sudo certbot renew –dry-runsudo certbot renew –dry-run

nginx

sudo apt-get install nginx -y

sudo nano /etc/nginx/sites-available/default

הוק חד
מאמרים נוספים...