Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manjillama/node-typescript-starter
Complete beginner-friendly TypeScript, Express/Node.js, MongoDB application boilerplate setup along with error logger, linters, pre-commit hooks, and unit/integration tests using jest.
https://github.com/manjillama/node-typescript-starter
boilerplate-node eslint expressjs husky jest mongoose nodejs typescript winston-logger
Last synced: 24 days ago
JSON representation
Complete beginner-friendly TypeScript, Express/Node.js, MongoDB application boilerplate setup along with error logger, linters, pre-commit hooks, and unit/integration tests using jest.
- Host: GitHub
- URL: https://github.com/manjillama/node-typescript-starter
- Owner: manjillama
- License: mit
- Created: 2020-09-13T15:14:24.000Z (over 4 years ago)
- Default Branch: dev
- Last Pushed: 2023-03-22T15:27:59.000Z (almost 2 years ago)
- Last Synced: 2024-11-21T07:19:26.695Z (3 months ago)
- Topics: boilerplate-node, eslint, expressjs, husky, jest, mongoose, nodejs, typescript, winston-logger
- Language: TypeScript
- Homepage:
- Size: 250 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Complete TypeScript, Express/Node.js application boilerplate setup along with error logger, linters, pre-commit hooks, and unit/integration tests using jest.## Folder structure
```
|-- migrations # Database migration dir
|-- tests # All unit and integration test files goes here
|-- .husky # Husky hooks for git pre-commits for lint check
|-- src
| index.js # App entry point
| app.js # Load express application modules
|-- config # Environment variables and configuration related stuff
|-- constants # App constants
|-- controllers # Express route controllers
|-- interfaces # TypeScript interfaces
|-- middlewares # Express middlewares
|-- models # Mongoose models
|-- routes # Express routes
|-- services # Service modules
|-- startup # Split the startup process into modules
|-- types # Shared TypeScript types
|-- utils # Shared utilities modules
```## Requirements
- NodeJS >= 14.x
- Yarn >= 1.x
- MongoDB >= 5.x## Setup
First of all, you need to check if you're using the required versions of Node.js and npm
Then, please follow the instructions below:
### Clone the repo:
```bash
$ git clone https://github.com/manjillama/typescript-node-boilerplate.git$ cd typescript-node-boilerplate
```Install dependencies:
```bash
$ yarn
```Set environment variables:
```bash
$ cp .env.example .env
```Import sample documents
```bash
$ yarn seed:import
```### Running Locally
```bash
$ yarn dev
```## Available Scripts
In the project directory, you can run:
### Lint
```bash
# lint code with ESLint
$ yarn lint# try to fix ESLint errors
$ yarn lint:fix
```### Test
```bash
# run all tests with Mocha
$ yarn test
```### Validate
```bash
# run lint and tests
$ yarn validate
```### Run debugger
```bash
$ yarn debug
```### Populate database collections with sample documents
```bash
$ yarn seed:import
```### Clear all database documents
```bash
$ yarn seed:delete
```## Contributing guide
Read our [contributing guide](./CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes.
## License
Licensed under the [MIT License](./LICENSE).