-
Notifications
You must be signed in to change notification settings - Fork 1
Add CLI Command for Generating Backend & Frontend Resources #1
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Feature Request: Automated Backend and Frontend Resource Generation CLI
Overview
Implement a CLI command to automate the generation of backend (Spring Boot) and frontend (Angular) components for a given entity.
CLI Commands
Proposed Commands
npx jgc generate backend <Entity>→ Generates backend resourcesnpx jgc generate frontend <Entity>→ Generates frontend resourcesnpx jgc generate full <Entity>→ Generates both backend & frontendnpx jgc generate backend <Entity> --only model,repository→ Selective backend generation
Generation Specifications
Backend Generation
- Copy template Spring Boot project
- Replace
{{Entity}}placeholders with the entity name - Generate the following resources:
ControllerModelRepositoryServiceService Implementation
Frontend Generation
- Copy Angular template files
- Replace
{{Entity}}placeholders - Generate the following resources:
Angular ServiceModelComponent
Project Structure After Generation
project-root/
├── generated-backend/
│ ├── src/main/java/com/example/app/
│ │ ├── controller/UserController.java
│ │ ├── model/User.java
│ │ ├── repository/UserRepository.java
│ │ ├── service/UserService.java
│ │ ├── service/impl/UserServiceImpl.java
│
├── generated-frontend/
│ ├── src/app/
│ │ ├── services/user.service.ts
│ │ ├── models/user.model.ts
│ │ ├── components/user-list/user-list.component.ts
Implementation Details
Project Structure
- CLI Entry Point:
bin/jgc.js - Backend Generator:
lib/backend-generator.js - Frontend Generator:
lib/frontend-generator.js - Templates Directory:
templates/springboot-template/angular-template/
Open Questions and Considerations
Configuration and Extensibility
- Implement
.envfor configurations - Explore support for NestJS alongside Spring Boot
- Investigate database migration support (Flyway/Liquibase)
Contributing Guidelines
- Fork the repository
- Implement backend/frontend generation as specified
- Submit a pull request with comprehensive documentation
Additional Notes
This feature aims to streamline the process of creating consistent backend and frontend resources, reducing boilerplate code and improving development efficiency.
TODO
- Design template replacement mechanism
- Create robust CLI parsing
- Implement selective generation logic
- Add comprehensive error handling
- Write unit and integration tests
Potential Future Enhancements
- Support for additional frameworks
- More granular generation options
- Interactive CLI prompts for configuration
Impact
✨ Reduced boilerplate code
✨ Consistent resource generation
✨ Improved developer productivity
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed