Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/abdrahmanes1/express-api-initializer

express-api-inializer used for generate Express js app
https://github.com/abdrahmanes1/express-api-initializer

cli cli-app express express-cli express-crud expressjs npm npm-package npmjs typescript

Last synced: about 1 month ago
JSON representation

express-api-inializer used for generate Express js app

Awesome Lists containing this project

README

        

# Express API Initializer

Express API Initializer is a tool designed to streamline the process of generating Express.js applications.

## Installation

Ensure you have [node.js](https://nodejs.org/)) installed, then install express-api-initializer globally using [npm](https://www.npmjs.com/):

```bash
npm install -g express-api-initializer
```

To create a new project, run:

```bash
express-initializer new
```
Your app structure will be initialized as follows:


📦 app
┣ 📂 config
┃ ┗ 📜 database.config.js
┣ 📂 src
┃ ┣ 📂 controllers
┃ ┃ ┗ 📜 users.controller.js
┃ ┣ 📂 middlewares
┃ ┃ ┣ 📜 error.middleware.js
┃ ┃ ┣ 📜 users.middleware.js
┃ ┃ ┗ 📜 validationMiddleware.middleware.js
┃ ┣ 📂 models
┃ ┃ ┗ 📜 users.model.js
┃ ┣ 📂 schemas
┃ ┃ ┗ 📜 users.schema.js
┃ ┣ 📂 routes
┃ ┃ ┗ 📜 users.route.js
┃ ┣ 📂 utils
┃ ┃ ┗ 📜 errorResponse.js
┃ ┗ 📜 app.js
┣ .env.example
┣ .env
┣ 📜 index.js
┗ 📜 package.json

To start the app, navigate to the project directory and run:

```bash
node index.js

## Resource Generation

Generate resources using plural nouns:

```bash
express-initializer g resource
```

## Controller Generation

Generate controllers using:

```bash
express-initializer g controller
```

## Model Generation

Generate models using:

```bash
express-initializer g model
```

## Validation Schema Generation

Generate schema using:

```bash
express-initializer g schema
```

## Route Generation

Generate routes using:

```bash
express-initializer g route
```
## Middleware Generation

Generate middleware using:

```bash
express-initializer g middleware
```

## Configuration Generation

Generate configs using:

```bash
express-initializer g config
```

Feel free to use these commands to efficiently scaffold and organize your Express.js applications.