A web-based application for managing your book collection, with features for lending, transferring, and tracking books.
- User Authentication: Register, login, and manage your profile
- Book Management: Add, edit, view, and delete books in your collection
- Book Transfer: Transfer book ownership to other users
- Responsive Design: Works well on desktop and mobile devices
-
Frontend:
- HTML5
- Vanilla JavaScript
- Bootstrap 5.3.5 for styling
- RESTful API integration
-
Backend:
- RESTful API (running on http://localhost:3000/api/v1)
- JWT-based authentication
index.html
- Main HTML structure and UI componentsmain.js
- Core JavaScript code handling all application logicswagger.yaml
- API documentation
- Clone the repository
- Ensure the backend API is running at http://localhost:3000/api/v1
- Install
Live Server
extension to your VSCode - Access the application at http://localhost:5500
The application interacts with the following API endpoints:
-
Authentication:
- POST
/register
- Create a new user account - POST
/login
- Authenticate and receive access tokens - POST
/logout
- End user session - POST
/refresh-token
- Refresh authentication tokens
- POST
-
User Management:
- GET
/users/:id
- Get user details - PUT
/users/:id
- Update user information
- GET
-
Book Management:
- GET
/books
- Get list of books - GET
/books/:id
- Get specific book details - POST
/books
- Add a new book - PUT
/books/:id
- Update book details - DELETE
/books/:id
- Remove a book - POST
/books/:id/transfer
- Transfer book ownership
- GET
The application uses a JWT-based authentication system:
- User logs in with email and password
- Server provides access token and refresh token
- Access token is used for authenticated requests
- When access token expires, refresh token is used to obtain a new one
- Tokens are stored in browser's localStorage
To modify the application:
- Edit
index.html
for UI/structure changes - Modify
main.js
for JavaScript functionality - Test changes with the API running
See the LICENSE file for details.