nodejs.md

Node.js Technology Stack

IMPORTANT NOTE: This document is not final; it is under review.

This document outlines the specific standards and conventions for developing backend services with Node.js and TypeScript.

Core Stack

Testing

Naming Conventions

Directory Structure (NestJS)

For NestJS projects, adhere to the standard structure generated by the Nest CLI.

Directory Structure (Express)

A feature-based directory structure is the standard.

src ├── api │ ├── index.ts # Main router that combines feature routes │ └── features │ └── users │ ├── user.controller.ts # Route handlers │ ├── user.service.ts # Business logic │ ├── user.repository.ts # Database interaction │ ├── user.routes.ts # Feature-specific routes │ └── user.types.ts # Zod schemas and types ├── config # Environment variables, etc. ├── middleware # Shared middleware ├── lib # Utility functions ├── server.ts # Server setup and startup └── app.ts # Express app setup