- Project Description
- Database Models
- Backend APIs
- Starting the Backend
- UI
The LibraryServer Provider is a comprehensive web solution designed to automate and facilitate the library's operations. It provides functionality for managing books, user accounts, and borrowing activities, ensuring efficient library management.
- Type: INTEGER
- Description: Unique identifier for each user. Auto-incremented primary key.
- Type: STRING
- Description: The username of the user.
- Validation: Must be between 5 and 20 characters.
- Type: STRING
- Description: The email address of the user.
- Unique: Must be unique.
- Validation: Must be a valid email format.
- Type: STRING
- Description: The password for the user account.
- Type: STRING(11)
- Description: The phone number of the user.
- Validation: Must be exactly 11 characters.
- Type: INTEGER
- Description: The number of books the user can borrow.
- Default Value: 3
- Validation: Must be between 1 and 10 and numeric.
- Type: ENUM('active', 'inactive')
- Description: The status of the user account.
- Default Value: inactive
- Type: ENUM('librarian', 'normal')
- Description: The type of user.
- Default Value: normal
- Has Many: Borrows (User to Borrow)
- Has Many: Books (User to Book)
- Belongs To: Gender (User to Gender)
- Type: INTEGER
- Description: Unique identifier for each book. Auto-incremented primary key.
- Type: INTEGER
- Description: International Standard Book Number.
- Unique: Must be unique.
- Validation: Must be numeric.
- Type: STRING
- Description: The title of the book.
- Type: STRING
- Description: The author of the book.
- Type: STRING
- Description: A brief description of the book.
- Type: INTEGER
- Description: The rack number where the book is located.
- Validation: Must be between 1 and 10.
- Type: STRING
- Description: A URL to the book's cover photo.
- Has Many: Borrows (Book to Borrow)
- Belongs To: User (Book to User)
- Belongs To: Category (Book to Category)
- Type: INTEGER
- Description: Unique identifier for each borrow record. Auto-incremented primary key.
- Type: STRING
- Description: The return date of the borrowed book.
- Allow Null: true
- Type: ENUM('accepted', 'waiting')
- Description: The status of the borrow request.
- Default Value: waiting
- Allow Null: false
- Belongs To: User (Borrow to User)
- Belongs To: Book (Borrow to Book)
- Type: INTEGER
- Description: Unique identifier for each gender. Auto-incremented primary key.
- Type: STRING
- Description: The gender description.
- Has Many: Users (Gender to User)
- Type: INTEGER
- Description: Unique identifier for each category. Auto-incremented primary key.
- Type: STRING
- Description: The category description.
- Has Many: Books (Category to Book)
-
/api/auth/login
- Method:
POST
- Description: Authenticate a user and generate a token
- Method:
-
/api/auth/register
- Method:
POST
- Description: Register a new user
- Method:
-
/api/books
- Method:
GET
- Description: Get all books
- Method:
-
/api/books/join/book-category
- Method:
GET
- Description: Get all books joined with category table
- Method:
-
/api/books/join/book-category-borrow
- Method:
GET
- Description: Get all books joined with category, and borrow tables
- Method:
-
/api/books/:id
- Method:
GET
- Description: Get a book by ID
- Method:
-
/api/books/join/book-category/:id
- Method:
GET
- Description: Get a book by ID joined with category table
- Method:
-
/api/books/join/book-category-borrow/:id
- Method:
GET
- Description: Get a book by ID joined with category, and borrow tables
- Method:
-
/api/books
- Method:
POST
- Description: Add a new book
- Method:
-
/api/books/:id
- Method:
PUT
- Description: Update a book by ID
- Method:
-
/api/books/:id
- Method:
DELETE
- Description: Delete a book by ID
- Method:
-
/api/categories
- Method:
GET
- Description: Get all categories
- Method:
-
/api/categories/join/category-book
- Method:
GET
- Description: Get all categories joined with the book table
- Method:
-
/api/categories/:id
- Method:
GET
- Description: Get a category by ID
- Method:
-
/api/categories/join/category-book/:id
- Method:
GET
- Description: Get a category by ID joined with the book table
- Method:
-
/api/categories
- Method:
POST
- Description: Add a new category
- Method:
-
/api/categories/:id
- Method:
PUT
- Description: Update a category by ID
- Method:
-
/api/categories/:id
- Method:
DELETE
- Description: Delete a category by ID
- Method:
-
/api/genders
- Method:
GET
- Description: Get all genders
- Method:
-
/api/genders/:id
- Method:
GET
- Description: Get a gender by ID
- Method:
-
/api/genders
- Method:
POST
- Description: Add a new gender
- Method:
-
/api/genders/:id
- Method:
PUT
- Description: Update a gender by ID
- Method:
-
/api/genders/:id
- Method:
DELETE
- Description: Delete a gender by ID
- Method:
-
/api/users
- Method:
GET
- Description: Get all users
- Method:
-
/api/users/join/user-gender
- Method:
GET
- Description: Get all users joined with the gender table
- Method:
-
/api/users/join/user-book
- Method:
GET
- Description: Get all users joined with the book table
- Method:
-
/api/users/:id
- Method:
GET
- Description: Get a user by ID
- Method:
-
/api/users/join/user-book/:id
- Method:
GET
- Description: Get a user by ID joined with the book table
- Method:
-
/api/users
- Method:
POST
- Description: Add a new user
- Method:
-
/api/users/:id
- Method:
PUT
- Description: Update a user by ID
- Method:
-
/api/users/:id
- Method:
DELETE
- Description: Delete a user by ID
- Method:
-
/api/borrows
- Method:
GET
- Description: Get all borrows
- Method:
-
/api/borrows/join/user-book
- Method:
GET
- Description: Get all borrows joined with the user, and book table
- Method:
-
/api/borrows/:id
- Method:
GET
- Description: Get a borrow by ID
- Method:
-
/api/borrows/join/user-book/:id
- Method:
GET
- Description: Get a borrow by ID joined with the user, and book table
- Method:
-
/api/borrows
- Method:
POST
- Description: Set a new borrow
- Method:
-
/api/borrows/:id
- Method:
PUT
- Description: Update a borrow by ID
- Method:
-
/api/borrows/:id
- Method:
DELETE
- Description: Delete a borrow by ID
- Method:
To start the backend for the first time, follow these steps:
- Execute the
run_app
script to initialize the application - After running the
run_app
script, you need to stop the application by running thestop_app
script. - Finally, run the
run_app
script once more to start the application.
Your backend server should now be up and running. You can access the API endpoints as described in the Backend APIs section.
Here you can find the implemented Frontend.