Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/mdkaifansari04/node_backend_template
- Owner: mdkaifansari04
- Created: 2024-07-18T22:42:24.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-08-16T10:14:31.000Z (3 months ago)
- Last Synced: 2024-10-13T06:41:16.168Z (about 1 month ago)
- Topics: eslint, express, jest, mongosee, nodejs, nodemon, prettier
- Language: JavaScript
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.