Best file structure for node js project

This page summarizes the projects mentioned and recommended in the original post on /r/webdev

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • node-typescript-architecture

    Hexagonal architecture / ports-and-adapters for Node.js using simple functional programming

  • It's opinionated, and it's self promotion, but this is what I've used for every project of mine since 2020: https://github.com/jbreckmckye/node-typescript-architecture

  • domain-driven-hexagon

    Learn Domain-Driven Design, software architecture, design patterns, best practices. Code examples included

  • Can't use any frameworks or libraries? Seems like a terrible idea tbh. I can suggest this repo https://github.com/Sairyss/domain-driven-hexagon - read "modules" and "folder and file structure" sections for some suggestions on how to structure files using patterns like Modular Architecture, Vertical Slicing, etc. Make sure to read the attached links and check code examples.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • fullstack-starter-template

    Template for full stack applications based on TypeScript, React, Vite, ChakraUI, tRPC, Fastify, Prisma, zod, etc.

  • For example, in this repo, DTOs are just a zod schema for inputs, and interfaces/types for output: https://github.com/Sairyss/fullstack-starter-template

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts