1.0.0 • Published 6 months ago
rest-api-generator-cli v1.0.0
REST API Generator CLI
A command-line tool to quickly generate REST API boilerplates with optional authentication and database setup.
Features
- Generate complete REST API structure
- Optional authentication setup
- MongoDB/PostgreSQL database integration
- Best practices folder structure
- Basic CRUD operations
- Environment configuration
- Error handling middleware
Installation
npm install -g rest-api-generator-cli
Usage
rest-api-generator --name my-api --auth --database mongodb
Options
-n, --name <name>
- Project name (required)-a, --auth
- Include authentication (optional)-d, --database <type>
- Database type (mongodb/postgres) (default: mongodb)
Project Structure
my-api/
├── src/
│ ├── models/
│ │ └── user.js
│ ├── controllers/
│ │ └── userController.js
│ ├── routes/
│ │ └── users.js
│ ├── middleware/
│ │ └── auth.js
│ ├── utils/
│ └── index.js
├── .env
└── package.json
Development
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/rest-api-generator-cli.git
- Install dependencies:
cd rest-api-generator-cli
npm install
- Link package locally:
npm link
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
1.0.0
6 months ago