Skip to main content

Java Project Input/Output — Spring Boot scaffolding CLI

Project description

JPIO — Java Project Input/Output

A CLI tool that scaffolds production-ready Spring Boot projects in seconds. Stop writing boilerplate. Start building features.


Table of Contents


Overview

JPIO (Java Project Input/Output) is an open-source Python CLI that automates the creation of Spring Boot project scaffolding. You describe your entities and their relationships interactively in the terminal — JPIO generates all the layers: Entity, DTO, Mapper, Repository, Service, ServiceImpl, Controller, and Exceptions.

Built for developers who are tired of copy-pasting the same boilerplate across every new project.


Why JPIO?

Every Spring Boot project starts the same way:

mkdir config controller entity dto mapper repository service exception

Then you write the same JpaRepository interfaces, the same CRUD controllers, the same GlobalExceptionHandler, the same SwaggerConfig... over and over again.

JPIO eliminates that entirely.

Without JPIO With JPIO
~30–60 min of boilerplate setup ~2 minutes
Manual folder creation Auto-generated structure
Copy-paste error-prone Template-driven, consistent
Forgotten files Nothing is missed

Installation

pip install jpio-cli

Requirements:

  • Python 3.9+
  • pip

Quick Start

# Go to your Spring Boot project root
cd my-spring-project

# Launch the JPIO wizard
jpio start

# Follow the interactive prompts:
# ? API route prefix     : /api/v1
#
# --- Entity 1 ---
# ? Entity name          : Product
# ? Fields               : name (String), price (Double), stock (Integer)
# ? Has relations?       : Yes → ManyToMany → Category
#
# --- Entity 2 ---
# ? Entity name          : Category
# ? Fields               : name (String)
#
# ? Add another entity? No
#
# ✅ Business layers generated!

Commands

Command Description
jpio start Initialize and scaffold business layers for a project
jpio add Add a new entity to an existing JPIO project
jpio security Add a complete Spring Security JWT layer
jpio scan Display the current state of a JPIO project
jpio test Analyze Java code and generate JUnit 5 + Mockito tests

jpio start

Launches the full interactive wizard. Detects your existing package structure, pom.xml dependencies, and configuration format (properties vs yaml). Generates the complete CRUD structure for your entities.

jpio add

Run inside an existing JPIO project. Prompts for a new entity and appends the generated files without touching existing code. Reads .jpio.json to stay aware of existing entities and relationships.

jpio security

Adds a complete Spring Security + JWT implementation to your project.

  • Generates SecurityConfig, JwtUtil, JwtAuthenticationFilter, and UserDetailsServiceImpl.
  • Generates authentication endpoints (/auth/login, /auth/register) and DTOs.
  • Automatically creates a User entity and Role enum if not already present.
  • Injects required dependencies into your pom.xml.

jpio scan

Reads .jpio.json and displays a summary table of the project: entities, fields, and relations.

jpio test

Analyzes your existing Java code (Service, Controller, Repository, Mapper) and generates comprehensive JUnit 5 + Mockito unit tests.

  • Smart Analysis: Scans your source code to detect dependencies and injected fields.
  • Scenario Generation: Automatically creates happy path and edge case scenarios (e.g., findById -> shouldReturnObject & shouldThrowNotFoundException).
  • Mockito Integration: Generates all required @Mock and @InjectMocks fields.
  • MockMvc Support: For Controllers, it generates WebMvcTest with MockMvc calls and status assertions.
  • Filtering: Use --only EntityName or --type service to target specific areas.

Project Architecture

├── jpio/
│   ├── main.py                        # CLI entry point (Click)
│   ├── bin/
│   │   └── jpio-parser.jar            # Java parser utility
│   ├── commands/
│   │   ├── new.py                     # `jpio start` — full project wizard
│   │   ├── add.py                     # `jpio add` — add entity
│   │   ├── security.py                # `jpio security` — security flow
│   │   ├── scan.py                    # `jpio scan` — display project state
│   │   └── test.py                    # `jpio test` — unit test generator
│   ├── core/
│   │   ├── models.py                  # Dataclasses: Field, Relation, Entity, ProjectConfig
│   │   ├── analyzer.py                # Interactive prompts → builds ProjectConfig
│   │   ├── security_analyzer.py       # Security wizard
│   │   ├── java_parser.py             # JAR parser wrapper
│   │   ├── test_plan_analyzer.py      # Test logic brain
│   │   ├── generator.py               # Jinja2 rendering engine
│   │   ├── test_generator.py          # Test rendering engine
│   │   ├── security_generator.py      # Security file generation
│   │   └── writer.py                  # Java code strings → files on disk
│   ├── utils/
│   │   ├── console.py                 # Rich: banners, tables, success/error output
│   │   └── file_helper.py             # Path manipulation, pom.xml dependency injection
│   └── templates/
│       ├── entity/                    # CRUD templates
│       ├── exception/                 # Global exception handling templates
│       ├── config/                    # Swagger/SpringDoc templates
│       ├── security/                  # Spring Security JWT templates
│       ├── tests/                     # JUnit 5 templates
│       └── project/                   # application.properties/yaml templates
├── tests/
│   ├── test_analyzer.py
│   ├── test_generator.py
│   ├── test_test_generator.py
│   ├── test_security_generator.py
│   └── test_writer.py
├── pyproject.toml
└── README.md

Generated Structure

For a project with package com.pio.ecommerce and two entities Product and Category:

src/main/java/com/pio/ecommerce/
├── config/
│   ├── SecurityConfig.java            # (If security added)
│   └── SwaggerConfig.java
├── controller/
│   ├── AuthController.java            # (If security added)
│   ├── ProductController.java
│   └── CategoryController.java
├── dto/
│   ├── request/
│   │   ├── LoginRequestDTO.java
│   │   ├── ProductRequestDTO.java
│   │   └── CategoryRequestDTO.java
│   └── response/
│       ├── AuthResponseDTO.java
│       ├── ProductResponseDTO.java
│       └── CategoryResponseDTO.java
├── security/                          # JWT Logic (If security added)
│   ├── JwtUtil.java
│   └── JwtAuthenticationFilter.java
├── models/
│   ├── entity/
│   │   ├── User.java                  # (If security added)
│   │   ├── Product.java
│   │   └── Category.java
│   └── enum/
│       └── Role.java
├── repository/
│   ├── UserRepository.java
│   ├── ProductRepository.java
│   └── CategoryRepository.java
└── service/
    ├── ProductService.java
    └── ProductServiceImpl.java

Supported Relations

Relation Description Example
OneToMany One entity has many of another OrderOrderItem
ManyToOne Many entities belong to one OrderItemOrder
ManyToMany Both sides have many ProductCategory

JPIO automatically handles:

  • The @JoinTable annotation for ManyToMany
  • The mappedBy attribute on the inverse side
  • Pluralization and correct field types (List<Target>)

Roadmap

  • MVP: interactive wizard + full CRUD scaffold generation
  • OneToMany / ManyToMany relation support
  • jpio add command for existing projects
  • jpio scan project inspector
  • Enums support & Request/Response DTO separation
  • Spring Security scaffolding (v0.5.0)
  • Smart Unit Test generation (v0.6.0)
  • jpio add enum command for existing projects
  • IntelliJ IDEA plugin
  • VS Code extension
  • Lombok support toggle
  • MapStruct vs manual mapper toggle

Contributing

Contributions are welcome. Please open an issue before submitting a pull request.

git clone https://github.com/PIO-VIA/JPIO.git
cd JPIO
pip install -e ".[dev]"

License

MIT © PIO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jpio_cli-0.6.2.tar.gz (7.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jpio_cli-0.6.2-py3-none-any.whl (7.6 MB view details)

Uploaded Python 3

File details

Details for the file jpio_cli-0.6.2.tar.gz.

File metadata

  • Download URL: jpio_cli-0.6.2.tar.gz
  • Upload date:
  • Size: 7.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jpio_cli-0.6.2.tar.gz
Algorithm Hash digest
SHA256 68190d545fcb455030271f31ed1d69f2888c4ce7ab563b0daf889ef09fa6647e
MD5 bd328e13ce6f673eb50956b13e6ca303
BLAKE2b-256 53a9005f2ca18c4142e7cf87bc0188fe78e0a6fd8d482ed11f24ac2165b7b3be

See more details on using hashes here.

Provenance

The following attestation bundles were made for jpio_cli-0.6.2.tar.gz:

Publisher: publish.yml on PIO-VIA/JPIO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jpio_cli-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: jpio_cli-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jpio_cli-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 736a7e460fff64908b378e5385f596bc613d7c5a8251f0f2d9f622fccea28878
MD5 3adf22ecd7cd002bb518e33027d88ee8
BLAKE2b-256 1313ed8cce3df7aeaeea14a2880fb5f65f45f8538f0a296f327f6f8ac07b9ed3

See more details on using hashes here.

Provenance

The following attestation bundles were made for jpio_cli-0.6.2-py3-none-any.whl:

Publisher: publish.yml on PIO-VIA/JPIO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page