Skip to content

g-otn/spring-boot-wine-crud

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-wine-crud

A wine crud made using Spring Boot. This my project for the AlgaWorks's Spring Boot course.

Features

  • Create, read and update of wine
  • Login with hard-coded users and roles
  • Wine image upload and storage with s3Ninja
Click to show screenshots

read page create page wine page wine page upload

Installation

  1. Setup your environment for Spring Framework and to open this project.
  2. Install the Maven dependencies.
  3. Install MySQL
  4. Setup your MySQL to create your user and database.
  5. In the project, change the src/main/resources/application.properties file to match your MySQL credentials and database URL.
  6. (Optional) Go to src/main/java/com/algaworks/vinho/config/SecurityConfig.java to view the hard coded users and/or add your own user and their role(s):
    • Available roles: LISTAR_VINHO (permission to read) and CADASTRAR_VINHO (permission to create/update).
// ...
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.inMemoryAuthentication()
            .withUser("USERNAME_HERE").password("{noop}PASSWORD_HERE").roles("CADASTRAR_VINHO", "LISTAR_VINHO");
}
// ...
  1. Download s3Ninja (project developed with s3Ninja version 2.7).
  2. Start s3Ninja by navigating to its folder and running the IPL.class file: java IPL.
  3. (Likely to not be needed) In the project, go to the src/main/java/com/algaworks/vinho/config/AmazonConfig.java and change the credentials to match the one specified by s3Ninja (displayed at http://localhost:9444).
// ...
    AWSCredentials credentials = new BasicAWSCredentials("ACCESS KEY HERE", "SECRET KEY HERE");
    // ...
  1. Build and run the project. By accessing http://localhost:8080, you should be redirected to the /login page.

PS: Flyway should create the necessary table automatically when you run the project. If not, use the SQL scripts located at src/main/resources/db.migration.

Acknowledgements

leluque for assigning me this project's course.

Packages

No packages published

Languages

  • HTML 51.5%
  • Java 38.6%
  • CSS 5.1%
  • JavaScript 4.0%
  • TSQL 0.8%