Skip to content

A Python CLI tool to quickly scaffold Java Spring Boot microservices with optional Docker, PostgreSQL, and SaaS-ready billing endpoints. Perfect for small teams or open-source projects that want a working microservice boilerplate in seconds.

License

Notifications You must be signed in to change notification settings

codewithpandey/SpringRocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringRocket 🚀 — Universal Microservice CLI

A Python CLI tool to quickly scaffold Java Spring Boot microservices with optional Docker, PostgreSQL, and SaaS-ready billing endpoints. Perfect for small teams or open-source projects that want a working microservice boilerplate in seconds.

SpringRocket is the name of this CLI because it lets you launch Spring Boot microservices at rocket speed.

I wanted a name that captures the thrill of taking an idea and having a fully working microservice ready to run in seconds. With SpringRocket, you don’t wait — you scaffold, run, and see your service in action almost instantly. Think of it as your personal launchpad for microservices and SaaS-ready applications.


Features

  • Generate a Spring Boot microservice with REST endpoints
  • Fully Maven-compliant project structure
  • Optional Dockerfile for containerization
  • Optional PostgreSQL DB config (application.properties)
  • Optional BillingController with Stripe/PayPal placeholders
  • Automatic README.md inside generated service
  • Produces ready-to-run JAR (target/<ServiceName>.jar) for Docker or local execution
  • Quick scaffold for SaaS-style microservices
  • Automatic unit tests generation

Installation

git clone https://github.com/codewithpandey/SpringRocket.git
cd universal-microservice-cli
python -m venv venv
source venv/bin/activate       # Linux / macOS
venv\Scripts\activate          # Windows
pip install -r requirements.txt

Usage

python cli.py create-service <ServiceName> [OPTIONS]

Options:

  • --docker → Add Dockerfile
  • --db → Add PostgreSQL configuration
  • --billing → Add BillingController (Stripe & PayPal placeholders)

Example:

python cli.py create-service UserService --docker --db --billing

Generates UserService microservice in services/UserService/ with:

Application.java
Controller.java
BillingController.java ✅
pom.xml
src/main/resources/application.properties ✅
Dockerfile ✅
README.md ✅

Generated Service Structure

├── services
   └── UserService
       ├── Dockerfile
       ├── pom.xml
       ├── README.md
       └── src
           ├── main
           │   ├── java
           │   │   └── com
           │   │       └── example
           │   │           ├── Application.java
           │   │           ├── BillingController.java
           │   │           └── Controller.java
           │   └── resources
           │       └── application.properties
           └── test
               ├── java
               │   └── com
               │       └── example
               │           ├── ApplicationTest.java
               │           ├── BillingControllerTest.java
               │           └── ControllerTest.java
               └── resources
                   └── application-test.properties


Running Services

Locally

cd services/UserService
mvn package
java -jar target/UserService.jar

Using Docker

docker build -t userservice .
docker run -p 8080:8080 userservice:latest

Test endpoints:

curl http://localhost:8080/api/userservice
curl -X POST http://localhost:8080/api/userservice/billing/subscribe/stripe
curl -X POST http://localhost:8080/api/userservice/billing/subscribe/paypal

Automatic Tests

Every service generated by SpringRocket comes with a ready-to-run test suite:

  • src/test/java/com/example/

    • ApplicationTest.java → ensures the Spring context starts successfully
    • ControllerTest.java → tests your main REST endpoints
    • BillingControllerTest.java → included if --billing flag is used
  • src/test/resources/application-test.properties

    • Configures H2 in-memory database for fast isolated tests
    • Enables logging for easier debugging
    • Sets Spring profile to test to separate test configuration from production

Run tests:

cd services/UserService
mvn test

All tests will pass out-of-the-box for a freshly generated service. This makes it easy to verify scaffolding, quickly add new features, or integrate CI/CD pipelines.


Benefits

  1. No empty test folders — every service comes fully configured.
  2. Fast, isolated tests using in-memory database.
  3. Ready for CI/CD pipelines or GitHub Actions.

How it works

SpringRocket uses Jinja2 templates stored in templates/. When you run create-service, it:

  1. Copies templates into a Maven-compliant folder structure
  2. Replaces placeholders like {{ServiceName}}
  3. Generates ready-to-run microservice boilerplate with optional Docker, DB, and billing

Next Steps

  • Extend BillingController with real Stripe or PayPal integration
  • Add authentication, notifications, or other SaaS features
  • Use SpringRocket as a base for small microservice teams or open-source projects

License

MIT License — feel free to use, modify, and contribute.


SpringRocket Trajectory / Orbit

SpringRocket is under active development! Here’s what’s done, what’s planned, and what’s on the horizon.

Phase 1: Ignition & Launch Pad (Core CLI & Microservice Scaffold — ✅ Mostly Done

  • ✅ Scaffold fully working Spring Boot microservice
  • ✅ Generate REST endpoints
  • ✅ Optional Stripe/PayPal billing placeholders
  • ✅ Docker-ready service
  • ✅ Auto-generated unit & integration tests with H2 DB
  • ⬜ Interactive CLI prompts for service name, package, DB, and features
  • ⬜ Basic CRUD scaffolding (Entity + Repository + Service + Controller)
  • ⬜ Swagger/OpenAPI integration for interactive API docs
  • ⬜ Multi-stage Dockerfile & optional Docker Compose

Phase 2: Orbit Stabilization & Payload Deployment (SaaS & Advanced Features)

  • ⬜ Subscription plan scaffolding
  • ⬜ Multi-tenant support
  • ⬜ Admin dashboard starter template
  • ⬜ CI/CD pipeline starter files (GitHub Actions / GitLab CI)
  • ⬜ Integration & load test templates

Phase 3: Deep Space Exploration & Mission Control (Developer Experience & Observability)

  • ⬜ Hot-reload templates with Spring DevTools
  • ⬜ Prometheus/Grafana metrics endpoints
  • ⬜ Logging & tracing (ELK, OpenTelemetry / Zipkin)
  • ⬜ Auto-generate README and Changelog for services
  • ⬜ Optional frontend boilerplate (React/Next.js)

Notes:

  • This roadmap is a living document — features may be added, updated, or reprioritized over time.
  • Contributions are always welcome! Feel free to fork, submit PRs, or suggest new features.
  • The goal is to make SpringRocket a fast, production-ready microservice launcher for small teams and solo developers.

About

A Python CLI tool to quickly scaffold Java Spring Boot microservices with optional Docker, PostgreSQL, and SaaS-ready billing endpoints. Perfect for small teams or open-source projects that want a working microservice boilerplate in seconds.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published