backforge
v2.1.3
Published
A Command Line tool for creating a template of express api web server
Downloads
5
Maintainers
Readme
Backforge
Backforge is a templating tool designed for backend development, specifically for generating Express-based templates.
Getting Started
To get started with Backforge, open your command prompt and run one of the following commands using your preferred package manager:
npx backforge
#or
yarn dlx backforge
After running the command, you may be prompted to answer a few questions in the terminal. Once completed, you'll have a ready-to-use Express template.
Module generation
Introducing new feature, Module Creation. This feature allows you to easily generate JavaScript and TypeScript modules with built-in CRUD operations and their corresponding routes.
How to Use
To create a module, run the following command from your project directory:
npx backforge -m <module-name>
#or if you have specific destination for modules
npx backforge -m <module-name> -d <destination>
Naming Constraints
Please note that module names must adhere to the following rules:
- The module name must not start with a number.
- The module name must not contain any symbols
- The destination is in path format(ex. path/to/modules)
Command options
Usage: backforge [project-directory] [options]
Options:
-v, --version Output the current version of backforge.
-m, --module <module-name> Creates a module for default express template of backforge
-d, --dest <destination> Destination path for module creation note: it does not work app generation
-js, --javascript Initialize express app with javascript template
--basic Initialize with basic template of express app
--disable-git Skip initializing a git repository.
-h, --help Display this help message.
Available templates
Backforge currently offers two types of templates:
basic
- js
default
- js
- ts
basic template
The basic template includes the following file and folder structure:
basic
|
├── configs
| ├── index.js(blank)
| :
├── controllers
| ├── test.controller.js
| :
├── middleware
| ├── security.middleware.js
| :
├── models
| ├── test.model.js
| :
├── routes
| ├── index.js
| ├── test.route.js
| :
├── utils
| ├── utils.js(blank)
| :
├── app.js
├── index.js
:
:
default template
The default template is available in both TypeScript and JavaScript and includes the following structure:
default
|
├── configs
| ├── error.ts
| :
├── middleware
| ├── security.middleware.ts
| :
├── modules
| ├── users
| | ├── user.controller.ts
| | ├── user.model.ts
| | ├── user.route.ts
| | └── user.service.ts
| :
├── routes
| ├── index.ts
| :
├── types
| ├── response.type.ts
| :
├── utils
| ├── catchAsync.ts
| ├── sendResponse.ts
| :
├── app.ts
├── index.ts
:
:
Contributing
This project is open-source and backforge welcomes contributions from everyone! Whether you're a seasoned developer or just starting out, your ideas and input are invaluable. Join us in shaping the future of Backforge—let's build something amazing together!
To request new feature open an issue on github. Contribute by report an issue or creating a PR or bug fix to backforge.
See Contributing Guidelines for more information on how to get involved and how to get compensated
License
You can check out the full license here
This project is licensed under the terms of the MIT license.