Skip to content

Commit e0c1a00

Browse files
authored
Merge pull request #146 from cvazquezlos/carlos
Release changes.
2 parents f0673f3 + 78d2a58 commit e0c1a00

26 files changed

Lines changed: 151 additions & 29 deletions

README.md

Lines changed: 132 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BREMS - Book Reserve Management System
22

3-
### About the contributors
3+
## About the contributors
44
+ Blay González, Sergio
55
- [Github account](https://github.com/Blay93).
66
- Email: s.blay@alumnos.urjc.es
@@ -14,12 +14,12 @@
1414
- [Github account](https://github.com/cvazquezlos).
1515
- Email: c.vazquezlos@alumnos.urjc.es
1616

17-
### About this web application
17+
## About this web application
1818
Online management of resources (books and magazines) in a library. Each resource has a copy which a reader can reserve. This resource will be taken by a reader for 30 days (in case of a books) and for 2 days (in case of magazines).
1919
An administrator will manage the resource loans, resource stock and resource copies.
20-
Web functionality deppends on type of user (administrator o reader).
20+
Web functionality deppends on type of user (administrator o reader). [Link](https://www.youtube.com/watch?v=qlVj2XOEnFA) to explicative video about BREMS (spanish).
2121

22-
#### Users: Readers
22+
### Users: Readers
2323
A reader is an user who can reserve a resource through BREMS app. Those functionalities are public:
2424
+ List of resources.
2525
+ Search resources using a *title*, *author* y/o *resource name*.
@@ -29,7 +29,7 @@ A reader is an user who can reserve a resource through BREMS app. Those function
2929
+ List of fines.
3030
+ Sing-up.
3131

32-
#### Users: Administrator
32+
### Users: Administrator
3333
An administrator is an user who can manage resource data and the loans. Those functionalities are private:
3434
+ Manage resources (books and magazines).
3535
- Modify resources.
@@ -43,7 +43,7 @@ An administrator is an user who can manage resource data and the loans. Those fu
4343
- Unsubscribe a user.
4444
- Modify user's information.
4545

46-
#### Entities of BREMS' App
46+
### Entities of BREMS' App
4747
In our App, we use these entities: *User*, *fine*, *resource*, *loan* and *copy*.
4848

4949
| Entity | Description | Secondary entities |
@@ -54,55 +54,64 @@ In our App, we use these entities: *User*, *fine*, *resource*, *loan* and *copy*
5454
| Loan | Action through a reader can reserve a copy. | ActionType and Token |
5555
| Copy | Limited number of resource number which can be reserved by a reader. | - |
5656

57-
#### Tasks management
57+
### Tasks management
5858
We use [Trello](https://trello.com/b/3hdFhIap/brems) and SCRUM because we think is the best way to work in a group.
5959

60-
#### Views of app
61-
This app contains views (each page which makes this website useful). As a library, the home page contains a list of all books and magazines avaible. This design is originally made by @annyCS.
60+
### App views
61+
Backend contains views (each page which makes this website useful). As a library, the home page contains a list of all books and magazines avaible. This design is originally made by @annyCS.
6262

63-
##### Index page
63+
#### Index page
6464
![index][index]
6565

66-
##### About page
66+
#### About page
6767
![about][about]
6868

69-
##### Contact page
69+
#### Contact page
7070
![contact][contact]
7171

72-
##### Search page
72+
#### Search page
7373
![search][search]
7474

75-
##### Profile page
75+
#### Profile page
7676
![profile][profile]
7777

78-
##### Admin page
78+
#### Admin page
7979
![admin][admin]
8080

81-
##### Admin resources page
82-
###### Resources general view
81+
#### Admin resources page
82+
##### Resources general view
8383
![admin-resources][admin-resources]
8484

85-
###### Edit resource page
85+
##### Edit resource page
8686
![admin-resources-edit][admin-resources-edit]
8787

88-
###### Add resource page
88+
##### Add resource page
8989
![admin-resources-add][admin-resources-add]
9090

91-
##### Admin loans page
92-
###### Loans general view
91+
#### Admin loans page
92+
##### Loans general view
9393
![admin-loans][admin-loans]
9494

95-
###### Add loans page
95+
##### Add loans page
9696
![admin-loans-add][admin-loans-add]
9797

98-
##### Admin users page
99-
###### Users general view
98+
#### Admin users page
99+
##### Users general view
100100
![admin-users][admin-users]
101101

102-
###### Add user page
102+
##### Add user page
103103
![admin-users-add][admin-users-add]
104104

105-
#### App controllers class diagrams
105+
## Backend
106+
### Running BREMS Backend
107+
You must have MySQL installed, your conection credentials must be "root" and "1234" (user and pass) and you need to have a MySQL Schema called "BREMS".
108+
1. Download this repository (or clone it).
109+
2. Navigate to "backend/target".
110+
3. Using your shell, execute `java -jar appSpring-0.0.1.jar`.
111+
4. Using Google Chrome (any browser can be used) navigate to "https://localhost:8443".
112+
5. Enjoy it!
113+
### Backend diagrams
114+
#### Backend controllers class diagrams
106115
##### AdminController and services relationships
107116
![admin-controller-and-services][admin-controller-and-services]
108117

@@ -118,7 +127,7 @@ This app contains views (each page which makes this website useful). As a librar
118127
##### UserController and services relationships
119128
![user-controller-and-services][user-controller-and-services]
120129

121-
#### App services class diagrams
130+
#### Backend services class diagrams
122131
##### LogicService class diagrams
123132
###### LogicService and services relationships
124133
![logic-service-and-services][logic-service-and-services]
@@ -148,6 +157,80 @@ This app contains views (each page which makes this website useful). As a librar
148157
##### UserRestController and services relationships
149158
![user-rest-controller][user-rest-controller]
150159

160+
## Frontend
161+
### Running BREMS Frontend
162+
1. Download this repository (or clone it).
163+
2. Navigate to "frontend".
164+
3. Using your shell, execute `npm install` and then `ng serve`.
165+
4. Using Google Chrome (any browser can be used) navigate to "http://localhost:4200".
166+
5. Enjoy it!
167+
### Frontend diagrams
168+
#### Frontend services
169+
##### ActionService
170+
![action-service][action-service]
171+
172+
##### FileService
173+
![file-service][file-service]
174+
175+
##### FineService
176+
![fine-service][fine-service]
177+
178+
##### GenreService
179+
![genre-service][genre-service]
180+
181+
##### ResourceCopyService
182+
![resource-copy-service][resource-copy-service]
183+
184+
##### ResourceService
185+
![resource-service][resource-service]
186+
187+
##### SessionService
188+
![session-service][session-service]
189+
190+
##### UserService
191+
![user-service][user-service]
192+
193+
#### Public module
194+
##### Public component
195+
![public-component][public-component]
196+
197+
##### Public module
198+
![public-module][public-module]
199+
200+
##### Public routing module
201+
![public-routing-module][public-routing-module]
202+
203+
##### HomeComponent
204+
![home-component][home-component]
205+
206+
##### ProfileComponent
207+
![profile-component][profile-component]
208+
209+
#### Admin module
210+
##### Admin component
211+
![admin-component][admin-component]
212+
213+
##### Admin module
214+
![admin-module][admin-module]
215+
216+
##### Admin routing module
217+
![admin-routing-module][admin-routing-module]
218+
219+
##### DashboardComponent
220+
![dashboard-component][dashboard-component]
221+
222+
##### ManageFinesComponent
223+
![manage-fines-component][manage-fines-component]
224+
225+
##### ManageLoansComponent
226+
![manage-loans-component][manage-loans-component]
227+
228+
##### ManageResourcesComponent
229+
![manage-resources-component][manage-resources-component]
230+
231+
##### ManageUsersComponent
232+
![manage-users-component][manage-users-component]
233+
151234
[index]: /media/README/01-homePage.png
152235
[about]: /media/README/02-aboutPage.png
153236
[contact]: /media/README/03-contactPage.png
@@ -174,4 +257,25 @@ This app contains views (each page which makes this website useful). As a librar
174257
[resource-copy-rest-controller]: /media/README/24-ResourceCopyRestControllerRelationships.png
175258
[resource-rest-controller]: /media/README/25-ResourceRestControllerRelationships.png
176259
[resource-type-rest-controller]: /media/README/26-ResourceTypeRestControllerRelationships.png
177-
[user-rest-controller]: /media/README/27-UserRestControllerRelationships.png
260+
[user-rest-controller]: /media/README/27-UserRestControllerRelationships.png
261+
[action-service]: /media/README/28-ActionService.png
262+
[file-service]: /media/README/29-FileService.png
263+
[fine-service]: /media/README/30-FineService.png
264+
[genre-service]: /media/README/31-GenreService.png
265+
[resource-copy-service]: /media/README/32-ResourceCopyService.png
266+
[resource-service]: /media/README/33-ResourceService.png
267+
[session-service]: /media/README/34-SessionService.png
268+
[user-service]: /media/README/35-UserService.png
269+
[public-component]: /media/README/36-PublicComponent.png
270+
[public-module]: /media/README/37-PublicModule.png
271+
[public-routing-module]: /media/README/38-PublicRoutingModule.png
272+
[home-component]: /media/README/39-HomeComponent.png
273+
[profile-component]: /media/README/40-ProfileComponent.png
274+
[admin-component]: /media/README/41-AdminComponent.png
275+
[admin-module]: /media/README/42-AdminModule.png
276+
[admin-routing-module]: /media/README/43-AdminRoutingModule.png
277+
[dashboard-component]: /media/README/44-DashboardComponent.png
278+
[manage-fines-component]: /media/README/45-ManageFinesComponent.png
279+
[manage-loans-component]: /media/README/46-ManageLoansComponent.png
280+
[manage-resources-component]: /media/README/47-ManageResourcesComponent.png
281+
[manage-users-component]: /media/README/48-ManageUsersComponent.png

frontend/src/app/component/admin/manage-fines/manage-fines.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h1>
2525
<tr>
2626
<td>{{fine?.id}}</td>
2727
<td>{{fine.user?.name}}</td>
28-
<td>{{fine.resourceCopy?.title}}</td>
28+
<td>{{fine.resourceCopy?.resource.title}}</td>
2929
<td>Default</td>
3030
<td>{{fine?.initDate}} - {{fine?.finishDate}}</td>
3131
<td>

frontend/src/app/component/admin/manage-resources/edit/edit.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ export class EditResourceComponent implements OnInit {
8484
this.errorMessage = false;
8585
this.message = 'Recurso editado correctamente.';
8686
this.getResource();
87+
this.fileService.getResourceFile(this.resource.id).subscribe(
88+
data => {
89+
let dataRecieved: string[] = data.split('"');
90+
this.resource.image = 'data:image/png;base64,' + dataRecieved[3];
91+
},
92+
error => console.log('Fail adding resource ' + this.resource.title + 'image.')
93+
);
8794
},
8895
error => {
8996
this.successMessage = false;

frontend/src/app/component/public/public.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import {User} from "../../model/user.model";
1111
export class PublicComponent {
1212

1313
constructor() {
14+
if (localStorage.getItem('user') !== 'sergiob') {
15+
localStorage.clear();
16+
}
1417
}
1518

1619
@ViewChild(ModalLogin)

frontend/src/app/component/public/user/profile.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ export class ProfileComponent implements OnInit, DoCheck {
9494
ngDoCheck() {
9595
if(this.user != this.userService.getUserCompleted()){
9696
this.ngOnInit();
97+
this.userImage = null;
98+
this.fileService.getUserFile(this.user.id).subscribe(
99+
data => {
100+
let dataRecieved: string[] = data.split('"');
101+
this.userImage = 'data:image/png;base64,' + dataRecieved[3];
102+
},
103+
error => console.log("Fail trying to charge " + this.user.name + " image.")
104+
);
97105
}
98106
}
99107

media/README/28-ActionService.png

22.2 KB
Loading

media/README/29-FileService.png

18.2 KB
Loading

media/README/30-FineService.png

18.9 KB
Loading

media/README/31-GenreService.png

15.5 KB
Loading
23.7 KB
Loading

0 commit comments

Comments
 (0)