basic-spring-boot-server presents an opioninated implementation of a generic Java backend. The purpose is to provide a groundwork on which real ideas and applications can be prototyped at break-neck speed. Think of basic-spring-boot-server as a base infrastructure on which you can add YOUR custom business logic.
- Spring Framework REST implementation and functionality
- Jetty as our HTTP server
- Spring Boot Actuator for production metrics and endpoints
- User/Role basic authentication and authorization
- Secure field encryption (Bcrypt)
- Spring Data with Hibernate ORM for data access management
- Unit tests that run on build
- DB Seeding
- Custom exceptions and exception handling
- Postgres as a database
basic-spring-boot-server uses gradle as a build tool. First, start by creating a gradle wrapper:
Wrapper: gradle wrapper --gradle-version 2.13
Next, build the project with gradle:
./gradlew build
Lastly, start up your server!
java -jar build/libs/gs-spring-boot-0.1.0.jar
Or execute both commands at once :)
./gradlew build && java -jar build/libs/gs-spring-boot-0.1.0.jar
If this didn't work right away, you might need to configure your local postgres database (next section).
Local DB configuration can be found in application.yml. Replace the existing properties with your local PostgreSQL config. For example:
url=jdbc:postgresql://localhost:5432/YOUR_DATABASE_NAME
username=YOUR_USERNAME
password=YOUR_PASSWORD
basic-spring-boot-server is configured to work with Heroku out of the box. To deploy the application to your Heroku account simply follow the instructions here:
https://devcenter.heroku.com/articles/deploying-gradle-apps-on-heroku
Base production configurations are set up in application.yml.
- Server is configured to run on port 8080
- API security management is configured in WebSecurityConfig.java
- On startup, your database will be seeded with an admin user ("admin"/"admin@bsbs.com")