sprygen 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,80 +1,87 @@
1
- # Sprygen
1
+ <div align="center">
2
+ <h1>🌱 Sprygen</h1>
3
+ <p><strong>A production-ready Spring Boot project generator CLI</strong></p>
4
+ </div>
2
5
 
3
- A fully-functional project generator tool similar to JHipster, written in Node.js with TypeScript, that can scaffold Spring Boot projects with authentication and common modules pre-configured.
6
+ 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.
4
7
 
5
- ## Features
8
+ > Scaffold a full CRUD application with JWT auth, an admin panel, and Swagger docs in under 30 seconds.
6
9
 
7
- * **Generate Spring Boot Project**: Scaffolds a full Spring Boot 3.x project with Maven or Gradle.
8
- * **Pre-configured Auth**: Includes JWT authentication via Spring Security.
9
- * **Database Support**: Choose between H2 (in-memory), MySQL, or PostgreSQL.
10
- * **Optional Modules**: Switch on Swagger OpenAPI, Spring Mail, and custom Logback logging.
11
- * **Entity Generator**: Quickly add new JPA entities with full repository, service, and controller layers (CRUD REST API).
12
- * **Standalone Auth Generator**: Add JWT security configurations to any existing Spring Boot project.
10
+ ## Features
13
11
 
14
- ## Installation
12
+ - **Interactive Scaffolding:** Prompt-based setup for Java versions, build tools (Maven/Gradle), and databases (H2, MySQL, PostgreSQL).
13
+ - **Built-in Security:** Choose between stateless JWT authentication for REST APIs or stateful Session-based authentication for traditional web apps.
14
+ - **Role-Based Access Control:** Pre-configured `ROLE_ADMIN` and `ROLE_USER` entities with JPA integration.
15
+ - **Optional Frontend:** Generate a pure `REST API` or a complete `Fullstack` application (including login, register, profile, and an admin dashboard).
16
+ - **Entity Generator:** Scaffold JPA Entities, Repositories, Services, DTOs, and REST Controllers instantly from the command line.
17
+ - **Ready-to-use Modules:** Instantly toggle Swagger UI, Spring Mail, and robust Logback configurations logging.
15
18
 
16
- Install globally using npm:
19
+ ## 🚀 Installation
20
+
21
+ Install Sprygen globally via npm to use the `sprygen` command from anywhere:
17
22
 
18
23
  ```bash
19
24
  npm install -g sprygen
20
25
  ```
21
26
 
22
- *(For local development, clone the repository, run `npm install`, then `npm run build`, and `npm link`)*
27
+ *(For local development: clone this repository, run `npm install`, `npm run build`, and `npm link`)*
23
28
 
24
- ## Commands
29
+ ## 🛠️ CLI Commands
25
30
 
26
- ### `sprygen new <project-name>`
31
+ ### 1. Create a New Project
27
32
 
28
- Launches an interactive prompt to scaffold a new project.
33
+ Launch the interactive prompt to configure and scaffold a new Spring Boot application.
29
34
 
30
35
  ```bash
31
- sprygen new my-awesome-api
36
+ sprygen new <project-name>
32
37
  ```
33
38
 
34
- It will prompt you for:
35
- - Package name (e.g. `com.example.app`)
36
- - Description
37
- - Build Tool (Maven/Gradle)
38
- - Database (H2/MySQL/PostgreSQL)
39
- - Java Version (21/17)
40
- - Optional Modules (Swagger, Mail, Logging)
39
+ **You will be asked to configure:**
40
+ - Package name (e.g., `com.example.app`)
41
+ - Build Tool (Maven or Gradle)
42
+ - Database (H2, MySQL, PostgreSQL)
43
+ - Auth Strategy (JWT or Session)
44
+ - Project Type (REST API or Fullstack with UI)
45
+ - Optional Modules (Swagger/OpenAPI, Mail, Logging)
41
46
 
42
- ### `sprygen add-entity <entity-name>`
47
+ ### 2. Generate a New Entity
43
48
 
44
- Must be run inside the generated project's root folder. It prompts you to define fields (types and nullability) for your entity and automatically generates:
45
- - JPA Entity class
46
- - Spring Data JpaRepository
47
- - Service class
48
- - REST Controller with standard CRUD endpoints
49
- - DTO class
50
- - Controller integration test stub
49
+ 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.
51
50
 
