DEV Community

Hasan Zohdy
Hasan Zohdy

Posted on

3-Nodejs Course 2023: Project Structure

📁 Project Structure

Now we've a good understanding of our package.json file, now let's start create our project structure.

Our project directories tree will look like this:

  ├── src
  │   ├── app
  │   │   ├── moduleName
  │   │   │   ├── controllers
  │   │   │   │   ├── moduleName.controller.ts
  │   │   │   ├── database
  │   │   │   │   ├── models
  │   │   │   │   │   ├── moduleName.model.ts
  │   │   │   ├── middleware
  │   │   │   ├── responses
  │   │   │   ├── routes.ts
  │   ├── core
  │   ├── config
  │   ├── utils
  │   ├── index.ts
  ├── storage  
  │   ├── assets
  ├── .env
Enter fullscreen mode Exit fullscreen mode

This is going to be our project structure, we will have a src directory that will contain all our source code, and a storage directory that will contain all our data.

The .env file will contain all our environment variables and sensitive data.

📁 app

The app directory will contain all our modules, each module will have its own directory, and inside that directory we will have all the files related to that module.

📁 core

The core directory will contain all our core files, like our application manager, request manager, and other core files.

📁 config

The config directory will contain all our configuration files, like our database configuration, and other configuration files.

📁 utils

The utils directory will contain all our utility files, like our logger, and other utility files.

📁 index.ts

The index.ts file will be our entry point, it will contain all our application initialization code.

📁 storage

The storage directory will contain uploads, cached files, and any other files.

Inside the storage directory we will have an assets directory, this directory will contain all our assets, like images, videos, and other assets.

🎨 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).

Top comments (0)