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 +54 -47
- package/dist/cli.js +0 -0
- package/package.json +16 -5
- package/templates/project/thymeleaf/admin/users.html.ejs +1 -1
- package/templates/project/thymeleaf/dashboard.html.ejs +1 -1
- package/templates/project/thymeleaf/layout.html.ejs +1 -1
- package/templates/project/thymeleaf/login.html.ejs +1 -1
- package/templates/project/thymeleaf/profile.html.ejs +1 -1
- package/templates/project/thymeleaf/register.html.ejs +1 -1
package/README.md
CHANGED
|
@@ -1,80 +1,87 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
8
|
+
> Scaffold a full CRUD application with JWT auth, an admin panel, and Swagger docs in under 30 seconds.
|
|
6
9
|
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
###
|
|
31
|
+
### 1. Create a New Project
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
Launch the interactive prompt to configure and scaffold a new Spring Boot application.
|
|
29
34
|
|
|
30
35
|
```bash
|
|
31
|
-
sprygen new
|
|
36
|
+
sprygen new <project-name>
|
|
32
37
|
```
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
- Package name (e.g
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
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
|
-
###
|
|
47
|
+
### 2. Generate a New Entity
|
|
43
48
|
|
|
44
|
-
|
|
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
|
-
|
|
54
|
-
sprygen add-entity Product
|
|
52
|
+
sprygen add-entity <entity-name>
|
|
53
|
+
# Example: sprygen add-entity Product
|
|
55
54
|
```
|
|
56
55
|
|
|
57
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
72
|
+
## 🏗️ Project Architecture
|
|
66
73
|
|
|
67
|
-
|
|
68
|
-
# Install dependencies
|
|
69
|
-
npm install
|
|
74
|
+
Applications generated by Sprygen follow standard Spring Boot best practices:
|
|
70
75
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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.
|
|
4
|
-
"description": "A
|
|
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
|
-
"
|
|
43
|
+
"cli",
|
|
44
44
|
"java",
|
|
45
45
|
"jwt",
|
|
46
|
-
"
|
|
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
|
+
}
|