Table of Contents
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.
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.
- 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.
-
Clone the repository:
git clone https://github.com/yourusername/express-api-boilerplate.git cd express-api-boilerplate
-
Install dependencies:
yarn install
-
Environment setup:
- Create a
.env
file based on the.env.example
template.
- Create a
-
Running the application:
- Development:
yarn dev
- Production:
yarn start
- Development:
-
Linting and formatting:
yarn eslint yarn prettier
-
Testing:
- (Include testing instructions if applicable)
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.
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.