GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pnstack/template-node-typescript: A modern Node.js TypeScript template with a well-organized folder structure and best practices.

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
tests
tests
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
.nvmrc
.nvmrc
 
 
.prettierrc
.prettierrc
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslint.config.js
eslint.config.js
 
 
jest.config.js
jest.config.js
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
tsconfig.json
tsconfig.json
 
 
tsup.config.ts
tsup.config.ts
 
 

Repository files navigation

Template Node.js TypeScript

A modern Node.js TypeScript template with a well-organized folder structure and best practices.

Requirements

  • Node.js 22.x (LTS)
  • pnpm (recommended) or npm

Getting Started

Instructions for installing dependencies and running the app locally.

# Install dependencies
pnpm install

# Run in development mode
pnpm run dev

# Build for production
pnpm run build

# Start production server
pnpm run start

Project Structure

src/
├── config/        # Configuration files and environment variables
├── constants/     # Application constants and enums
├── middleware/    # Express/HTTP middleware functions
├── services/      # Business logic and service layer
├── shared/        # Shared utilities and helpers
├── types/         # TypeScript type definitions and interfaces
├── utils/         # Utility functions and helpers
└── index.ts       # Application entry point

tests/             # Unit and integration tests
dist/              # Compiled JavaScript output (generated)

Folder Descriptions

Folder Description
config/ Environment configuration, app settings, and external service configs
constants/ Static values, HTTP status codes, error messages, and app-wide constants
middleware/ Request processing middleware (auth, logging, validation, etc.)
services/ Business logic layer with reusable service modules
shared/ Cross-cutting utilities shared across the application
types/ TypeScript interfaces, types, and type guards
utils/ Helper functions and utility modules

Scripts

Script Description
dev Starts the app in development mode with live reloading
build Compiles TypeScript to JavaScript (CJS and ESM)
start Runs the compiled app
test Runs unit tests
test:cov Runs tests with coverage report
lint Runs ESLint to check and fix code style
format Formats code using Prettier

Path Aliases

The project uses path aliases for cleaner imports:

import { config } from '@/config';
import { HTTP_STATUS } from '@/constants';
import { getCurrentTimestamp } from '@/utils';

Docker

Build and run the application using Docker:

docker build -t template-node-typescript .
docker run -p 8080:8080 template-node-typescript

Built With

  • Node.js - JavaScript runtime (v22 LTS)
  • TypeScript - Typed superset of JavaScript
  • Jest - Testing framework
  • ESLint - Linting utility
  • Prettier - Code formatter

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A modern Node.js TypeScript template with a well-organized folder structure and best practices.

Topics

javascriptlearn-to-codetemplatetypescripttypescript-boilerplatetypescript-starter

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.