The Library Management System is a web application designed to manage books and authors efficiently. Built with .NET 8, React, and PostgreSQL, it provides a simple interface for:
- Adding, viewing, and deleting books
- Managing author information
- Searching books with fuzzy matching
git clone https://github.com/zstoimchev/library-management-system.git LibraryManagement
cd LibraryManagement
Update the database connection string in LibraryManagementApi/LibraryManagementApi/appsettings.json
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Database=database_name;Username=username;Password=password"
}
Apply database migrations to create the Authors and Books tables:
cd LibraryManagementApi/LibraryManagementApi
dotnet ef database update
dotnet restore
dotnet run
The API will run at http://localhost:5144
cd ../../library-client
npm install
npm start
The frontend will open at http://localhost:3000
Navigate to http://localhost:3000
in your browser to access the application.
-
Add Authors:
- Go to the "Add Authors" tab.
- Enter the author's name and date of birth.
- Click "Submit" to save the author.
-
Add Books:
- Navigate to the "Add Book" tab.
- Enter the book’s title, publication year, and select an author from the dropdown.
- Click "Submit" to add the book.
-
Search Books:
- Use the search bar to find books by title.
- Note: Fuzzy matching is still being improved and may not handle all edge cases.
The backend API is accessible at http://localhost:5144
. Below are example endpoints:
-
GET
/books?pageNumber=1&pageSize=10
Retrieves a paginated list of books.
Response (200 OK):{ "total": 25, "books": [ { "id": 1, "title": "Harry Potter", "year": 1997, "author": "J.K. Rowling" }, ... ] }
-
POST
/books
Adds a new book.
Request:{ "title": "The Hobbit", "publicationYear": 1937, "authorId": 4 }
Response (201 Created):
{ "id": 2, "title": "The Hobbit", "year": 1937, "authorId": 4 }
Note: Full API documentation is available at http://localhost:5144/swagger when the backend is running.
/LibraryManagement
├── /LibraryManagementApi # .NET API code
├── /library-client # React app
├── /Readme.md # Project overview and setup instructions
├── /Navodila.md # Instructions for development