npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

typescript-express-starter

v10.2.1

Published

Quick and Easy TypeScript Express Starter

Downloads

697

Readme

😎 프로젝트를 소개합니다.

Express는 유형 정의에 취약한 JavaScript로 구성 되어있습니다.

이것이 바로 TypeScript를 도입하는 스타터 패키지로 수퍼 세트를 피하는 이유입니다.

패키지는 JavaScript 대신 TypeScript를 사용하도록 구성되어 있습니다.

참고 : express-generator-typescript

🤔 Express는 무엇인가요 ?

Node.js를 위한 빠르고 개방적인 간결한 웹 프레임워크입니다.

🚀 시작하기

npm 전역 설치

$ npm install -g typescript-express-starter

npx를 통해 프로젝트를 설치

프로젝트 이름을 입력하지 않으면, 기본값으로 typescript-express-starter 폴더로 설치됩니다.

$ npx typescript-express-starter "project name"

원하시는 템플릿을 선택

설치가 완료되면 Script 명령어를 통해 프로젝트를 실행합니다.

템플릿 종류

| 이름 | 설명 | | :---------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Default | Express 기본 | | routing controllers | 데코레이터 사용량이 많은 구조화되고 선언적이며 아름답게 구성된 클래스 기반 컨트롤러 생성 | | Sequelize | PostgreSQL, MySQL, MariaDB, SQLite, Microsoft SQL Server를 지원하는 Promise 패턴 기반의 Node.js ORM | | Mongoose | Node.js와 MongoDB를 위한 ODM(Object Data Mapping) 라이브러리 | | TypeORM | 자바스크립트, 타입스크립트과 함께 사용되어 Node.js, React Native, Expo에서 실행될 수 있는 ORM | | Prisma | 데이터베이스에 데이터를 프로그래밍 언어의 객체와 매핑하여 기존에 SQL로 작성하던 데이터를 수정, 테이블 구조 변경등의 작업을 객체를 통해 프로그래밍적으로 할 수 있도록 해주는 ORM | | Knex | 쿼리 빌더를 위한 라이브러리 | | GraphQL | API 용 쿼리 언어이며 기존 데이터로 이러한 쿼리를 수행하기위한 런타임 | | Typegoose | 타입스크립트 클래스를 사용하여 몽구스 모델 정의 | | Mikro ORM | 데이터 매퍼, 작업 단위 및 아이덴티티 맵 패턴을 기반으로 하는 Node.js용 TypeScript ORM. MongoDB, MySQL, MariaDB, PostgreSQL 및 SQLite 데이터베이스를 지원 | | Node Postgres | PostgreSQL 데이터베이스와 인터페이스하기 위한 node.js 모듈 |

추후 개발 할 템플릿

| 이름 | 설명 | | :------------------------------------------------------------------------------ | :------------------------------------------------------------------ | | Sequelize Typescript | 데코레이터 및 Sequelize를 위한 몇 가지 기능 | | TS SQL | SQL 데이터베이스는 TypeScript 유형 주석으로 순전히 구현 | | inversify-express-utils | InversifyJS를 사용한 Express 애플리케이션 개발을 위한 일부 유틸리티 | | postgress Typescript | | | graphql-prisma | |

🛎 Script 명령어

  • 프로덕션 모드 실행 : npm run start 아니면 Start typescript-express-starter VS Code 로
  • 개발 모드 실행 : npm run dev 아니면 Dev typescript-express-starter VS Code 로
  • 단위 테스트 : npm test 아니면 Test typescript-express-starter VS Code 로
  • 코드 포맷터 검사 : npm run lint 아니면 Lint typescript-express-starter VS Code 로
  • 코드 포맷터 적용 : npm run lint:fix 아니면 Lint:Fix typescript-express-starter VS Code 로

💎 프로젝트 기능

🐳 Docker :: 컨테이너 플랫폼

Docker란, 컨테이너 기반의 오픈소스 가상화 플랫폼이다.

설치 홈페이지에 접속해서 설치를 해줍니다.

  • 백그라운드에서 컨테이너를 시작하고 실행 : docker-compose up -d
  • 컨테이너를 중지하고 컨테이너, 네트워크, 볼륨 및 이미지를 제거 : docker-compose down

수정을 원하시면 docker-compose.ymlDockerfile를 수정해주시면 됩니다.

♻️ Nginx :: 웹 서버

Nginx 역방향 프록시,로드 밸런서, 메일 프록시 및 HTTP 캐시로도 사용할 수있는 웹 서버입니다.

프록시는 일반적으로 여러 서버에로드를 분산하거나, 다른 웹 사이트의 콘텐츠를 원활하게 표시하거나, HTTP 이외의 프로토콜을 통해 처리 요청을 애플리케이션 서버에 전달하는 데 사용됩니다.

Nginx 요청을 프록시하면 지정된 프록시 서버로 요청을 보내고 응답을 가져 와서 클라이언트로 다시 보냅니다.

수정을 원하시면 nginx.conf 파일을 수정해주시면 됩니다.

✨ ESLint, Prettier :: 정적 코드 분석 및 코드 스타일 변환

ESLint는 JavaScript 코드에서 발견 된 문제 패턴을 식별하기위한 정적 코드 분석 도구입니다.

Prettier는 개발자가 작성한 코드를 정해진 코딩 스타일을 따르도록 변환해주는 도구입니다.

코드를 구문 분석하고 최대 줄 길이를 고려하여 필요한 경우 코드를 래핑하는 자체 규칙으로 다시 인쇄하여 일관된 스타일을 적용합니다.

  1. VSCode Extension에서 Prettier, ESLint 설치합니다.

  2. 설치가 완료되면, 단축키 CMD + Shift + P (Mac Os) 또는 Ctrl + Shift + P (Windows) 입력합니다.

  3. Format Selection With 선택합니다.

  4. Configure Default Formatter... 선택합니다.

  5. Prettier - Code formatter 적용합니다.

