A "simple" starter project custom RESTful API using Spring.
684
A 'simple' starter project custom RESTful API.
The project uses Spring Boot, a connection to a database and a connection to a mail server.
The project should work with the following databases:
Edit the application.properties depending on the database system you need (see installation).
git clone https://github.com/monogramm/spring-rest-api-starter.gitcd spring-rest-api-starterFinally, edit the properties in application.properties to your needs (name, db, mail, etc...) and compile the project.
mvn clean installThe application will automatically setup the database. See InitialDataLoader.java for details.
mvn spring-boot:runYou can now access your API at http://localhost:8080/spring-rest-api-starter/api/
mvn testmvn verifyBe 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 which defaults to a in memory H2 database and in memory GreenMail mail server.
mvn release:preparemvn release:performIt is possible to generate documentation using JavaDoc
mvn siteAlso, 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
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" "."
A helper script is available at the root of this project: tools.sh
It can be used for common operations
See CONTRIBUTING file.
This product is distributed under the GNU Affero General Public License v3.0. See the complete license in the bundle:
Content type
Image
Digest
Size
137.9 MB
Last updated
over 5 years ago
docker pull monogramm/spring-rest-api-starter