Questions tagged [node.js]

Node.js is an event-based, asynchronous I/O framework that uses Google's V8 JavaScript engine.

Filter by
Sorted by
Tagged with
1
vote
3answers
124 views

How should I store time stamps so that it's easily accessible and won't take too much space

tldr at the bottom if you don't want to read all this! :) First of all the db I'm using is MongoDB! So I've been building a fun project and all has been well but I hit a small problem. Effectively, ...
-3
votes
0answers
47 views

Is it a good/bad design to do CRUD from SPA like React?

I am creating a responsive web app using ReactJS as front end and MongoDB at the backend. I have the below two options and would like to know which one is preferred to perform CRUD operations. ...
2
votes
2answers
911 views

Storing unchangable data in database vs in code

Hi I am trying to create a role based dynamic route authorization system on my NodeJS ExpressJS powered API server. Scenario: There will be some roles like Admin, StandardUser etc. and they can't be ...
0
votes
0answers
48 views

Where to place the Value Object code that is shared by more than one Aggregate Root?

I have 2 Aggregate Root: One is the Lessor user, and the other is the Lessee user. class Lessor extends AggregateRoot {} class Lessee extends AggregateRoot {} Each of these Aggregate Roots has a ...
-3
votes
0answers
62 views

DDD (Domain-Driven Design) - Did I do it right?

Hello! I am rewriting an MVC application for DDD ... it is past time to learn. The application is very simple: renting space for freelance work in companies (coworking). I need your help, did I ...
-2
votes
1answer
83 views

Implementing heartbeat in terms of best practice

I have a web application that is running under .NET framework and that is using JS/JQuery on the client side. I am the owner and the only developer of this web application, and it is not totally under ...
-1
votes
1answer
65 views

Need some criticism for my backend app Architecture

I have been learning Backend development for quite a while now and I decided to build a bigger project using Express.js and the MVC architecture, the project is basically a Restful API with Vue.js in ...
0
votes
1answer
89 views

Is using web sockets between client-server to tranfer files the right approach? ( when multiple users connected on the same socket connection )

I am currently designing a system that lets users connect their Cloud Storage such as Google Drive, Dropbox etc and also to their physical filesystem (personal laptop/ ftp server etc.) and then can ...
-4
votes
0answers
14 views

Separating and linking Node.JS API from processing server

I would like an architecture design advice. I have a projet composed of a public Node.JS API server (handling client HTTP browser requests) The purpose of my project is to convert an image to a ...
2
votes
1answer
146 views

Why should I write unit test for my example instead of (or with) my integration test

I have a repository function on my repository layer. I use sequelize as data access. I will write tests for my function. Here is the logic I want in English: My function should save a user to ...
-2
votes
1answer
31 views

Can a JavaScript SPA launch executables installed on the server?

Context We have an application that is written in .NET and runs on a Citrix server. This app consists of shortcuts to external tools (like: DameWare, VNC viewer, mtsc.exe, msra.nexe, ...) that are ...
1
vote
1answer
51 views

Memory management in node.js

I'm writing a web server as a test project in node.js Whats really bothering me so far is the lack of control or even awareness of memory usage. Naturally I want to cache some stuff in RAM for faster ...
0
votes
0answers
33 views

Recommendations for data clustering in an application

I am making a social media app. I have a use case in which i have to cluster similar type of data. For example, take Instagram. When a user likes a post, we get a notification that 'x likes your post'...
1
vote
0answers
45 views

Event-based communication between microservices

I'm currently looking into NestJS to use as the framework for a new e-commerce project. The goal is to build multiple loosely-coupled services, which can communicate with each other using the pub/sub ...
1
vote
2answers
119 views

How to refactor duplicated functions with only one difference in parameter list

I've got 2 near-identical functions (NodeJS). One of them queries DB for shop information by its phone number, while the other one queries by its id. I'd like to know if there's a clean way to merge ...
1
vote
1answer
79 views

Write complex query OR write simpler queries and combine the results in Backend service?

