JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 69
  • Score
    100M100P100Q86410F
  • License MIT

A production-ready Spring Boot project generator CLI. Scaffold secure, structured Java applications with built-in JWT or session authentication, role-based access control, user management, and an optional fullstack frontend — all from a single interactive command.

Package Exports

  • sprygen
  • sprygen/dist/cli.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sprygen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🌱 Sprygen

A production-ready Spring Boot project generator CLI

Sprygen is an interactive CLI written in TypeScript that scaffolds secure, structured Java Spring Boot applications. It handles the boilerplate of authentication, role-based access control, database configuration, and optional frontends so you can focus on building features.

Scaffold a full CRUD application with JWT auth, an admin panel, and Swagger docs in under 30 seconds.

✨ Features

  • Interactive Scaffolding: Prompt-based setup for Java versions, build tools (Maven/Gradle), and databases (H2, MySQL, PostgreSQL).
  • Built-in Security: Choose between stateless JWT authentication for REST APIs or stateful Session-based authentication for traditional web apps.
  • Role-Based Access Control: Pre-configured ROLE_ADMIN and ROLE_USER entities with JPA integration.
  • Optional Frontend: Generate a pure REST API or a complete Fullstack application (including login, register, profile, and an admin dashboard).
  • Entity Generator: Scaffold JPA Entities, Repositories, Services, DTOs, and REST Controllers instantly from the command line.
  • Ready-to-use Modules: Instantly toggle Swagger UI, Spring Mail, and robust Logback configurations logging.

🚀 Installation

Install Sprygen globally via npm to use the sprygen command from anywhere:

npm install -g sprygen

(For local development: clone this repository, run npm install, npm run build, and npm link)

🛠️ CLI Commands

1. Create a New Project

Launch the interactive prompt to configure and scaffold a new Spring Boot application.

sprygen new <project-name>

You will be asked to configure:

  • Package name (e.g., com.example.app)
  • Build Tool (Maven or Gradle)
  • Database (H2, MySQL, PostgreSQL)
  • Auth Strategy (JWT or Session)
  • Project Type (REST API or Fullstack with UI)
  • Optional Modules (Swagger/OpenAPI, Mail, Logging)

2. Generate a New Entity

Run this command inside your generated Sprygen project directory. It prompts you to define fields and automatically generates the entire persistence and REST API stack.

sprygen add-entity <entity-name>
# Example: sprygen add-entity Product

Generated files include:

  • JPA Entity Class (with fields defined via prompt)
  • Spring Data JpaRepository
  • Service Class
  • REST Controller (Standard CRUD endpoints)
  • DTO (Data Transfer Object)
  • Base Integration Test logic

3. Inject Authentication

Useful for modifying existing projects. Scaffolds Sprygen's robust JWT authentication layer and Spring Security configurations into an already existing Spring Boot codebase.

sprygen generate-auth

4. Update Sprygen

Ensure you are always running the latest version with the newest features and bug fixes by using the built-in update command.

sprygen update

🏗️ Project Architecture

Applications generated by Sprygen follow standard Spring Boot best practices:

  • /config: Security configuration, CORS, and module-specific configs.
  • /controller: REST APIs and MVC routing.
  • /dto: Data transfer objects (Requests/Responses).
  • /entity: JPA Data models.
  • /repository: Spring Data interfaces.
  • /security: Stateless JWT filters or session logic.
  • /service: Business logic.
  • resources/static: Pre-built vanilla JS/CSS/HTML frontend (if Fullstack + JWT is chosen).

📄 License

Sprygen is licensed under the MIT License.