/node-ts

Primary LanguageTypeScript

Node.js + TypeScript Starter

Key Features

Prerequisites

Getting Started

  1. Deploy on Railway or use this template

  2. Clone the repository

  3. Install dependencies

    pnpm i
  4. Create environment file env.ts at the root

    export default {
      PORT: "3000",
    };

    Optionally typecheck environment with zod

    import { z } from "zod";
    
    z.object({
      PORT: z.coerce.number(),
      URL: z.string().url(),
      UUID: z.string().uuid(),
      EMAIL: z.string().email().optional(),
    }).parse(process.env);

Usage

  • Development mode (debug)

    pnpm dev
  • Production build

    pnpm build && pnpm start