Skip to content

Yeri-Kim/typescript-express-starter

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo

Express with TypeScript's application generator.

NPM Version Package License NPM Downloads


🧐 What is it?

Creates a new typescript express application. application is configured to use TypeScript instead of plain JavaScript.

πŸ€” Why typescript-express-starter?

Node Js is great for the rapid development of web-projects, but is often neglected because of the lack of type safety. TypeScript solves this issue and (along with its linter file) can even make your code more robust than some other static languages like Java.

βš™οΈ Installation

$ npm install -g typescript-express-starter

πŸš€ Quick Start

The quickest way to get started is use npx and pass in the name of the project you want to create. If you don't specify a project name, the default typescript-express-starter will be used instead.

1. Create the app

$ npx typescript-express-starter "project name"

Choose the template you want. We will create more templates later.

2. Select a templates

? Select a templates (Use arrow keys)
> default
  mongoose
--------------------

Start your typescript-express-starter app in development mode at http://localhost:3000/

$ cd "project name" && npm run start

🎠 Available commands for the server.

  • Run the Server in production mode : npm run start.
  • Run the Server in development mode : npm run dev.
  • Run all unit-tests: npm run test.
  • Check for linting errors: npm run lint.

β›‘ Code Structure (default)

β”‚
β”œβ”€β”€ /src
β”‚   β”œβ”€β”€ /controllers
β”‚   β”‚   β”œβ”€β”€ index.controller.ts
β”‚   β”‚   └── users.controller.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ /dtos
β”‚   β”‚   └── user.dto.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ /exceptions
β”‚   β”‚   └── HttpException.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ /interfaces
β”‚   β”‚   β”œβ”€β”€ routes.interface.ts
β”‚   β”‚   └── user.interface.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ /middlewares
β”‚   β”‚   β”œβ”€β”€ error.middleware.ts
β”‚   β”‚   └── validation.middleware.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ /models
β”‚   β”‚   └── users.model.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ /routes
β”‚   β”‚   β”œβ”€β”€ index.route.ts
β”‚   β”‚   └── users.route.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ /services
β”‚   β”‚   └── user.service.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ /tests
β”‚   β”‚   β”œβ”€β”€ index.test.ts
β”‚   β”‚   └── users.test.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ /utils
β”‚   β”‚   β”œβ”€β”€ util.ts
β”‚   β”‚   └── vaildateEnv.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ app.ts
β”‚   └── server.ts
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ jest.config.js
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── tslint.json

License

MIT

Contributors

Packages

No packages published

Languages

  • TypeScript 83.7%
  • JavaScript 16.3%