What is the best combination of tools to use for web development: express with jade/ejs, along with html5, css

As I delve into learning node.js/express, a question arises about how jade/ejs, html, and css work in harmony. Allow me to share my understanding:

  1. The application logic is implemented in node.js/express
  2. A portion of this logic/variables is injected into the jade/ejs html engine to dynamically generate html
  3. CSS continues to style the generated html based on the requesting device.

At times, it feels like the boundaries between these technologies are blurring due to the heavy presence of JavaScript. Deciphering where to allocate logic – node.js/express or jade/ejs – becomes challenging.

This complexity further intensifies when websockets come into play, adding another layer of client-side logic. Henceforth, we find ourselves juggling display control logic across five different entities.

Answer №1

You've got the basics down! I found a fantastic tutorial that should help clear up any confusion you might have. It covers all the modules you mentioned and does a great job explaining the role of each element.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can I properly retrieve a request in node.js?

I seem to be quite curious lately ;) I've been making progress in developing my web chat system. Finally, I was able to make it work! My main query was how to input text into the textarea and have the message sent to the server upon pressi ...

Comparing NemoJs and NightWatchJS: The Pros and Cons

As a beginner in both frameworks, it appears that Nightwatch has more extensive documentation and API features compared to Nemo. What are the main benefits of choosing one over the other? ...

Surprising outcome from the glob-fs glob.readdirSync function

Below is some nodejs code that I am working with. The client initially calls /api/demosounds and then calls /api/testsounds. var glob = require('glob-fs')({ gitignore: true }); app.get('/api/demosounds',function(req,res){ var d ...

Console frozen when executing an async JavaScript script to populate a Mongoose database

I'm currently delving into a personal project and aiming to unravel the intricate logic that is preventing my Node JS process from closing after executing populateTransactions(). My assumption is that the issue lies in not properly closing the DB con ...

Tips for Aligning Several Images Horizontally in an Article

Does anyone know how to center pictures in an article horizontally? I've tried various techniques without success. If it would be helpful, I can share the CSS I currently have. However, I am open to starting from scratch with the CSS as well since I ...

Navigate to a list item once Angular has finished rendering the element

I need to make sure the chat box automatically scrolls to the last message displayed. Here is how I am currently attempting this: akiRepair.controller("chatCtrl", ['$scope', function($scope){ ... var size = $scope.messages.length; var t ...

Styling a div element in CSS with absolute positioning and the ability to

I am looking to set specific positions and dimensions for the div elements within my HTML document. Refer to this image for reference: https://i.stack.imgur.com/ANBVm.png For each of these div elements, I want a vertical scrollbar to appear if the content ...

Clicking on the overlay does not close the bootstrap collapsed toggle

I'm currently facing an issue where I need to add a listener that closes the menu when clicked away. The code snippet below shows my attempt at solving this problem: $("body").click(function(e){ var $box1 = $('.navbar-toggle'); var $b ...

Experiencing a "Connection timed out" error on your Flutter application?

Encountering an issue in Flutter when running Node APIs SocketException: OS Error: Connection timed out, errno = 110, address = mydomain.com, port = 47260 We are experiencing this error intermittently for random API calls. It occurs suddenly and after a ...

Div text with superfluous line breaks

Whenever a user clicks the sign-up button ("Cadastrar" in Portuguese) on my website, the newsletter form successfully hides. However, there seems to be unnecessary line breaks in the success message. Why is this happening? I am trying to make sure that th ...

What is the process for capturing a window screenshot using Node.js?

I am currently conducting research to discover a way to capture a screenshot of a window using Node.js. I have been attempting to achieve this with node-ffi, but I am facing some difficulties at the moment: var ffi = require('ffi'); var user32 ...

Detection of Unauthorized Video Downloads

Is it feasible to identify individuals who illegally download videos from websites, such as YouTube, by using video grabber applications? I wonder if these downloads could be traced in some way, enabling the identification of offenders. Is there a method t ...

Is there a way for an input form to completely fill a table data cell without increasing the width of the entire row?

I would like to add a row of text inputs at the bottom of my table, with each input having the same size as the widest element in their respective rows. I have tried setting the width to 100%, but this ends up expanding the entire row, which is not the des ...

Creating a horizontal scrollbar in columns using Bootstrap can be accomplished by adjusting the CSS properties

Having a container created with boostrap: https://i.sstatic.net/bqAuf.png The question at hand is how to implement horizontal scrolling in order to maintain the aspect ratio of the initial image within the container on phone resolutions. Here is the con ...

Fetching data from a collection using Mongoose in Node JS

Currently working with MVC architecture. Seeking guidance on using the findOne({}) method in my loginController. I need to retrieve data from an existing collection, which already contains some information. My goal is simply to extract data from it. Apolo ...

What happens if I attempt to pass a blank field in multer?

I am trying to verify if the image field passed to Multer will include the file. There are no errors being thrown by Multer and the server is currently processing the request. ...

Assist the floats to "ascend" and occupy the available space

The screenshot showcases boxes that have been styled with "float: left". Is there a way to make these boxes float to the first available space in a column? For example, can we move the Music Nation box to the location indicated by the red arrow in the ima ...

"Unusual HTML and jQuery quirk causing a perplexing issue: a function that keeps looping inexp

A unique code written in javascript using jQuery allows users to create a "box" on a website with each click of a button, triggering an alert message upon clicking the box. The process is as follows: 1) Clicking the "Add (#addBox)" button appends a new li ...

Having trouble initiating a Next.js and Tailwind project using the npm run dev command

After creating a next - tailwind project using npx create-next-app -e with-tailwindcss my-project, I encountered an error while trying to run the app on Windows 7. When running npm run dev, I received the following error message: > @ dev E:\Coding ...

Styling with CSS in Angular 2+ can be quite challenging

Hey there, I'm new to Angular 4 and running into some troubles with styling my application. I tried adding a background image to the body, which worked fine, and then added a component to display content, also looking good. Now, when I added a second ...