API Project Generator💡
💌 💓
he API Project Generator is a Visual Studio Code extension designed to streamline the creation of API projects by automating folder structure setup, file generation, and package management. It provides a user-friendly interface to quickly generate a boilerplate for APIs, offering options for different levels of complexity: Simple, Advanced, and Complex.
Features
Folder Structure Customization:
Automatically creates folders such as controllers, routes, config, middlewares, models, services, and more based on the selected complexity.
Supports three predefined folder structures:
Simple: Minimal structure with controllers and routes.
Advanced: Includes additional folders like config, middlewares, models, and utils.
Complex: Adds services and tests folders for comprehensive project organization.
File Generation:
Automatically generates a server file (server.js or server.ts) in the preferred language: JavaScript or TypeScript.
Prepopulated boilerplate code for the server file is included.
Integration with npm:
Automatically initializes a package.json file with scripts for starting and developing the API.
Provides an option to install necessary npm packages like express directly from the interface.
Customizable Extensions:
Supports both JavaScript and TypeScript, allowing users to select their preferred development environment.
Interactive Workflow:
Utilizes VS Code's Quick Pick menus for an intuitive and guided setup process.
Offers flexibility to choose automation or manual configuration for certain steps, such as npm initialization.
Ease of Use:
Automatically updates package.json with relevant fields and scripts.
Prompts for optional installation of key dependencies to kickstart development
Requirements
1. Environment
VS Code: The extension runs inside VS Code.
Node.js: Required to run npm commands for creating files and dependencies.
API Complexity: Choose one:
Simple: Basic folders like controllers and routes.
Advanced: Adds more folders like config, models, and middlewares.
Complex: Includes everything from the Advanced option plus services and tests.
Programming Language: Choose either JavaScript or TypeScript.
NPM Initialization: Decide whether to auto-generate package.json or do it manually.
Install Packages: Choose whether to automatically install dependencies like express.
3. Files and Folders Created
Based on the selected API complexity, different folders and files will be created, like:
controllers, routes, server.js/server.ts.
Advanced and Complex setups add more like config, models, middlewares, services, and tests.
4. Permissions
Read/Write Access: Required to create files and folders in the project.
5. Dependencies
VS Code API: To interact with the VS Code environment.
Node.js Modules: For file handling (fs), path resolution (path), and running npm commands (child_process).
6. Error Handling
Missing Folder: If no workspace is open, show an error.
File Creation Errors: Handle and show errors if something goes wrong during file or folder creation.
7. Feedback to User
Confirmation: Let the user know when things are done.
Error Messages: Show warnings for any issues that arise.
Extension Settings
Known Issues
Release Notes
Users appreciate release notes as you update your extension.
1.0.0
Version 1.0.0
Release Date: December 17, 2024
New Features:
API Project Generator:
Allows users to generate an API project structure with different levels of complexity: Simple, Advanced, and Complex.
Simple: Creates basic controllers and routes folders.
Advanced: Adds additional folders for config, middlewares, models, and utils.
Complex: Includes all of the above, plus services and tests folders.
Flexible Language Choice:
- Choose between JavaScript and TypeScript for your project files (server.js/server.ts).
Automatic package.json Generation:
- Option to automatically generate a package.json file and add basic scripts (start and dev).
Install Essential Packages:
A* utomatically installs important npm packages like express if selected by the user.
VS Code Integration:
- Seamless integration with VS Code for easy creation of folders, files, and project setup.
Improvements:
Simplified Setup:
- User-friendly prompts to guide users through selecting their preferred API structure, language, and package setup.
Error Handling:
- Improved error messages when workspace or folder issues arise.
Clear Feedback:
- Detailed messages showing the success of folder and file creation, as well as npm command executions.
Fixed issue #.
1.0.0
- Email: amirejoseph83@gmail.com
- USDT BNB (Binance Smart Chain) => 0x52620572bc56AE24a7Ea0403Cf66989091714957
Enjoy!