Skip to content

bayrameker/springboot-microservices-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

My Microservice CLI

My Microservice CLI is a command-line tool designed to simplify the creation and management of microservices using Spring Boot. This tool allows users to quickly generate new microservices with predefined templates, assign them unique ports, and optionally enable inter-service communication via Eureka.

Features

  • Create Microservices: Easily generate new microservices with a single command.
  • Assign Unique Ports: Automatically assigns an available port to each new microservice.
  • Enable Communication: Optionally enable communication between services using Eureka.
  • List Microservices: View all created microservices and their assigned ports.
  • Delete Microservices: Remove unwanted microservices.

Project Structure

my-microservice-cli/
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── com/
│   │   │       └── example/
│   │   │           └── microservicecli/
│   │   │               ├── commands/
│   │   │               │   └── MicroserviceCommands.java
│   │   │               ├── service/
│   │   │               │   └── MicroserviceService.java
│   │   │               ├── util/
│   │   │               │   └── FileUtil.java
│   │   │               └── MyMicroserviceCliApplication.java
│   │   ├── resources/
│   │   │   └── application.yml
│   ├── test/
│       └── java/
│           └── com/
│               └── example/
│                   └── microservicecli/
│                       └── MicroserviceServiceTests.java
├── microservice-template/
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/
│   │   │   │   └── com/
│   │   │   │       └── example/
│   │   │   │           └── microservice/
│   │   │   │               └── MyMicroserviceApplication.java
│   │   ├── resources/
│   │       └── application.yml
│   └── pom.xml
└── pom.xml

Getting Started

Prerequisites

  • Java 17
  • Maven
  • Spring Boot

Installation

  1. Clone the repository:

    git clone https://github.com/bayrameker/springboot-microservices-management.git
    cd my-microservice-cli
  2. Build the project:

    mvn clean install
  3. Run the application:

    mvn spring-boot:run

Usage

Once the application is running, you can use the following commands:

Create a New Microservice

create-microservice --name my-service --enableCommunication true

This command will create a new microservice named my-service and enable communication with Eureka.

List All Microservices

list-microservices

This command will list all created microservices along with their assigned ports.

Delete a Microservice

delete-microservice --name my-service

This command will delete the specified microservice.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

  • Spring Boot
  • Spring Shell
  • Eureka

Feel free to update the repository URL and other details according to your needs. This README provides a clear overview of the project, its structure, usage instructions, and contribution guidelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages