{"id":28384546,"url":"https://github.com/medazzo/sbr-generator","last_synced_at":"2025-06-26T00:33:05.238Z","repository":{"id":39621560,"uuid":"235448028","full_name":"medazzo/sbr-generator","owner":"medazzo","description":"Rest Server generator based on Spring Boot and Yaml configuration file ","archived":false,"fork":false,"pushed_at":"2024-01-11T19:07:49.000Z","size":186,"stargazers_count":3,"open_issues_count":7,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-30T10:16:17.841Z","etag":null,"topics":["configuration","generator","rest-api","spring-boot","spring-security","swagger","swagger-ui","swagger2"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/medazzo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-21T21:46:24.000Z","updated_at":"2023-08-18T02:58:23.000Z","dependencies_parsed_at":"2025-05-30T09:11:16.624Z","dependency_job_id":"3dee8fd7-b20b-4ce1-9490-ac6427c4caf2","html_url":"https://github.com/medazzo/sbr-generator","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/medazzo/sbr-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medazzo%2Fsbr-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medazzo%2Fsbr-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medazzo%2Fsbr-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medazzo%2Fsbr-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/medazzo","download_url":"https://codeload.github.com/medazzo/sbr-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medazzo%2Fsbr-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261977511,"owners_count":23239367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","generator","rest-api","spring-boot","spring-security","swagger","swagger-ui","swagger2"],"created_at":"2025-05-30T09:11:04.490Z","updated_at":"2025-06-26T00:33:05.218Z","avatar_url":"https://github.com/medazzo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SBR-Generator\n\n[![Build Status](https://travis-ci.org/medazzo/sbr-generator.svg?branch=master)](https://travis-ci.org/medazzo/sbr-generator)\n[![npm version](https://badge.fury.io/js/sbr-generator.svg)](https://badge.fury.io/js/sbr-generator)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmedazzo%2Fsbr-generator.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmedazzo%2Fsbr-generator?ref=badge_shield)\n\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmedazzo%2Fsbr-generator.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmedazzo%2Fsbr-generator?ref=badge_large)\n\n## Introduction\n\nSBR generator is a  paython package that provide a Spring Boot Rest Generator cli used to generate source code modules starting from config file.\u003cbr/\u003e\n\nThe Generated source code is a CRUD Rest Spring Boot Server, ready to build and run .  \n\n## How to develop\n\nyou need to Set python Virtual env environment and start developing\n```\n$ python3 -m venv .venv\n$ source .venv/bin/activate\n(.venv) $ pip install -r requirements.txt\n(.venv) $ python setup.py develop\n```\n\n### Prerequisites\nTo work correctly *SBR* needs python to be installed .\nAll needed python modules with be installed from the *requirements.txt* using *pip*.\n\n## How To use\nTo Generate a ready to use Spring boot Rest Server , *SBR* need a configuration file\nYou can start by using the example one    \n```\n~$ sbrgen  -h\nusage: SBR Generator [-h] [-v] [-t] [-s] -c CONFIGFILE [-o OUTPUTDIR]\n\nSBR generator: Generate Spring Boot Rest source code.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -v, --mode-verbose    Enable verbose traces\n  -t, --enable-tests    Enable tests\n  -s, --disable-security\n                        Disable security\n  -c CONFIGFILE, --config-file CONFIGFILE\n                        The Yaml config file\n  -o OUTPUTDIR, --outputDir OUTPUTDIR\n                        The Output folder where to store generated source code\n\n```\nAdditionally , *SBR* support :\n* Verbose mode using *-v*\n* Disabling Security based on spring role and JWT token mode using *-s*\n* Enabling generating tests using  *-t*\n\nLike Below, to generate project with security enabled and tests using example config file :\n\n```\n~$ sbrgen  -v -t -c  examples/config.yaml\n```\n\nThis will generate the next folder structure :\n\n```\n$  tree serverTest-0.0.1-SNAP/\nserverTest-0.0.1-SNAP/\n├── pom.xml\n├── README.md\n└── src\n    ├── main\n    │   ├── java\n    │   │   └── com\n    │   │       └── easin\n    │   │           └── serverTest\n    │   │               ├── Application.java\n    │   │               ├── conf\n    │   │               │   └── ....java\n    │   │               ├── controllers    \n    │   │               │   └── ....java\n    │   │               ├── entities    \n    │   │               │   └── ...java\n    │   │               ├── exceptions    \n    │   │               │   └── ...java\n    │   │               ├── repositories    \n    │   │               │   └── ....java\n    │   │               ├── security\n    │   │               │   ├── api\n    │   │               │   │   └── ...java\n    │   │               │   └── ...java\n    │   │               └── services\n    │   │                   └── ...java\n    │   └── resources\n    │       ├── application.yaml\n    │       ├── data.sql\n    │       └── log4j2.xml\n    └── test\n        └── java\n            └── com\n                └── easin\n                    └── serverTest\n                        └── ...java\n\n```\n\n## How to use Generated source code\n\nThe generated source code is a spring boot rest maven project with a read me file ,a complete project ready to use :\n\nTo build and run   :\n\n```\ncd testServer-0.0.1/\nmvn clean package -Dmaven.test.skip=true\nmvn spring-boot:run -Dmaven.test.skip=true\n```\n\nThis will run the server, you can access the swagger ui generated documentation on \u003cbr/\u003e\nhttp://localhost:8080/project.name/project.version/swagger-ui.html\n\u003cbr/\u003eOR json format under \u003cbr/\u003e\nhttp://localhost:8080/project.name/project.version/v2/api-docs\n\n\nTo Run generated Crud unit tests, please do:\n\n```\ncd testServer-0.0.1/\nmvn test\n```\n\n# Configuration File\n\nThe Configuration is a yaml file having 3 sections : project, logging  and entities.\n\n## project section\nContains all project specific data used in the pom file and the Readme and in sourec conde generations ..\n```yaml\nproject:\n    longname: Easy Soft IN Selling Server # the project long name used in the pom files and the Readme     \n    description: Easin Selling Server     # a description for the project\n    url: http://easysoft-in.com           # the url of the project\n    name: serverTest                      # the short name\n    restPath: /serverTest                 # the rest base path generated\n    package: com.easin.serverTest         # the package of the project\n    version: 0.0.1-SNAP                   # the version of the prpoject\n    security:                             # security data if activated to generate\n      extraroles:                         # security extra roles (*SBR* already manage admin and user) please do not prefix roles with ROLE_ !      \n        - \"PROVIDER\"\n        - \"CONSUMER\"\n```\n\n## logging section\nit will be used to generate the **src/main/resources/log4j2.xml** file , extra configuration need to be added manually to the file .\n```yaml\nlogging:\n  RootLoggerLevel: trace\n  Loggers:\n    - name: com.easin\n      level: trace\n    - name: org.springframework.web.client.RestTemplate\n      level: trace\n    - name: org.apache.catalina.filters.RequestDumperFilter\n      level: trace\n```\n\n## entities section\nThis section is used to generate java package  for entity's, services, controllers,  and beyond : @Entity class and  JpaRepository for each one ..\n**User**: be Aware that the *User* entity is specific as it already managed by *SBR*, when using it on your entity, *SBR* will merge your fiels and his.\n\n```yaml\nentities:\n  - name: User\n    comment: Class representing the User parameters\n    fields:\n      - name: mail\n        type: String\n        comment: the official Mail of the User\n        annotations:\n          - \"@Email\"\n      - name: phone\n        type: String\n        comment: the official Phone number of the User\n        annotations:  []\n      - name: name\n        comment: name of the User\n        annotations:\n          - \"@Column(nullable = false)\"\n        type: String\n  - name: Company\n    crudRest: true\n    baseclass: BaseEntity\n    comment: Class representing the company parameters\n    fields:\n      - name: user\n        comment: User created\n        annotations:\n          - '@JoinColumn(name=\"user_id\", insertable=false, updatable=false)'\n          - \"@ManyToOne(targetEntity = User.class, fetch = FetchType.EAGER)\"\n          - \"@JsonIgnore\"\n          - \"@ToString.Exclude\"\n        type: User\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedazzo%2Fsbr-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedazzo%2Fsbr-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedazzo%2Fsbr-generator/lists"}