Repository is for implementing the 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 framework 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 in such tasks, so I want to try it instead of using the Servlet API in web-applications.
In addition to, it is the first project, where I use the Spring framework for implementing such technical task.
For running the app you need to download the latest version from the main branch and configure the database and connection to it. Follow the next chapters.
For running some branches of the projects you need the next:
- Tomcat 9.0.60 - for running the Spring MVC application part.
- 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.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.
You can find an empty database configuration file,
which must be renamed to "database.properties" instead of "database.properties.origin". This file
contains only keys for configuration the database, so you can put your values to the file and run
application with this database configuration.
For running the code you need install the Tomcat and configure it in your idea. If you use the Intellij IDEA you can click on Run button and choose Edit configuration, then add configuration for Tomcat server. Almost all configuration of app must be added automatically, but check it before running. You can see official guide. After configuration, you can press run button of the server and go to browser to check the application work.
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 server 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