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

https://github.com/anwarhossainsr/node-express-template

A Node.js Express Template for rapid web app development. Features include Express.js, modular architecture, pre-configured middleware, environment setup, centralized error handling, and sample routes/controllers. Perfect for RESTful APIs or web apps. Fork and customize!
https://github.com/anwarhossainsr/node-express-template

api backend-api boilerplate eslint express express-node-template expressjs mongodb node-express nodejs project-structure project-template rest-api swagger swagger-ui-express template typescript

Last synced: 11 months ago
JSON representation

A Node.js Express Template for rapid web app development. Features include Express.js, modular architecture, pre-configured middleware, environment setup, centralized error handling, and sample routes/controllers. Perfect for RESTful APIs or web apps. Fork and customize!

Awesome Lists containing this project

README

          

Table of Contents



  1. About The Project



  2. Getting Started


  3. Usage

  4. Roadmap

  5. Contributing

  6. License

  7. Contact

  8. Acknowledgments

## About The Project

# Express API Boilerplate

This project is a boilerplate for creating RESTful APIs using **Node.js**, **Express**, and **TypeScript**. It is designed to help you quickly set up a solid foundation for your API development, with a focus on best practices and maintainability.

### Built With

This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.

- ![Node.js](https://img.shields.io/badge/Node.js-18.x-green)
- ![Express](https://img.shields.io/badge/Express-4.18.2-lightgrey)
- ![TypeScript](https://img.shields.io/badge/TypeScript-5.2.2-blue)
- ![Yarn](https://img.shields.io/badge/Yarn-1.22.0-2c8ebb)
- ![ESLint](https://img.shields.io/badge/ESLint-8.48.0-purple)
- ![Prettier](https://img.shields.io/badge/Prettier-3.0.3-ff69b4)
- ![Swagger](https://img.shields.io/badge/Swagger-UI%20Express-5.0.0-brightgreen)
- ![Mongoose](https://img.shields.io/badge/Mongoose-7.5.0-red)
- ![JWT](https://img.shields.io/badge/JSONWebToken-9.0.2-orange)
- ![Joi](https://img.shields.io/badge/Joi-17.10.0-yellow)

(back to top)

## Features

- **Express 4.18.2**: A fast, unopinionated, minimalist web framework for Node.js.
- **TypeScript 5.2.2**: Strongly typed JavaScript that compiles to plain JavaScript.
- **Yarn 1.22.0**: Fast, reliable, and secure dependency management.
- **ESLint 8.48.0** & **Prettier 3.0.3**: Code quality tools for maintaining a consistent codebase.
- **JWT 9.0.2**: Secure authentication and authorization with JSON Web Tokens.
- **Joi 17.10.0**: Schema validation for API request bodies.
- **Swagger UI Express 5.0.0**: Auto-generated API documentation.
- **Mongoose 7.5.0**: Elegant MongoDB object modeling for Node.js.

## Setup

1. **Clone the repository**:
```bash
git clone https://github.com/yourusername/express-api-boilerplate.git
cd express-api-boilerplate
```

2. **Install dependencies**:
```bash
yarn install
```

3. **Environment setup**:
- Create a `.env` file based on the `.env.example` template.

4. **Running the application**:
- **Development**:
```bash
yarn dev
```
- **Production**:
```bash
yarn start
```

5. **Linting and formatting**:
```bash
yarn eslint
yarn prettier
```

6. **Testing**:
- *(Include testing instructions if applicable)*

## Scripts

- `yarn dev`: Starts the development server with TypeScript watch mode.
- `yarn build`: Compiles TypeScript to JavaScript.
- `yarn start`: Runs the compiled application.
- `yarn eslint`: Lints the codebase using ESLint.
- `yarn prettier`: Formats the codebase using Prettier.

(back to top)

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

(back to top)

## License

Distributed under the MIT License. See `LICENSE.txt` for more information.

(back to top)