https://github.com/kamil20020/books
It is the simple books and their related data management with user's normal and admin accounts. Data management is divided into few parts: users, roles, authors, books, publishers. Unlogged users can view data about authors, books and publishers. Logged user can additionally manage data from unlogged user. Admin can view and manage roles and users
https://github.com/kamil20020/books
docker docker-compose github-actions hibernate java kubernetes lombok mapstruct mockito postgresql reactjs rest-assured spring spring-boot spring-data-jpa spring-security spring-web sql testcontainers typescript
Last synced: 3 months ago
JSON representation
It is the simple books and their related data management with user's normal and admin accounts. Data management is divided into few parts: users, roles, authors, books, publishers. Unlogged users can view data about authors, books and publishers. Logged user can additionally manage data from unlogged user. Admin can view and manage roles and users
- Host: GitHub
- URL: https://github.com/kamil20020/books
- Owner: kamil20020
- Created: 2025-02-27T22:27:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-10T20:22:17.000Z (about 1 year ago)
- Last Synced: 2025-04-10T20:42:35.625Z (about 1 year ago)
- Topics: docker, docker-compose, github-actions, hibernate, java, kubernetes, lombok, mapstruct, mockito, postgresql, reactjs, rest-assured, spring, spring-boot, spring-data-jpa, spring-security, spring-web, sql, testcontainers, typescript
- Language: Java
- Homepage:
- Size: 1.88 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Books
Basic crud web app to manage basic data related to books (very simplified). The user will manage users, roles, books, authors, publishers and relations between them.
Parts of the system e.g. frontend and backnd are independently developed on individual branches. The main branch has all the code from the project.
## Running app
I propose to run this app by using command `docker-compose up` in the directory with the docker-compose.yml file. To use this command you need to have Docker (e.g. Docker Desktop on Windows) installed on your
computer and Docker Compose will be installed with it.
Frontend will be available on the http://localhost:80.
Backend will be available on the http://localhost:9000 and you can access swagger (api doc and you can try to send some requests on this page)
from the http://localhost:9000/swagger-ui/index.html. From swagger you can send requests to public endpoints, mainly gets from authors, books and publishers.
It is that, because I didn't configure jwt in swagger yet, but it is possible because of extension based nature of swagger.
I propose to use Postman to have possibility to test all endpoints of the app.
On the start of the app should be created few accounts. These accounts can be used to quickly test the app main functions.
Created accounts details:
| Role | Admin | Normal user |
|-----------|----------|-------------|
| Username | admin | kamil |
| Password | admin123 | nowak |
## Functional requirements
* Register,
* Login,
* Logout,
* Users:
* Search,
* Add,
* Remove,
* View roles,
* Grant/revoke roles.
* Roles:
* View,
* Add,
* Remove.
* Books:
* Search,
* Simple and detailed views,
* Add,
* Edit,
* Remove.
* Authors:
* View,
* Add,
* Remove,
* View author's books.
* Publishers:
* View,
* Add,
* Remove,
* View publisher's books,
* View publisher's authors.
## Functional requirements for actors:
* A logged user can view and manage books, authors and publishers,
* A logged user can additionally add and edit books, add authors and add publishers,
* An admin can additionally view and manage data about users and roles e.g. creating accounts and assigning roles to users.
## Nonfunctional requirements:
### General:
* Test backend by unit and integration tests in close to 100% test coverage.
### Auth:
* Auth and authorization based on JWT - from scratch in Spring Security with both access and refresh tokens,
* Logout by revoking refresh tokens - revocated refresh tokens are stored in the additional table. I assumed that token is revocated when backend have checked, that the token is expired or when the user log out. Backend checks if there are expired tokens every 24 hours,
### Technologies:
* Backend:
* REST,
* Java,
* Spring,
* Spring Boot,
* Spring Data JPA,
* Spring Security,
* Testcontainers.
* Frontend:
* React,
* Redux Toolkit,
* Context Api.
* DevOps:
* Docker,
* Docker Compose,
* Kubernetes,
* Helm (I don't know very much about this technology yet)
* ArgoCD,
* Github Actions.
* Database - PostgreSQL.
## ERD
## API
## Screenshots
### Page layout
Header, content and footer:
The app is responsive to about 500px width:
Open menu:
### Login:
Login:
Success login:
### Users
Users view:
Add user:
Assign role to user:
Edit user:
Delete user:
### Roles:
Roles view:
Add role:
### Authors:
Authors view:
Add author:
Author's books:
### Books:
Books view:
Book's details:
Add book (1/2):
Add book (2/2):
Edit book:
### Publishers:
Publishers view:
Add publisher:
Publisher's authors:
Publisher's books:
### General details:
Almost all data returned from backend are paged:
Operations create notifications:
Most important forms are validated:
Before deletes, there is required confirmation: