Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mdkaifansari04/node_backend_template

A scalable Node.js backend template using TypeScript. Includes essential middleware, environment configuration, and testing tools to kickstart your projects.
https://github.com/mdkaifansari04/node_backend_template

eslint express jest mongosee nodejs nodemon prettier

Last synced: about 1 month ago
JSON representation

A scalable Node.js backend template using TypeScript. Includes essential middleware, environment configuration, and testing tools to kickstart your projects.

Awesome Lists containing this project

README

        

# Node.js Backend Template

This is a simple and scalable Node.js backend template designed to kickstart your project. It includes basic setup and common middleware, written in TypeScript.

## Features

- Basic Express server setup
- Environment variable configuration
- Essential middleware integration (e.g., compression, cors, helmet, morgan)
- TypeScript support
- Jest for testing
- Prettier for code formatting
- Structured folder layout for scalability

## Prerequisites

- Node.js (v14 or higher recommended)
- npm

## Installation

1. Clone the repository:
```bash
git clone https://github.com/mdkaifansari04/NODE_BACKEND_TEMPLATE.git
```

2. Navigate to the project directory:
```bash
cd your-repo-name
```

3. Install dependencies:
```bash
npm install
```

## Usage

### Start the development server:
```bash
npm run dev
```

### Start the production server:
```bash
npm start
```

The server will be running at: [http://localhost:5000](http://localhost:5000)

## Running Tests

To run tests:

```bash
npm test
```

To run tests in watch mode:

```bash
npm run test:watch
```

To check test coverage:

```bash
npm run test:coverage
```

## Formatting Code

To format the code with Prettier:

```bash
npm run format
```

## Project Structure

```plaintext
your-repo-name/
├── node_modules/
├── src/
│ ├── api/
│ │ └── v1/
│ │ ├── controllers/
│ │ ├── models/
│ │ └── routes/
│ ├── helpers/
│ ├── middleware/
│ ├── types/
│ ├── validation/
│ └── app.ts
├── .env
├── .gitignore
├── jest.config.js
├── package.json
├── tsconfig.json
├── README.md
└── ... (additional files)
```

## Contributing

Contributions are welcome! Please fork the repository and create a pull request.

## License

This project is licensed under the ISC License.