52
51
  ```bash
53
- cd my-awesome-api
54
- sprygen add-entity Product
52
+ sprygen add-entity <entity-name>
53
+ # Example: sprygen add-entity Product
55
54
  ```
56
55
 
57
- ### `sprygen generate-auth`
56
+ **Generated files include:**
57
+ - JPA Entity Class (with fields defined via prompt)
58
+ - Spring Data `JpaRepository`
59
+ - Service Class
60
+ - REST Controller (Standard CRUD endpoints)
61
+ - DTO (Data Transfer Object)
62
+ - Base Integration Test logic
63
+
64
+ ### 3. Inject Authentication
58
65
 
59
- Scaffolds JWT authentication and Spring Security configuration. Useful if you want to add Sprygen's security setup to an existing project not scaffolded by `sprygen new`.
66
+ Useful for modifying existing projects. Scaffolds Sprygen's robust JWT authentication layer and Spring Security configurations into an already existing Spring Boot codebase.
60
67
 
61
68
  ```bash
62
69
  sprygen generate-auth
63
70
  ```
64
71
 
65
- ## Development
72
+ ## 🏗️ Project Architecture
66
73
 
67
- ```bash
68
- # Install dependencies
69
- npm install
74
+ Applications generated by Sprygen follow standard Spring Boot best practices:
70
75
 
71
- # Run the CLI in development mode using ts-node
72
- npm run dev new test-project
73
-
74
- # Build the project (compiles TypeScript to dist/)
75
- npm run build
76
- ```
76
+ - **`/config`**: Security configuration, CORS, and module-specific configs.
77
+ - **`/controller`**: REST APIs and MVC routing.
78
+ - **`/dto`**: Data transfer objects (Requests/Responses).
79
+ - **`/entity`**: JPA Data models.
80
+ - **`/repository`**: Spring Data interfaces.
81
+ - **`/security`**: Stateless JWT filters or session logic.
82
+ - **`/service`**: Business logic.
83
+ - **`resources/static`**: Pre-built vanilla JS/CSS/HTML frontend (if Fullstack + JWT is chosen).
77
84
 
78
- ## License
85
+ ## 📄 License
79
86
 
80
- MIT
87
+ Sprygen is licensed under the MIT License.
package/dist/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sprygen",
3
- "version": "1.0.0",
4
- "description": "A JHipster-like Spring Boot project generator CLI written in TypeScript",
3
+ "version": "1.0.3",
4
+ "description": "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.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
7
7
  "sprygen": "./dist/cli.js"
@@ -40,14 +40,25 @@
40
40
  "spring-boot",
41
41
  "generator",
42
42
  "scaffold",
43
- "jhipster",
43
+ "cli",
44
44
  "java",
45
45
  "jwt",
46
- "cli"
46
+ "authentication",
47
+ "spring-security",
48
+ "fullstack",
49
+ "starter-kit"
47
50
  ],
48
51
  "author": "Sprygen",
49
52
  "license": "MIT",
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/wadecalvin9/Sprygen.git"
56
+ },
57
+ "bugs": {
58
+ "url": "https://github.com/wadecalvin9/Sprygen/issues"
59
+ },
60
+ "homepage": "https://github.com/wadecalvin9/Sprygen#readme",
50
61
  "engines": {
51
62
  "node": ">=18.0.0"
52
63
  }
53
- }
64
+ }
@@ -108,4 +108,4 @@
108
108
  </div>
109
109
  </body>
110
110
  </html>
111
-
111
+
@@ -106,4 +106,4 @@
106
106
  </div>
107
107
  </body>
108
108
  </html>
109
-
109
+
@@ -72,4 +72,4 @@
72
72
 
73
73
  </body>
74
74
  </html>
75
-
75
+
@@ -53,4 +53,4 @@
53
53
  </div>
54
54
  </body>
55
55
  </html>
56
-
56
+
@@ -130,4 +130,4 @@
130
130
  </div>
131
131
  </body>
132
132
  </html>
133
-
133
+
@@ -53,4 +53,4 @@
53
53
  </div>
54
54
  </body>
55
55
  </html>
56
-
56
+