Line between Back-end and Front-end in web app development [closed] - node.js

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I have been learning full stack web development for a while now. But I am having trouble to understand where would the job of back-end developer stops, and front end begins when the work is separated.
I understand the back-end developer builds API that the front end developer will interact with, but I am confused regarding routing and (using nodeJS) who would write the equivalent of what is in the app.js file.
Finally, If you do back-end only, then you would not write any 'views.ejs' files?

Frontend development deals solely with the parts of a web application that a user interacts with, and requires HTML, JavaScript and CSS. The backend deals with the server, the application logic, and database.
If a single frontend developer is building a simple web application, they will have to create both the front end and the backend of the application. This may just require creating routes to render pages. Most freelance web developers do this.
For much bigger applications (in bigger organisations), the duties of the frontend developer and the backend developer are much more distinct. A backend developer will be responsible for building the actual application logic, checking for authentication and authorization, managing the database etc. The frontend developer in this organisation will work solely to design the interface that the user interacts with. They will not be required to even render any page on the backend. This is the job of the backend developer.
In short, a front-end developer may have some basic knowledge about the backend, but a backend or full stack developer will be required to build all the features of the application that a user does not see.
You read more about the difference using the following link: http://blog.teamtreehouse.com/i-dont-speak-your-language-frontend-vs-backend

The difference between back-end and frond-end developers is the program they wrote. Front-end deal mostly with the physical apparance of the website. How it looks and what user can physically feel while using the website. Front end languages include HTML, CSS, and Javascript.
While back-end developers focus mainly on the integration of server, web applications, and logic of the stylish web design made by front-end developers. They are in charge of creating a communication link between the website, the browser and the database servers.

Related

Should API fetching be frontend or backend? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
My website application is using React for the frontend, and I'm deciding between ExpressJS or Flask.py for the backend. Either way, I know React has API fetching functions but also the other backend-dedicated frameworks. My question is, conventionally, would API fetching logic be part of the frontend or backend?
There are some conditions which require or prefer API fetching to be in the back-end:
When you need to use security credentials to access the API and you those credentials need to stay private.
When the API does not permit cross origin access so your front-end could not directly access it.
When you need to do some processing on the API results and you wish to keep the processing algorithms a trade secret (keep in mind that all processing done in the front-end is available for any coder to see). There are no secrets in the front-end code.
When the front-end device may not have appropriate resources (CPU, memory, etc..) to process the API results. This can particularly be the case with smaller dedicated devices.
When you don't want the front-end device to have to expend the battery energy to regularly access the API. This might particularly be the case if you're regularly polling some API looking for changes. In that case, you might want the back-end to do the polling and just let the front-end know when there is something to actually do.
When there are reasons to do some centralized performance management of your access to the API such as caching of results or request throttling.
When all front-end devices may not have proper network access to the API server.
If there are no compelling benefits to putting the API access in the back-end, then it may be more scalable (for your server) to let the front-end do as much work as it can.

