Skip to content

In the project carried out using Angular, situations such as buying and returning books, listing library books, listing the user's books were realized, firebase was used.

Notifications You must be signed in to change notification settings

ozanaydogan/LibraryProjectAngular

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

LibraryProjectAngular

In the project carried out using Angular, situations such as buying and returning books, listing library books, listing user books were carried out, and firebase was used.

Used Technologies

35

Angular 13.1.2
Bootstrap 5.1.3
Firebase
Node.js v16.13.1

Library Project


The purpose of the project, users who have registered and logged in to the system can add or remove from their own list the books found in the specified categories.

As soon as the user registers in the system, the user information is saved in Firebase. Each user has their own User UID.
1

When the user logs into the system, these conditions are checked by the system. If the password is entered incorrectly, logged in with the wrong e-mail, or the e-mail entered during registration has been used before, an error message will be printed on the screen.
3

These situations are controlled by the codes in the app/services/error.interceptor.ts file.
2

After successful registration and login, user information is saved in the browser. Transactions are performed by pulling the current user's data from firebase.
4

While the user is in the login state, the login state is preserved in case of page refresh..
5
6
7

Each user has a token information. According to this token information, the user's login status is constantly checked. If the user's tokenexpirationdate value is less than the current date information or if the tokenexpirationdate value is null, the user is in a direct logout state.
34

Thanks to AuthGuard, it is not possible to access any page of the site without login. for example if we are not in login state, if we try to go to "http://localhost:4200/books" it will redirect us directly to "http://localhost:4200/auth".
8
9

Access zones can be restricted in the Navbar structure depending on the user's login status. Since the "my books" section is only a user-specific feature, this access zone is only shown to logged in users.
10
11

The control of this state is controlled by the isAuthenticated(boolean) state that we defined in the Navbar component. If the user information subscribed by the authService is not null, then a user is in the login state and is "isAuthenticated = true".
12

In navbar.html, access zones are shown according to the control of this state.
13

As soon as the user logs in, all the books in the library are listed.
31

Filtering can be done according to the type of these books. If you want to list the books in the comic book genre, you can click on the comic.
14

You can search the book by typing the name of the book you are interested in in the search section or by typing something about the description of the book.
15
You can do the same with any category selected. performs the query according to the books in that category.

All books in the library can be accessed from the all categories tab. These books are registered under books on firebase.
16

Each book has author, description, id, imageUrl, title, type attributes. These features are registered as models.
17

The id information of the books is determined as 0 in firebase. but since the objects are already kept in firebase with the ids assigned by firebase, the ids assigned by firebase are assigned to the id of the object in the code and operations are performed.
22

With the bookservice structure, the saved books in firebase can be retrieved with the "http get" request.
18

In the same way, we can send the books we created with the "create book" feature on the navbar to the book section in firebase with "http post" request.
19

In case a user is logged in, he can own any book in the library or return the book he owns. Transactions take place in realtime on firebase. You can do this by clicking the "add to list" button of any book you want. The Alertify service indicates an alert at the bottom right of the page regarding the status performed.
20

The process looks like the image in firebase.
21

In the same way, he can return the book that he has refused to buy or that he wants to return, by clicking the "remove from list" button. Operations are performed in realtime under users on firebase.
If the person wants to create any book or category, they are directed to the relevant page by clicking on the "create book", "create category" access places on the navbar.
26

He can fill in all the necessary features of the book he wants to create and click the create button.
23

As soon as the book is created, it is directed to the main page and the status of the transaction with the alertify service is shown at the bottom right.
24

All fields required to create a book must be filled in. otherwise it will show alertify alert error message.
27

The process takes place in realtime on firebase
25

same operations apply in create category. As soon as any category is created, this process takes place on firebase and the book categories change dynamically on the site page.

28
29
30

The person can click on the "my books" section on the navbar to view all the books he owns.
32

In this section, all the books he owns are shown. If you want to return the book he has, he can return the book by clicking the "remove from list" button. It is updated in realtime under users in firebase.

If you want to examine the book in more detail, you can click the details button.

33

If the user wants to exit the system, he can log out by clicking the logout button. User information is deleted from the browser at the time of exit.

OZAN AYDOĞAN KOCAELİ UNIVERSITY COMPUTER ENGINEERING

About

In the project carried out using Angular, situations such as buying and returning books, listing library books, listing the user's books were realized, firebase was used.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published