A minimalistic starter-kid based on TypeScript language
After confirming that your environment meets the above requirements, it is time to clone the project locally by doing the following:
$ git clone [email protected]:DeanHristov/typescript-starter-kit.git <project-name>
$ cd <project-name>
When you're done with the steps above, run the following command:
$ npm install # or yarn install
The project structure presented in this boilerplate is flatten, where functionality is grouped primarily by feature rather than the file type.
├── build # Auto-generated directory. Contains **production-ready** code.
│ └── *.js
│ └── [dir-name] # Sub directory
│ └── *.js
├── src # Application source code is stored here.
│ ├── [dir-name] # Sub directory that contains files (in Typescript) format.
│ └── [filename].ts
│ ├── [filename].ts
│ ├── index.ts # The entry point of the app.
├── .env # App-related ENV variables are stored here. MUST be created manually!
├── .env.example # A template which contains important variables for the app.
├── .eslintignore # Config file for ESLint
├── .eslintrc # Config file for ESLint
├── .gitignore # Config file for GIT
├── .prettierrc # Config file for Prettier
├── jest.config.js # Config file for Jestjs
├── nodemon.json # Config file for nodemon
├── package.json # The heart of the app. It holds important metadata about a project like scripts dependencies
├── package-lock.json # Place where we controls the dependencies
├── README.md # A documentation file
├── tsconfig.json # Config file for typescript
All tasks automation are based on NPM scripts.
Tasks | Description |
---|---|
npm run start:dev |
Running the app in dev mode |
npm run build |
Building the code in production-ready mode |
npm run start |
Running the app in prod mode |
npm run test |
Running the unit tests ( using jest) |
npm run test:watch |
Running the unit with --watchAll mode ( using jest) |
npm run prettier-format |
Code formatting |
Running the app in development mode.
$ npm run start:dev
Firstly, build the app with the following command:
$ npm run build
Running the app in development mode.
$ npm start
- NodeJS- https://nodejs.org/en/
- Git - https://git-scm.com/
- TypeScript - https://www.typescriptlang.org/
- typescript
- prettier
- ts-jest
- jest
- ts-node
- nodemon
- rimraf
- eslint
- eslint-config-prettier
- eslint-plugin-jest
- eslint-plugin-prettier
Author: D. Hristov | Version: v1.0.0