https://github.com/monogramm/spring-rest-api-starter
:coffee: A "simple" starter project custom RESTful API using Spring.
https://github.com/monogramm/spring-rest-api-starter
java spring spring-boot spring-data spring-security starter-kit
Last synced: 8 months ago
JSON representation
:coffee: A "simple" starter project custom RESTful API using Spring.
- Host: GitHub
- URL: https://github.com/monogramm/spring-rest-api-starter
- Owner: Monogramm
- License: agpl-3.0
- Created: 2018-01-17T13:00:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-03T17:24:47.000Z (over 1 year ago)
- Last Synced: 2025-04-14T06:37:37.887Z (11 months ago)
- Topics: java, spring, spring-boot, spring-data, spring-security, starter-kit
- Language: Java
- Homepage:
- Size: 986 KB
- Stars: 16
- Watchers: 2
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# README
[](http://www.gnu.org/licenses/agpl.html)
[](https://gitpod.io/#https://github.com/Monogramm/spring-rest-api-starter)
[](https://github.com/Monogramm/spring-rest-api-starter/actions/workflows/hooks.yml)
[](https://codecov.io/gh/Monogramm/spring-rest-api-starter)
[](https://hub.docker.com/r/monogramm/spring-rest-api-starter/)
[](https://hub.docker.com/r/monogramm/spring-rest-api-starter/)
### What is this repository
A 'simple' starter project custom RESTful API.
The project uses Spring Boot, a connection to a database and a connection to a mail server.
## Prerequisites
0. Globally installed [Git](https://git-scm.com/), [JDK](https://www.java.com/download/) (8 at least) and [Maven](https://maven.apache.org/).
The project should work with the following databases:
- [MySQL](https://www.mysql.com/) / [MariaDB](https://mariadb.org/)
- [PostgreSQL](https://www.postgresql.org/)
- [Java H2](http://www.h2database.com)
Edit the `application.properties` depending on the database system you need (see _installation_).
### Installation
- `git clone https://github.com/monogramm/spring-rest-api-starter.git`
- `cd spring-rest-api-starter`
Finally, edit the properties in `application.properties` to your needs (name, db, mail, etc...) and compile the project.
- `mvn clean install`
The application will automatically setup the database. See `InitialDataLoader.java` for details.
## Run Backend API
- `mvn spring-boot:run`
You can now access your API at `http://localhost:8080/spring-rest-api-starter/api/`
## Tests
### Unit Tests
- `mvn test`
### Integration Tests
- `mvn verify`
Be careful as the IT will startup the server and test the actual functions. This means that all application properties must be valid for integration, even mail ones (not mocked).
The IT use there own [application.properties](src/integration-test/resources/application.properties) which defaults to a in memory H2 database and in memory GreenMail mail server.
## Release
- `mvn release:prepare`
- `mvn release:perform`
### Documentation
It is possible to generate documentation using JavaDoc
- `mvn site`
Also, the application uses Swagger to document the API.
When running the backend API, go to `http://localhost:8080/spring-rest-api-starter/api/v2/api-docs`
### Docker
A Dockerfile and docker-compose template are available at the root of this project.
After building the project, the docker image can be created:
mvn clean install
docker build --build-arg=target/*.jar -t "monogramm/docker-spring-rest-api-starter" "."
### Tools
A helper script is available at the root of this project: `tools.sh`
It can be used for common operations
### Contribution guidelines
See [CONTRIBUTING](CONTRIBUTING.md) file.
### License
This product is distributed under the GNU Affero General Public License v3.0.
See the complete license in the bundle:
[Read the license](https://github.com/Monogramm/spring-rest-api-starter/blob/master/LICENSE)
### Who do I talk to?
- [madmath03](https://github.com/madmath03)
### Awesome contributors
- [ebacem](https://github.com/ebacem)
- [vinctix](https://github.com/vinctix)