daisygabi / TemplateWithSpringAndPersistence

Template project with Java, SpringBoot, Flyway, Postgreqsql

Home Page:https://medium.com/@gabrielar/create-a-springboot-flyway-project-in-a-couple-of-minutes-on-github-3dbbdc0ae13

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MyTemplateWithSpringAndPersistence

Template project with SpringBoot, Flyway, Postgreqsql

This projects' soul purpose is to have a base to create a SpringBoot, Flyway project in a couple of minutes. Requirements:

  • Java installed. I used Java 11
  • Postgresql driver installed
  • A terminal (GitBash etc)
  • An editor (IntelliJ etc)
  • A data scheme already created with name: postgres

Steps for getting started with it in Windows:

  1. git clone https://github.com/gabrielaradu/MyTemplateWithSpringAndPersistence.git

  2. Add env variables for: REMOTEDEV_M_DB_SERVER: localhost REMOTEDEV_M_DB_USER: postgres REMOTEDEV_M_DB_PASS: admin REMOTEDEV_M_DB_PORT: 5433

  3. Import/Open your project in your editor

  4. Create database from command line: (Go to bin folder from the Postgresql) $ createdb -h localhost -p 5433 -U postgres buyfood_db password *********

  5. Create SpringBoot application config with below details if you want to run the project from outside of a command line

  1. Try running the unit tests and the integration tests that already exist. They should pass, by the way :)

Flyway is already configured and your first table will be created on running the application. The script is in resources/db.migration/V1__InitDatabase.sql After successfully running the application, an entry will be added in the table "flyway_schema_history". For much more details about Flyway please check their docs: https://flywaydb.org/

When you want to add more endpoints you need to allow them in the WebSecurityConfiguration class specifically or else you will get a HttpsStatus 404 back on trying to reach them.

All the names and credentials from above should be renamed and made unique for your project.

This project can be used only for ethical projects. Copyright @ Gabriela Radu 2020. MIT Licenced.

About

Template project with Java, SpringBoot, Flyway, Postgreqsql

https://medium.com/@gabrielar/create-a-springboot-flyway-project-in-a-couple-of-minutes-on-github-3dbbdc0ae13

License:MIT License


Languages

Language:Java 100.0%