Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
/ skeletos Public

A Node.js, Express, TypeScript project skeleton.

License

Notifications You must be signed in to change notification settings

gvre/skeletos

Repository files navigation

Skeletos - A Node.js, Express, TypeScript project skeleton

This is a skeleton project for building applications using Node.js, Express, and TypeScript. It comes pre-configured with essential tools and libraries, including TypeScript, ESLint, Prettier, Vitest, and Docker, to help you get started quickly and maintain code quality.

Table of Contents

Features

  • TypeScript for type safety
  • Express for building web applications
  • ESLint for linting and code quality
  • Prettier for code formatting
  • Vitest for testing
  • Docker for containerization
  • Husky with lint-staged for pre-commit hooks

Prerequisites

Before you begin, ensure you have the following installed:

Installation

  1. Install nvm (if you haven't already):

Follow the instructions in the nvm repository to install nvm.

  1. Clone the repository:
git clone https://github.com/gvre/skeletos.git
  1. Navigate to the project directory:
cd skeletos
  1. Install Node.js using nvm:
nvm install
  1. Enable corepack:
corepack enable
  1. Install the dependencies:
pnpm install --frozen-lockfile

Configuration

TypeScript

The TypeScript configuration is located in tsconfig.json. It includes settings for compiling TypeScript using strict rules.

ESLint

ESLint is configured in eslint.config.js. It helps maintain code quality by enforcing coding standards. You can customize the rules as needed.

Prettier

Prettier is configured in .prettierrc. It ensures consistent code formatting across the project. You can adjust the settings to fit your preferences.

Vitest

Vitest is configured in vitest.config.ts. It is set up for testing TypeScript files.

Docker

The project includes a Dockerfile for containerization. This allows you to build and run your application in a Docker container.

Pre-commit Hooks

The project uses Husky with lint-staged to automatically format code before commits. The pre-commit hook runs Prettier on staged files to ensure consistent code formatting.

To set up pre-commit hooks (if not already configured):

npx husky init
echo "pnpm exec lint-staged" > .husky/pre-commit
chmod +x .husky/pre-commit

The lint-staged configuration in package.json formats TypeScript, JavaScript, Markdown, and YAML files automatically on commit.

Usage

The following scripts are available in package.json:

  • pnpm run build: Compiles the TypeScript files to do syntax checking.
  • pnpm run start: Starts the application in production mode.
  • pnpm run dev: Starts the application in development mode with hot reloading.
  • pnpm run test: Runs the Vitest test suite.
  • pnpm run lint: Runs ESLint to check
  • pnpm run lint:circular: Runs Madge to check for circular dependencies.
  • pnpm run lint:all: Runs ESLint and Madge.

License

About

A Node.js, Express, TypeScript project skeleton.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published