npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

express-boilerplate-starter

v1.0.9

Published

Express Boilerplate Starter is a boilerplate project designed to help you quickly set up a new Express.js project with TypeScript. It includes pre-configured settings and dependencies for a seamless development experience.

Downloads

8

Readme

Express Boilerplate Starter

Express Boilerplate Starter is a boilerplate project designed to help you quickly set up a new Express.js project with TypeScript. It includes pre-configured settings and dependencies for a seamless development experience.

Table of Contents

Getting Started

To get started with Express Boilerplate Starter, follow these steps:

  1. Use npx to create a new project based on the starter:

    npx express-boilerplate-starter your_project_name

    This command will create a new directory with the specified name (your_repo_name), set up the project inside it, and install all the dependencies.

  2. Navigate into the newly created directory:

    cd your_project_name
  3. Change some values in package.json to meet your project needs. You can modify the project name, description, author, and other configurations as necessary.

  4. Create .env file using the provided example in .env.example.

  5. Customize the README file to provide information specific to your project.

  6. Start the development server:

    npm run dev

Usage

After setting up your project, you can use the provided scripts and configuration to start developing your Express application. Here are the scripts below:

  • npm run dev: Start the development server with hot reloading.

  • npm run start: Run the production build of the project.

  • npm run lint: Run ESLint to lint TypeScript files.

  • npm run lint:fix: Run ESLint to lint TypeScript files and automatically fix fixable issues.

  • npm run build: Build the project for production.

  • npm run prettier-watch: Automatically format TypeScript files using Prettier on file change.

  • npm run prettier:fix: Format all TypeScript files using Prettier.

  • npm run prepare: Trigger Husky to set up Git hooks.

Customization

Create Express Boilerplate Starter can be customized to fit your specific requirements. You can modify configuration files, add or remove features, and integrate additional libraries or tools as needed.

Custom Folder Structure

The project follows a customized folder structure to organize its source code and resources efficiently. Here's an overview of the folder structure:

  • src/common/: Contains common files and utilities used across the project, such as jwtHelper.ts for custom user authentication token utils and sendResponse.ts for fetch data.
  • src/app/modules/: Contains resources organized by domain, with each resource folder containing model.ts, interface.ts, controller.ts, and routes.ts files for that specific resource.
  • src/app/middlewares/: Contains middleware functions used in the Express application such as authMiddleware.ts for check valid user, globalErrorHandler for handle any error of api and validateRequest for check valid user input.
  • src/app/routes: Contains routes are main file who integrate all individual routes.
  • src/config/index: Contains config index.ts file are managing environment variables.
  • src/error/: Contains error folder to handle api error.
  • src/interface: Contains interface folder including to catchAsync.ts to handle api validation, common.ts to handle common uses function, error.ts are used to handle incoming api errors.
  • src/server.ts: Entry point for the Express server.
  • src/app.ts: Defines the Express application.

Additional Files

  • .env.example: Example environment variables file.
  • .gitignore: Git ignore rules.
  • package.json: Node.js dependencies and scripts.
  • README.md: Project documentation.
  • tsconfig.json: TypeScript configuration file.

This folder structure provides a clear organization for the project's source code and resources, making it easier to navigate and maintain as the project grows.

Features

  • TypeScript Support: Write your Express application using TypeScript for enhanced type safety and developer productivity.

  • Express.js Integration: Utilize the powerful features of Express.js to build robust and scalable web applications.

  • Mongoose Integration: Seamlessly connect your Express application to MongoDB databases using Mongoose for data modeling and interaction.

  • Nodemon Development: Use Nodemon for automatic server restarts during development for a smooth development experience.

  • Prettier Formatting: Maintain consistent code style and formatting with Prettier, an opinionated code formatter.

  • Husky Git Hooks: Enforce code quality and standards with Husky pre-commit hooks for linting and formatting checks.

  • GitHub Actions CI: Set up continuous integration with GitHub Actions to automate testing and deployment workflows.

Contributing

Contributions to Create Express TypeScript Starter are welcome! To contribute, please follow these steps:

  1. Fork the repository and create a new branch.
  2. Make your changes and ensure that the code passes all tests.
  3. Submit a pull request with a clear description of the changes you've made.

Credits

Express Boilerplate Starter was created by Safar Khan Shuvo and is maintained by the open-source community.

License

Express Boilerplate Starter is licensed under the Apache-2.0 license.