generator-nokode
v1.0.13
Published
A Yeoman generator for creating Spring Boot applications with Nokode framework
Maintainers
Readme
generator-nokode
A Yeoman generator for creating Spring Boot applications with the Nokode framework. This generator scaffolds a complete Spring Boot application with authentication, user management, role-based access control, and MongoDB integration.
Features
- 🚀 Spring Boot 3.5.5 with Java 17
- 🔐 Authentication & Authorization with role-based access control
- 👥 User Management with CRUD operations
- 🗄️ MongoDB Integration with Spring Data
- 📝 OpenAPI Documentation with Swagger UI
- 🛠️ MapStruct for object mapping
- 🔒 Security with interceptors and CORS configuration
- 📊 Auditing and logging capabilities
- 🧪 Testing setup with JUnit
Prerequisites
- Node.js (>= 14.0.0)
- Java 17
- Gradle
- MongoDB
Installation
First, install Yeoman and generator-nokode using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-nokodeUsage
Interactive Mode
Run the generator in interactive mode:
yo nokodeThe generator will prompt you for:
- Application name
- Group ID (e.g., com.example)
- Java package name (e.g., com.example.myapp)
- System email address
Command Line Mode
You can also provide all parameters via command line:
yo nokode --appName="MyApp" --groupId="com.example" --packageName="com.example.myapp" --systemEmailAddress="[email protected]"Generated Project Structure
my-app/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/example/myapp/
│ │ │ ├── MyAppApplication.java
│ │ │ ├── config/
│ │ │ │ ├── AuthConfig.java
│ │ │ │ ├── MongoConfig.java
│ │ │ │ ├── WebConfig.java
│ │ │ │ └── ...
│ │ │ ├── user/
│ │ │ │ ├── domain/
│ │ │ │ ├── dto/
│ │ │ │ ├── mapper/
│ │ │ │ ├── repository/
│ │ │ │ └── service/
│ │ │ └── role/
│ │ │ ├── domain/
│ │ │ ├── dto/
│ │ │ ├── mapper/
│ │ │ ├── repository/
│ │ │ └── service/
│ │ └── resources/
│ │ └── application.properties
│ └── test/
│ └── java/
│ └── com/example/myapp/
│ └── MyAppApplicationTests.java
├── build.gradle
├── settings.gradle
└── gradlewConfiguration
After generation, update the application.properties file with your specific configuration:
# Database Configuration
spring.data.mongodb.uri=mongodb://localhost:27017/myapp
# Server Configuration
server.port=8080
# Security Configuration
app.security.jwt.secret=your-jwt-secret-key
app.security.jwt.expiration=86400000
# Email Configuration
app.email.host=smtp.gmail.com
app.email.port=587
[email protected]
app.email.password=your-app-passwordRunning the Application
- Start MongoDB:
mongod- Run the application:
./gradlew bootRun- Access the application:
- API: http://localhost:8080
- Swagger UI: http://localhost:8080/swagger-ui.html
API Endpoints
The generated application includes the following endpoints:
User Management
POST /api/users- Create userGET /api/users- Get all usersGET /api/users/{id}- Get user by IDPUT /api/users/{id}- Update userDELETE /api/users/{id}- Delete user
Role Management
POST /api/roles- Create roleGET /api/roles- Get all rolesGET /api/roles/{id}- Get role by IDPUT /api/roles/{id}- Update roleDELETE /api/roles/{id}- Delete role
Authentication
POST /api/auth/login- User loginPOST /api/auth/signup- User signupPOST /api/auth/reset-password- Reset password
Development
Running Tests
./gradlew testBuilding the Application
./gradlew buildRunning with Docker
docker-compose upContributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you have any questions or need help, please:
- Check the Issues page
- Create a new issue if your problem isn't already reported
- Contact the maintainers at [email protected]
Changelog
1.0.0
- Initial release
- Spring Boot 3.5.5 support
- User and Role management
- MongoDB integration
- Authentication and authorization
- OpenAPI documentation