Take the following statement for example: 'Get results for ALL Active students of a Course'. Naturally, this query has 2 parts, Get all active students of the course. Get results of those ...
2
votes
1answer
38 views

Should I update the major version of a consumer package if one of its critical dependencies has a major update?

This is a scenario I have seen: I have a shared library with code that fetches data from an api. Let's call this ApiProvider. Currently this ApiProvider is in version 1.1.1 and is currently pointing ...
0
votes
0answers
41 views

Streaming Promises in NodeJS

Imagine a typical HTTP service that does async db queries. If HTTP requests are received more quickly than the db can complete queries (such as because the db disk or network is slow), the Promises ...
2
votes
1answer
236 views

Form validation code shared in the frontend and backend API?

I have a legacy Java monolithic web application. My goal is to use React on the frontend, keep Java on the backend and add an API for the frontend to use. My question is how can I write the data ...
1
vote
1answer
95 views

Node and Angular two separate applications or a single application?

I am a java developer. Since one of our developers are leaving I was handed over a project he was maintaining. He says it is a node + angular js project. But as per my understanding, backend should be ...
-2
votes
1answer
58 views

Database with auto-expiration

I am midway through my software development project in Node.js and have encountered a fork in the road. I need to create a "database" or a JSON file, that will automatically delete an entry after it ...
-4
votes
2answers
48 views

Hosting a file system in production?

Sorry if this is broad. But I'm confused on how to scale a file system. I'm currently working on the server side of a webapp with Node(Express)js, its file system module, and mongoDB. I'm storing ...
1
vote
2answers
133 views

Node.js error handling through each layer

I am looking for a way to handle errors in a Node.js application without getting lots of log entries for the same error event, one from each each affected layer. This might actually apply to any ...
1
vote
1answer
52 views

Transpiling in npm modules

While recently creating a module for shared functionality between our projects I stumbled upon this question. Should the module be occupied with transpilation of code to older browsers that our ...
3
votes
1answer
96 views

How to unit test a service which output is an event with data?

Technologies : NodeJs, Kafka, Mocha The issue : I have a nodeJS service which given a String returns events with a many data. How can I test this using Mocha ? In a simple scenario the service ...
-2
votes
1answer
90 views

How to encrypt player's cards in a Poker client/server architecture in NodeJS?

I am making an online poker server in NodeJS. Currently, the state of the game is being sent to each client. So using debugging tools a client can see all the other player's card IDs. I would like to ...
3
votes
0answers
96 views

data transfer objects between abstraction layers

I want to create an Express REST API and want to try following the clean architecture ideas. I was reading about it but didn't get the idea of the communication between the abstraction layers. Let's ...
2
votes
1answer
43 views

Do I need a queue manager over the database generating execution requests?

I am developing a multi-user application where a user interacts with the UI and submits execution requests (ER). Each user can submit multiple ERs one after the other and multiple users may submit ERs ...
0
votes
1answer
76 views

How to manage breaking updates in an API & database

So I have been working on my mobile app for a while and it is live and in production. Because we released the app prematurely and are continuously improving current features and making them more ...
-1
votes
2answers
171 views

Notify thousands of clients with websockets, are there any caveats?

I'm building a web app, where users can create locations, which are displayed on a map. Also, users can click on the map objects in order to get to a place details page where further interactions ...
3
votes
0answers
59 views

Run a job every hour with Lambda or something else?

I am working on a SaaS project that will have a trial when the trial is ending I get a webhook notification when 3 days are remaining. I do some stuff with this and one of the things is I update user....
0
votes
1answer
148 views

Heroku request timeout vs Nodejs architecture

At this link (https://blog.heroku.com/timeout-quickly#how-webservers-work), I read: All webservers will work in a similar way. Any new request will go to a queue, and the server will process ...
1
vote
2answers
101 views

How to scale complex node.js application

Imagine a large node.js app with a multi-purpose api for mobile and frontend with a serving static files, with a websocket server, lot of cron jobs and workers. Basically I can horizontally or ...
0
votes
0answers
31 views

How to hanlde changing plans in a SaaS

I am working on a SaaS product that I intend to have multiple plans for, I will have a limit of 50 of item A example and then a per user cust where I will have a base plan of 3 users. I'm building ...
1
vote
0answers
54 views

Plugins system for an Electron/React app

I'm developing a Electron/React app which uses Webpack and Asar technologies. It's designed to be a host app providing a common platform for some plugins. These plugins are downloaded and plugged into ...
0
votes
0answers
25 views

Merging php and Nodejs docker images for a developer ready php image used for php application development and CI

For my application I need to provide an image that will be used to develop and release my php application. As well know a php application for the frontend required tools as well such as gulp webpack ...
4
votes
0answers
235 views

Efficiently sharing a large node_modules directory between TeamCity build agents

The CI flow for our Node.js app looks roughly like this: Currently, this all takes place in a single TeamCity 'job' with three 'steps' (the Test step runs 4 concurrent child processes). Problems ...
0
votes
1answer
41 views

Temporary users to restrict db access of query?

I am new to database managment, and I am wondering if it is a good idea to create temporary users to restrict access to only a single table. Like having an user named _logs can only (read?) and ...
-1
votes
1answer
496 views

NodeJS SocketIO Multiplayer Multiple Game Room Management

I am making a multiplayer card game and am using NodeJS as my server with SocketIO. My question is how should I be managing multiple game rooms (say an n number of game rooms) ? Currently I have it ...
0
votes
1answer
85 views

Change semver versioning after dropping node eninge versions

I doubt about to which semver version I should update my public NPM package. I didn't change any code, but I had to drop some node engine versions due to a dependency package which had a major update ...
3
votes
2answers
244 views

How to test database dependent functionalities?

I have written this function which checks if a user already exists in the application: async function ValidateUserExists(username, email){ if(!username || !email) throw new Error('Invalid number ...
1
vote
2answers
112 views

Can strict assertions at application startup omit or replace integration tests?

I wrote a startup-pipeline where definitions are passed via environment variables and are used together with (unit-tested) methods to create suite of several publications (for subscriptions) by some ...
2
votes
2answers
239 views

What pattern lets each of multiple “voters” decide on a central status?

Imagine there's a boolean status variable that is either running or stopped. This variable is running by default and comes together with a deactivator function. When a client calls the deactivator ...
0
votes
0answers
147 views

How to handle server side pagination + processing large sets of data

So lets say I have a SQL query made by a server that fetches up to thousands of records at a time and I need to display those records in a grid(similar to AG Grid) on the client for the user to review....
0
votes
0answers
83 views

Handling user permissions in front-end

I'm building an API that will be used by the front-end in React and I'm not quite sure how I should send the permissions of each user based on their roles. Some fields can only be edited in some ...
0
votes
2answers
108 views

Mitigating markdown's XSS vulnerability w/o converting it to HTML

After reading this guide on how to mitigate markdown's XSS vulnerability. I've been struggling to find the right way for my scenario. Specifically with one of the points discussed in the guide: the ...
9
votes
2answers
2k views

Stateful vs non-stateful app [closed]

I have been learning about stateful apps vs non-stateful, but I am still a bit confused on this topic. For example, let's say I have an app running on Node where users are assigned to random rooms as ...
2
votes
0answers
34 views

AWS codepipeline deployment

I currently have an AWS Codepipeline that is setup to automatically pull an Express, NodeJS API and deploy it with Lambda and API Gateway. It pulls the code from my GitHub repo production branch and ...
1
vote
1answer
429 views

Domain Driven Design - updating part of aggregate

I'm playing around with DDD in a node.js project and struggling with updates to child entities from the aggregate root. For the sake of example, let's say I have two domain objects where Event is my ...
0
votes
1answer
71 views

How to prevent angular 2 client from accessing privileged fields

I'm learning angular and have been reading about various backend solutions like direct db access, REST, and graphql. One thing I haven't seen addressed anywhere yet is how do you protect privileged ...

1
2 3 4 5
9