2019년, TSLint 지원이 종료 되어 ESLint를 적용하였습니다.

📗 Swagger :: API 문서화

Swagger는 개발자가 REST 웹 서비스를 설계, 빌드, 문서화, 소비하는 일을 도와주는 대형 도구 생태계의 지원을 받는 오픈 소스 소프트웨어 프레임워크이다.

API를 대규모로 설계하고 문서화하는 데 용이하게 사용합니다.

Swagger URL은 http://localhost:3000/api-docs 으로 작성했습니다.

수정을 원하시면 swagger.yaml 파일을 수정해주시면 됩니다.

🌐 REST Client :: HTTP Client 도구

REST 클라이언트를 사용하면 HTTP 요청을 보내고 Visual Studio Code에서 직접 응답을 볼 수 있습니다.

VSCode Extension에서 REST Client 설치합니다.

수정을 원하시면 src/http 폴더 안에 *.http 파일을 수정해주시면 됩니다.

🔮 PM2 :: 웹 애플리케이션을 운영 및 프로세스 관리자

PM2란, 서버에서 웹 애플리케이션을 운영할 때 보통 데몬으로 서버를 띄워야 하고 Node.js의 경우 서버가 크래시나면 재시작을 하기 위해서 워치독(watchdog) 류의 프로세스 관리자이다.

  • 프로덕션 모드 :: npm run deploy:prod 또는 pm2 start ecosystem.config.js --only prod
  • 개발 모드 :: npm run deploy:dev 또는 pm2 start ecosystem.config.js --only dev

수정을 원하시면 ecosystem.config.js 파일을 수정해주시면 됩니다.

🏎 SWC :: 강하고 빠른 자바스크립트 / 타입스크립트 컴파일러

SWC는 차세대 고속 개발자 도구를 위한 확장 가능한 Rust 기반 플랫폼입니다.

SWC는 단일 스레드에서 Babel보다 20배, 4개 코어에서 70배 빠릅니다.

  • tsc 빌드 :: npm run build
  • swc 빌드 :: npm run build:swc

수정을 원하시면 .swcrc 파일을 수정해주시면 됩니다.

💄 Makefile :: Linux에서 반복 적으로 발생하는 컴파일을 쉽게하기위해서 사용하는 make 프로그램의 설정 파일

  • 도움말 :: make help

수정을 원하시면 Makefile 파일을 수정해주시면 됩니다.

🗂 코드 구조 (default)

│
├──📂 .vscode
│  ├── launch.json
│  └── settings.json
│
├──📂 src
│  ├──📂 config
│  │  └── index.ts
│  │
│  ├──📂 controllers
│  │  ├── auth.controller.ts
│  │  └── users.controller.ts
│  │
│  ├──📂 dtos
│  │  └── users.dto.ts
│  │
│  ├──📂 exceptions
│  │  └── httpException.ts
│  │
│  ├──📂 http
│  │  ├── auth.http
│  │  └── users.http
│  │
│  ├──📂 interfaces
│  │  ├── auth.interface.ts
│  │  ├── routes.interface.ts
│  │  └── users.interface.ts
│  │
│  ├──📂 middlewares
│  │  ├── auth.middleware.ts
│  │  ├── error.middleware.ts
│  │  └── validation.middleware.ts
│  │
│  ├──📂 models
│  │  └── users.model.ts
│  │
│  ├──📂 routes
│  │  ├── auth.route.ts
│  │  └── users.route.ts
│  │
│  ├──📂 services
│  │  ├── auth.service.ts
│  │  └── users.service.ts
│  │
│  ├──📂 test
│  │  ├── auth.test.ts
│  │  └── users.test.ts
│  │
│  ├──📂 utils
│  │  ├── logger.ts
│  │  └── vaildateEnv.ts
│  │
│  ├── app.ts
│  └── server.ts
│
├── .dockerignore
├── .editorconfig
├── .env.development.local
├── .env.production.local
├── .env.test.local
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .huskyrc
├── .lintstagedrc.json
├── .prettierrc
├── .swcrc
├── docker-compose.yml
├── Dockerfile.dev
├── Dockerfile.prod
├── ecosystem.config.js
├── jest.config.js
├── Makefile
├── nginx.conf
├── nodemon.json
├── package-lock.json
├── package.json
├── swagger.yaml
└── tsconfig.json

⭐️ 응원해주신 분들

Stargazers repo roster for @ljlm0402/typescript-express-starter

🍴 참고하시는 분들

Forkers repo roster for @ljlm0402/typescript-express-starter

🤝 도움주신 분들

Contributors repo roster for @ljlm0402/typescript-express-starter

💳 라이선스

MIT

📑 커밋 메시지 정의

| 언제 | 메시지 | | :----------------- | :-------------------- | | 기능 추가 | ✨ 기능 추가 | | 버그 수정 | 🐞 버그 수정 | | 코드 개선 | 🛠 코드 개선 | | 패키지 설치 | 📦 패키지 설치 | | 문서 수정 | 📚 문서 수정 | | 버전 업데이트 | 🌼 버전 업데이트 | | 새로운 템플릿 추가 | 🎉 새로운 템플릿 추가 |

📬 이슈를 남겨주세요

건의 사항이나 질문 등을 이슈로 남겨주세요.

최선을 다해 답변하고 반영하겠습니다.

관심을 가져주셔서 감사합니다.

ദ്ദിˊᗜˋ)