2022-01-10
1363
#node
Geshan Manandhar
85866
Jan 10, 2022 â‹… 4 min read

Organizing your Express.js project structure for better productivity

Geshan Manandhar Geshan is a seasoned software engineer with more than a decade of software engineering experience. He has a keen interest in REST architecture, microservices, and cloud computing. He also blogs at geshan.com.np.

Recent posts:

D3 Js Adoption Guide: Overview, Examples, And Alternatives

D3.js adoption guide: Overview, examples, and alternatives

D3.js is a powerful JavaScript library for creating tailored data visualizations. Let’s see why you should use D3.js in your next project.

Eze Sunday
Jan 19, 2024 â‹… 10 min read
Using Semantic-Release To Automate Releases And Changelogs

Using semantic-release to automate releases and changelogs

Demonstrate how to automate releases and release notes with semantic-release in GitLab.

Sebastian Weber
Jan 18, 2024 â‹… 10 min read
React Native Push Notifications A Complete How To Guide

React Native push notifications: A complete how-to guide

Learn all about how to implement push notifications in React Native in this ultimate guide and step-by-step tutorial.

Fortune Ikechi
Jan 17, 2024 â‹… 12 min read
Exploring Effect A Meta State Rxjs Like Framework For Writing Typescript

Exploring Effect, a meta-state RxJS-like framework

The Effect library helps you better handle async code, types in async scenarios, and errors in TypeScript projects. Let’s see how.

Isaac Okoro
Jan 17, 2024 â‹… 6 min read
View all posts

6 Replies to "Organizing your Express.js project structure for better productivity"

  1. This folder structure is only suitable for small projects. It is good to me tion that component based decomposition works better for larger applications.

    1. Exactly, I don’t understand why they keep promoting this structure, it seems that it was just a copy of another post.
      This may seem appealing for small projects, when they grow, it becomes very difficult to maintain a feature that has files scattered in random places in the project. ( since not all functionality will have Repository, service etc ).

      He is a good discussion about it: https://softwareengineering.stackexchange.com/questions/338597/folder-by-type-or-folder-by-feature

  2. What would be the difference between `services` and `controllers` ? How do you decide which logic you want to place in what folder ?

    1. Putting big piece of code inside controller may be not the best idea when you need to manage a lot of them. Also the logic can be reusable. So exporting that logic into functions may work for larger projects. You can store that functions inside services. I’m not sure if this is what author meant, but after working on couple projects – it’s quite common solution.

Leave a Reply