Repository is for implementing the next technical task from the course - creating a web-application for digital accounting of books in the library and accounting information about library's readers. You can find more information about task here.
The purpose of the project is using knowledge in practice, learned about the Spring Data JPA, Hibernate frameworks on the course, how it should be used to implement the task. As for me, I haven't got almost any experience of using Spring Data JPA in such tasks, so I want to try it instead of using the JDBC API in web-applications.
In addition to, it is the first project, where I use the Spring Data JPA framework for implementing such technical task.
For running the app you need to download the latest version from the main branch and configure the web-server, the database and connection to it. Follow the next chapters.
For running the project you need the next:
- PostgreSQL 15 - for running the app with database. Also you can use another database. You can find the script of creating database in directory with name "database".
For downloading the project locally you can use two variants:
-
Download the ZIP archive from the repository page.
The method is easy, the next steps helps you:
- Find the button
Code
and press it. - Find the button
Download ZIP
and press it. The downloading must start. - Unzip the archive in soe directory and run the IDEA in this directory.
Project has been installed. After opening it in your IDEA, the
Maven
downloads some additional dependencies. - Find the button
-
Use the
Git
for downloading the repository locally.The method a lit bit difficult, but the project will be downloaded with the help of several commands, and not manually, as in the previous method. For this method you need to install the
Git Bash
on your computer, make some configuration and have a primary skill of using this system of version control.-
Enter your name, email of GitHub account locally on your machine.
-
Create an empty directory and initialize it as git repository. Use the next command -
git init
. -
Adds this repository to yours with name
origin
(you can change it, if you want):$ git remote add origin git@github.com:StasonMendelso/Digital-accounting-of-books-in-the-library-v2.0.git
But you need configure your SSH connection to your GitHub profile in Git Bash. See more here.
For viewing that the repository has been added successfully to your local repository, you need execute the next command and get the following result:
$ git remote -v
After this step your local repository has got a 'connection' to the remote project from the GitHub repository.
-
For downloading the project use the following command:
$ git pull origin
After these steps your project directory must contain the project files from GitHub repository. In addition to, you can create a new branch, make some changes and create a pull request for suggesting your improvements. Also, all changes are observed by the
git
and you can always make a rollback of all changesgit reset --hard
.
-
For running the database you can use as me PostgreSQL or create your own database on another SQL server
using the script file of creating the database.
Note: if you use another server not such
PostgreSQL you should change JDBC driver for working with it and configurate the connection to your
server in appropriate property file, which you must create manually. If you change driver, you should
make some changes in pom.xml file
For running the code you needn't install server and configure it, because the Spring Boot starter makes it instead of you using the pom.xml.
You can find an empty application configuration file,
which must be renamed to "application.properties" instead of "application.properties.origin". This file
contains only keys for configuration the application using the Spring Boot, so you can put your values to the file and run
application with this application configuration. You can find more about configuration of Spring Boot application on
the Internet.
For running the app on the server you need only run the main method in Java class. Also, you can
package app to the jar file and deploy the file on the server manually.
If you want to open them in browser you need to enter one of the two URL:
- "localhost:{port}/{applicationContext}/people" - to open a page with all peoples;
- "localhost:{port}/{applicationContext}/books" - to open a page with all books,
where {port} - is a port, on which you server is running; {applicationContext} - is an application context name, which you give in your application configuration for this app.
Here you can find the screenshots of the web-application:
You can find more photos here.
- Maven - Dependency Management
- Stanislav Hlova - All work - StasonMendelso