Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
October 29, 2022 02:21 pm GMT

10-Nodejs Course 2023: Application Module Structure

Now we're ready to move to our next step, which is to start manage our application and split it into different parts, but we will group all related ones under one directory, which we'll call it a module.

Modules

Modules are the main building blocks of our application, they are the main part of our application, and they are the ones that will be responsible for handling requests, responses, validation and database as well.

The module structure that we're going to use is the following:

src app    modules       users          controllers             user.controller.ts          validators             create-user.validator.ts          models             user.model.ts          middleware             auth.middleware.ts          responses             user.response.ts          utils             user.locales.ts          routes.ts

So in our previous schema, we'll have a directory called app which will be in the src directory, inside it there will be the modules directory, and inside it there will be a directory for each module, and inside it there will be the controllers, validators, models, middleware, responses, utils and routes.ts files and so on for each module we need.

PLease note that this structure can be used all of it or some of it based on the module requirements and size.

Project Repository

You can find the latest updates of this project on Github

Join our community

Join our community on Discord to get help and support (Node Js 2023 Channel).

Video Course (Arabic Voice)

If you want to learn this course in video format, you can find it on Youtube, the course is in Arabic language.

Bonus Content

You may have a look at these articles, it will definitely boost your knowledge and productivity.

General Topics

Packages & Libraries

React Js Packages

Courses (Articles)


Original Link: https://dev.to/hassanzohdy/10-nodejs-course-2023-application-module-structure-3mkm

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To