Skip to main content
ProductsDesktop toolsTASTECADDrawing reviewTASTEFILESFile managementTASTEFTPFile transferTASTESSHRemote workspaceTASTEZIPCompression and extractionTASTEWINMFile managementDeveloper toolsTASTECODERust integrated development environmentTASTESTUDIOIntegrated development and test environmentTASTEETLData integration (ETL)ServersTASTEREMOTERemote desktop serverTASTEGEOGeospatial serverTASTEMAILMail workspaceInvestingTASTESTOCKStock auto-trading desktop appGet startedDownloadsDocumentationBuyAll products
Marketplace
News
TechNewsToday's dev newsDeveloper docsProgramming languagesRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp & desktop frameworksTauriFlutterReact NativeElectronAlgorithmsAlgorithm basicsCore algorithmsAdvanced algorithmsPractical algorithms
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcaseCommunity guide
Work with usTech transferWebsite buildDesktop app buildRelease and payment pipelineSales partnerContact
ServicesRemote desktopCustom installer packages
TASTEDEV
Products

Desktop tools

TASTECADComplex drawings, opened with easeTASTEFILESJust the files you need, as fast as possibleTASTEFTPThe tidiest path for your filesTASTESSHA stronger link between you and your serversTASTEZIPPack faster, unpack saferTASTEWINMA keyboard-first file manager with two panes

Developer tools

TASTECODEEdit, build, debug and test Rust apps in one windowTASTESTUDIOFrom editing to remote tests and approved AI fixesTASTEETLMove data while you watch the values

Servers

TASTEREMOTEA remote desktop you run on your own serverTASTEGEORebuilding a GeoServer-compatible geospatial server in RustTASTEMAILTake back control of your email

Investing

TASTESTOCKStock auto-trading that follows the rules you set: when, and what

Get started

DownloadsLatest builds of every productDocsHow to use each productBuySubscriptions and perpetual licencesAll productsEvery product at a glance
All products
MarketplaceNews
Tech

News

Today's dev newsOfficial announcements on languages, frameworks, GitHub and AIDeveloper docsGuides to languages, frameworks and algorithms

Programming languages

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App & desktop frameworksTauriFlutterReact NativeElectron

Algorithms

Algorithm basicsComplexity analysis · Sorting · Searching · Basic data structures · Trees and heapsCore algorithmsGraph traversal · Shortest paths & minimum spanning trees · Dynamic programming · Greedy algorithms · Divide and conquer · BacktrackingAdvanced algorithmsString algorithms · Math and number theory · Bit manipulation · Segment trees · Union-findPractical algorithmsCoding interview strategy · LRU cache · Rate limiting · Consistent hashing
All development docs
Community
ProjectsDiscover builders and their workDevelopment logsDecisions and lessons learnedPromptsReusable instructionsAI tool issuesProblems and workarounds for Claude, Codex, GeminiShowcaseFinished resultsCommunity guideHow we build in the open
Work with us
Tech transferNative apps in Rust and eguiWebsite build10 languages, accounts, docs and downloadsDesktop app buildRust and egui, no WebViewRelease and payment pipelineSigning, MSI, deb, rpm, AppImage, hashesSales partnerRecommend us and earn 30%ContactBuilds, partnerships and investment
Services
Remote desktopReach your computer from a browserCustom installer packagesOnly the features you need, settings preloaded
Buy
EN
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Log in
Log in
TASTEDEV

From small tools to better development.

support@tastedev.netSupport TASTEDEV
ProductsProduct lineupBuyDocsDownloadsMarketplaceSupport
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcase
PoliciesAbout usPrivacy policyTerms of serviceSubscription termsRefund policyCommunity guidelines
AccountLog inSign up
Visitors
Today
Yesterday
Total views
Company
GXSOFT
Representative
CHOI YOUNG GU
Business registration number
853-44-00368
Address
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Phone
+82-10-4404-1523
Email
whitecalvin@tastedev.net
Privacy officer
CHOI YOUNG GU

© 2026 TASTEDEVProduct information is based on verified development sources.Released · improving

NestJS · Express docs
NestJS · Express
Getting Started with NestJS and ExpressProject StructureCore ConceptsValidation, Configuration and DatabasesTestingDeployment
Discussions

