An open API service indexing awesome lists of open source software.

https://github.com/jamg44/typescript-starter

๐Ÿš€ Node.js Typescript starter
https://github.com/jamg44/typescript-starter

biome dotenv node node-js nvm pino typescript vitest zod

Last synced: about 2 months ago
JSON representation

๐Ÿš€ Node.js Typescript starter

Awesome Lists containing this project

README

          

# ๐Ÿš€ Node.js Typescript Starter

## ๐ŸŒŸ Introduction

Welcome to Node.js TypeScript Boilerplate 2025 โ€“ a simple and ready-to-use starting point for building backend services with TypeScript.

Based on: [express-typescript](https://github.com/edwinhern/express-typescript)

## ๐Ÿ’ก Why We Made This

This starter kit helps you:

- โœจ Start new projects faster
- ๐Ÿ“Š Write clean, consistent code
- โšก Build things quickly
- ๐Ÿ›ก๏ธ Follow best practices for security and testing

## ๐Ÿš€ What's Included

- ๐Ÿ“ Well-organized folders: Files grouped by feature so you can find things easily
- ๐Ÿ’จ Fast development: Quick code running with `tsx` and error checking with `tsc`
- ๐ŸŒ Latest Node.js: Uses the newest stable Node.js version from `.nvmrc`
- ๐Ÿ”ง Safe settings: Environment settings checked with Zod to prevent errors
- ๐Ÿ”— Short import paths: Clean code with easy imports using path shortcuts
- ๐Ÿ”„ Auto-updates: Keeps dependencies up-to-date with Renovate
- ๐Ÿ“Š Easy tracking: Built-in logging with `pino`
- ๐Ÿงช Ready-to-test: Testing tools with Vitest already set up
- โœ… Clean code: Consistent coding style with `Biomejs`
- ๐Ÿณ Easy deployment: Ready for Docker containers
- ๐Ÿ“ Input checking: Validation using Zod

## ๐Ÿ› ๏ธ Getting Started

### Step-by-Step Guide

#### Step 1: ๐Ÿš€ Initial Setup

To create an app, follow these steps:

```sh
npx degit jamg44/typescript-starter my-app
cd my-app
pnpm install
# Optional, setup your git repo:
git init && git add . && git commit -m 'feat: initial commit'
```

#### Step 2: โš™๏ธ Environment Configuration

- Create `.env`: Copy `.env.template` to `.env`
- Update `.env`: Fill in necessary environment variables

#### Step 3: ๐Ÿƒโ€โ™‚๏ธ Running the Project

- Development Mode: `pnpm dev`
- Building: `pnpm build`
- Production Mode: Set `NODE_ENV="production"` in `.env` then `pnpm build && pnpm start:prod`

## ๐Ÿค Feedback and Contributions

We'd love to hear your feedback and suggestions for further improvements. Feel free to contribute and join us in making backend development cleaner and faster!

๐ŸŽ‰ Happy coding!

## ๐Ÿ“ Folder Structure

```code
โ”œโ”€โ”€ biome.json
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ pnpm-lock.yaml
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ src
โ”‚ โ”œโ”€โ”€ common
โ”‚ โ”‚ โ””โ”€โ”€ utils
โ”‚ โ”‚ โ”œโ”€โ”€ __tests__
โ”‚ โ”‚ โ”œโ”€โ”€ commonValidation.ts
โ”‚ โ”‚ โ”œโ”€โ”€ envConfig.ts
โ”‚ โ”‚ โ””โ”€โ”€ logger.ts
โ”‚ โ””โ”€โ”€ index.ts
โ”œโ”€โ”€ tsconfig.json
โ””โ”€โ”€ vite.config.mts
```