Openclassrooms project number 7
This is a Spring Boot application for project number 7 of Openclassrooms java back-end formation.
- Create mapping domain class and place in package com.nnk.springboot.domain
- Create repository class and place in package com.nnk.springboot.repositories
- Create controller class and place in package com.nnk.springboot.controllers
- Create view files and place in src/main/resource/templates
- Create unit test and place in package com.nnk.springboot in folder test > java
- Create user service to load user from database and place in package com.nnk.springboot.config.security.userdetails
- Implement Oauth2 login using GitHub.
- Add configuration class and place in package com.nnk.springboot.security
- Framework: Spring Boot v2.4.5
- Java 8
- Thymeleaf
- Bootstrap v.4.3.1
- Maven 3.8.1
This is how to set up the project locally. To get a local copy up and running follow these simple example steps:
Check that you have :
- Java 8 installed
java -version
- Maven 3.8.1 installed
mvn -v
- Choose a directory for the java project
cd /path/to/directory/project - Clone the repo
git clone https://github.com/jerome13250/JavaDA_PROJECT7_RESTAPI.git
- Select the poseiden directory
cd JavaDA_PROJECT7_RESTAPI\Poseiden-skeleton
- Create the 2 databases in MySQL using the .sql files in JavaDA_PROJECT7_RESTAPI\Poseiden-skeleton\doc.
- data.sql will create the "demo" database.
- data_integration_test.sql will create the "demo_test" database that will be used for integration tests.
- Package the application (fat jar file) using maven.
mvn package
- Execute the jar file
java -jar ./target/spring-boot-skeleton-0.0.1-SNAPSHOT.jar
- To access the application, open your browser, go to http://localhost:8080/user/add to create a new user with login/password to be able to access all the pages of the application.