How PWA can be useful rather than developing a Simple web Application [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I know I am very bad at asking a question so please tell me rather than downvote me...thanx
Q1: How Is Progressive Web Application Useful?
Q2: What Type of Application Should be Built using PWA is there any Specific Application which contains a lot of CPU utilization or Simple Static Pages with just small interaction with Server?
Q3: What should be the Application Architecture? In General?
There are a lot of reason for using PWA rather than web-apps or native applications.
A1:To answer your first question there are some articles found on internet, here I recommend some of them to read:
Google Developers PWA documentation
What is PWA?
Important tips about PWA
A2: There are no limitation and restriction on app you wanna develop. (Also you should pay attention to the key things like caching, which are considerable and important in native/web apps, too.)
A3: The architecture is very similar to web-apps except it must have some additional files:
manifest.json (Which is used to declare something like application name, the icons and etc. and it must be placed in the root of the project)
serviceWorker.js (Which gives you additional features like push notification, background works and etc.)
NOTE: As it obvious your Progressive Web App should be responsive to support different resolution of mobile screens.
PWA is not a single technology or a framework , set of features in web which helps to improve your application progressively.
It means if you have a modern browser you will get an awesome user experience else those features just not support it , your application will have existing features remains as it is.
Let's talk about what all the features we can use to enhance our existing or new web application .
You can bring native look and feel of mobile device apps on your web
pages. It's not the responsiveness of web page but you can access the
native features such as camera , accessing geo location, push
notifications.
Offline Capability when your internet connection get lost through caching.
Background Synchronization of data
Icon on the home screen , you don't need to install the application
from the app store to place it on your home screen.
There are three import things I want to summarize about the progressive web application.
Reliable : Application will load instantly even in a uncertain condition and provide offline functionality through caching.
https://developers.google.com/web/progressive-web-apps/#reliable
Fast : Respond quickly as possible based on the user interactions.
https://developers.google.com/web/progressive-web-apps/#fast
Engaging : Feels like a native app on mobile devices.
https://developers.google.com/web/progressive-web-apps/#engaging
Q1: Progressive web applications (particularly the service worker part of them) are useful because they can (a) be very fast and (b) work offline. Using a service worker to cache resources (HTML, JS, CSS) on the user's device can create almost instant page-load times on subsequent visits to your site. In addition, this can make your site available even without a network connection. Progressive web apps (with a manifest file) can also be installed on the device home screen, making them easily accessible, like native apps.
I'm not sure I understand Q2 and Q3, so I'll leave those for someone else to answer.

Nginx as a web server or Node JS with Cloudfront CDN [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have read many articles that the main advantage of using Nginx as a web server is that it fastens you performance, especially because it works fast with a static data.
I already uses Cloudfront CDN (Amazon Services) for fastening the static data.
So, do I have any real reasons to prefer using Nginx over Node JS as a web server?
No advantage in your case. Choosing a CDN to deliver your static content was a great idea. (CDN's not only serve your content, but they cache it around their network so most locales see equivalent performance.) This offloads a significant amount of labor from your NodeJS application server.
However NGINX can be very useful in conjunction with an application server like NodeJS. Most people use NGINX as a reverse proxy, that is it sits in front of a cluster of application servers and distributes traffic load evenly.
Other cool tricks include hotswapping NGINX configuration for blue green deployments; so you never have to halt your service for an upgrade.
If you have the money and the time these are tricks well worth having up your sleeve.
It depends what do you believe "real reasons" are.
I believe the most important reason includes security issues - Nginx is a dedicated web server, whereas Node.js is a JavaScript runtime, therefore Nginx focuses on serving-related issues, whereas Nodejs builtin server is just an additional utility, thus not receiving that much attention. Another benefit of such deployment is configurability - for example, you can switch your node runtimes with virtually no downtime (since you can run two nodejs instances at the same time) or even slowly move the traffic to your new server.
You can also take a look at: Using Node.js only vs. using Node.js with Apache/Nginx and http://blog.modulus.io/supercharge-your-nodejs-applications-with-nginx
Perhaps you may be interested in a more general question as well, regarding application servers vs web servers: What is the difference between application server and web server?

Automating Node and Angular frontend/backend Integration, production preparation and deployment? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have been experimenting with Node.js for a while and have hacked together simple projects with Express, Hapi and Restify. The frontends on these small projects were very small and limited, as I was primarily focused on the backend, so I never had the need to automate a lot of the details when deploying them to production servers.
I recently started getting into front end development and stumbled across some great automation tools; Yeoman (overall workflow), Yo (for scaffolding), Grunt (automation) and Bower (for dependencies).
I absolutely love the workflow of these tools and they have gotten me really excited about trying to learn front end development, structuring and workflow. However, learning all of this has also raised questions on the proper way to automate other areas of workflow that integrate the front and back ends:
1) Should I be maintaining the frontend and backend in the same repository? They are both written in JavaScript but it seems semi clunky. I know this is a matter of preference but I would love to see some thoughts on current best practices. Would it be best to have the public directory in my app be a sym link to another.
2) How do I wire my front end to my backend? Specifically talking about socket.io calls. I am not sure the best way to automate how to best set this variable. In the backend I would use process.env, but I am unsure how to accomplish wiring them together based on test, production settings. I do not want to hand change this everytime I deploy to server.
1) I like the idea of keeping them in the same repository. It makes your life so much easier as you go along. The one thing you will feel happy is once your server and web pages are being served from same web server, you dont need to deal with any of the CORS issues. Or you don't need to have a reverse proxy just to resolve CORS issue.
2) We use angular js with socket.io calls. Since you use yeoman, you can read a config file into the Gruntfile.js like this. grunt.file.readJSON('config.json'). You can reuse your grunt scripts if you have a CI.
nodeServer : {
prod : {
port: 8080, //other params
}
}

What kind of apps can be built using node.js other than real time apps (like chat or multiplayer gaming) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Is node.js is only for real time applications like chat or multiplayer games? I know little bit of PHP, Python and ASP.
But I love JS the most. But I am interested in building particular type of application such as-
Content based app (like CMS, forums or community sites)
Utility tools (web2pdf converter, image editing or other frequently used tools)
Business tools (SEO analysis tools etc)
Is node.js only for real time applications??
Edit 0- Can you please give examples of node apps other than real time applications
Edit 1 : can node be used for IO operations or serve static pages over http. Isn't it just another web technology like PHP or ASP.NET
Edit 2 : What can node do that PHP can't. Also anything that PHP can and Node can't.
Node.js is useful for any application that does not involve CPU-bound work.
Node.js is basically just javascript, including the asynchronous aspect of javascript, running outside of the browser. The basic framework it comes with allows you to setup a server really easily, and that's what most people use it for, although it can do most things any other server side language can do (File IO, Networking, Multithreading, etc).
Node.js can be used for most applications, as it's expandable via modules, and has a great developer community. You can see the different companies who use it at http://nodejs.org/industry/.
Some great tutorials can be found by Googling node + the type of project you want to build and you can also find a list of resources in the Readme of their github https://github.com/joyent/node. After you feel comfortable with node, then browse some github node.js repositories, and figure out which modules you want to work with to make your project. Then keep learning!
Javascript is a great language, and node.js is an awesome technology. Good luck!
Node.js is farmost, one of the best technology of its kind. You can build anything out of Node.js, scaling from realtime applications to normal websites. But what makes Node.js standalone from crowd, is its way of handling users request and response. In simple term Node.js come into play when there is lods and lods of traffic coming into your website.

Resources