Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
Nodejs recommended clean folder structure

I'm planning a medium-sized node project because I have a java background, grade did everything for me regarding the general structure of the project. And as far as i already know, the MVC pattern is not very common in Node projects. Now i am wondering how i can structure my project.

I already have some files: Server-related: -server.js just the app.listen(port, callback) function -app.js in here are all expressjs settings like app.use(xyz)

client-related: my public files index.html, index.css and some client side javascript

And some business logic: my project does some heavy calculations on the server side and just displays the results in the index.html, so my business logic contains the most files. For example: a PriorityQueue.js File, that is just a library class for a PriorityQueue Implementation. Furthermore I have implemented some other Data structures and Algorithms.

I do not have many routes, just /error and /home

My Questions is now: How do i structure all these files, to have a clean and beautiful project structure? I already read the AirBnB and the Google JS Style Guide, but they don't say anything about the project structure.

Your help is much appreciated! Thanks.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I generally create a server.js main file and routes/, controllers/ and services/ and models/ subdirectories. If I have a "files" service I will then create files.route.js, files.controller.js, files.service.js and files.model.js.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda