FumCLI is a Command Line Interface (CLI) tool that generates boilerplate code for a Node.js and React project. With FumCLI, developers can easily create a starter Express server, CRUD operations for an entity, and generate the necessary files and folders for a full-stack web application.
To use FumCLI, you must have Node.js installed. Once Node.js is installed, you can install FumCLI globally using npm:
npm install -g fumcli
FumCLI provides several commands that generate different types of boilerplate code.
To create a starter Express server, use the -s or --starter flag:
fumcli -s
This command generates the following files and directories:
- config.env
- app.js
- server.js
- controllers/handlerFactory.js
- controllers/errorController.js
- utils/appError.js
- utils/apiFeatures.js
- utils/catchAsync.js
- routes/
- models/
- img/
To generate CRUD operations for an entity, use the gen-crud command:
fumcli gen-crud -n <entity_name> -a <attributes>
The -n or --name option specifies the name of the entity. The -a or --attributes option specifies the attributes of the entity in the format of name:type,name:type,....
The following additional options are also available:
- -m or --models: Generate models for the entity
- -c or --controller: Generate a controller for the entity
- -r or --routes: Create routes folder
To add a user feature to the existing starter template, use the add-user command:
fumcli add-user -t <template_number>
The -t or --template option specifies the number of the template you want to use. By default, it selects template 1. This command generates the necessary files and folders for the user feature, including frontend pages and backend models and APIs. It automatically integrates and applies authentication using JWT.
To display help information, use the -h or --help option:
fumcli -h
This project is licensed under the DevFUM License - see the LICENSE.md file for details.