/typescript-express-starter

🚀 TypeScript Express Starter

Primary LanguageTypeScriptMIT LicenseMIT

logo

Express with TypeScript's Starter.

NPM Version Package License NPM Downloads


🤔 What is Express ?

Express is a fast, open and concise web framework and is a Node.js based project.

🧐 What is The package ?

Express consists of JavaScript, which makes it vulnerable to type definitions. That's why we avoid supersets with starter packages that introduce TypeScript.

The package is configured to use TypeScript instead of JavaScript.

NOTE: This project is a variation of express-generator-typescript by seanpmaxwell 👍

🚀 Quick Start

Install with the npm global package

$ npm install -g typescript-express-starter

Run npx to install the package

npx is a tool in the JavaScript package management module, npm.

This is a tool that allows you to run the npm package on a single run without installing the package.

If you do not enter a project name, it defaults to typescript-express-starter.

$ npx typescript-express-starter "project name"

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

Select a templates

example

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.

You may need to install nodemon separately if you do not currently have it installed on your machine.

⛑ Code Structure (default)

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

💳 License

MIT

🤝 Contributors