NestJS · Express guide · 2/6

Project Structure

Express does not prescribe a folder layout, while NestJS has clear conventions for organizing code into modules. This chapter walks through the files nest new generates, the key configuration, feature modules, and a common way to organize an Express project.

The default Nest project

A project created with nest new looks roughly like this (ESLint and Prettier config omitted).

hello-nest/
├── src/
│   ├── app.controller.spec.ts
│   ├── app.controller.ts
│   ├── app.module.ts
│   ├── app.service.ts
│   └── main.ts
├── test/
│   ├── app.e2e-spec.ts
│   └── jest-e2e.json
├── nest-cli.json
├── package.json
├── tsconfig.build.json
└── tsconfig.json
FileRole
src/main.tsEntry point: creates the app with NestFactory, applies global setup, listens on a port
src/app.module.tsRoot module that imports every other module
src/app.controller.tsSample controller handling one route
src/app.service.tsSample service (provider) injected into the controller
src/*.spec.tsUnit tests kept next to the source
test/End-to-end tests that boot the whole app and talk HTTP

Configuration files

nest-cli.json controls the Nest CLI. sourceRoot points to the source folder, and deleteOutDir clears dist before each build.

{
  "$schema": "https://json.schemastore.org/nest-cli",
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "compilerOptions": {
    "deleteOutDir": true
  }
}

In tsconfig.json, two options are essential for Nest: experimentalDecorators enables decorator syntax such as @Controller(), and emitDecoratorMetadata keeps constructor parameter types at runtime so dependency injection knows which class to provide. tsconfig.build.json excludes test files from the build.

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "outDir": "./dist",
    "baseUrl": "./"
  }
}

This shows only the Nest-related options. The generated file also sets module, target, strictNullChecks and more, and defaults vary slightly between Nest releases.

Splitting code into feature modules

As an application grows, each feature gets its own module. nest g resource creates the controller, service, module, DTOs and entity in one go, and for a REST API it also scaffolds CRUD endpoints.

nest g resource users
src/users/
├── dto/
│   ├── create-user.dto.ts
│   └── update-user.dto.ts
├── entities/
│   └── user.entity.ts
├── users.controller.spec.ts
├── users.controller.ts
├── users.module.ts
├── users.service.spec.ts
└── users.service.ts

By convention, file names follow <name>.<type>.ts in kebab case, and classes use PascalCase such as UsersController and UsersService. A module declares its own controllers and providers and lists in exports only the providers other modules need.

// src/users/users.module.ts
import { Module } from "@nestjs/common";
import { UsersController } from "./users.controller";
import { UsersService } from "./users.service";

@Module({
  controllers: [UsersController],
  providers: [UsersService],
  exports: [UsersService],
})
export class UsersModule {}

The CLI adds UsersModule to the root module's imports automatically. Shared guards, interceptors and utilities often live in a folder such as src/common/.

Organizing an Express project

Because Express enforces no structure, teams decide for themselves. A common approach splits routers, middleware and business logic into folders, and keeps creating the app separate from listening on a port.

my-express-api/
├── src/
│   ├── routes/
│   │   └── users.js
│   ├── middleware/
│   │   └── error-handler.js
│   ├── services/
│   │   └── users-service.js
│   ├── app.js
│   └── server.js
└── package.json

app.js only builds and exports the app; server.js opens the port. Tests can then import app without binding to a port.

// src/app.js
const express = require("express");
const usersRouter = require("./routes/users");

const app = express();
app.use(express.json());
app.use("/users", usersRouter);

module.exports = app;
// src/server.js
const app = require("./app");

const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`Listening on ${port}`));

Summary

  • A Nest project centers on src/main.ts (entry point) and src/app.module.ts (root module).
  • experimentalDecorators and emitDecoratorMetadata are required for decorators and dependency injection.
  • Give each feature its own module; nest g resource generates the controller, service and DTOs together.
  • Express leaves structure to you: separate routers, middleware and services, and split app from listen to make testing easy.
Questions about this chapter?
Previous chapterGetting Started with NestJS and ExpressNext chapterCore Concepts

0 comments

Top commentsNewest first

Sign in · Sign in to leave a comment.