Skip to content

mdkaifansari04/NODE_BACKEND_TEMPLATE

Repository files navigation

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:

    git clone https://github.com/mdkaifansari04/NODE_BACKEND_TEMPLATE.git
  2. Navigate to the project directory:

    cd your-repo-name
  3. Install dependencies:

    npm install

Usage

Start the development server:

npm run dev

Start the production server:

npm start

The server will be running at: http://localhost:5000

Running Tests

To run tests:

npm test

To run tests in watch mode:

npm run test:watch

To check test coverage:

npm run test:coverage

Formatting Code

To format the code with Prettier:

npm run format

Project Structure

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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors