Skip to content

BeyzaKomish/ASP.NET-MVC-LibraryApplication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

📌 Project Title

Development of a Library Management System using ASP.NET Core Identity and Entity Framework


📝 Introduction

This project implements a Library Management System that supports essential functionalities such as:

  • CRUD operations (Create, Read, Update, Delete)
  • User authentication and authorization
  • Layouts with ViewBag/ViewData
  • Tag helpers, forms, and validation

The system allows students to register and log in, while librarians can only log in (not register). Both roles share some features, while others are role-specific.

The application consists of:

  • 3 Controllers
  • 17 Views (including default views)

🛠️ Technologies Used

  • ASP.NET Core Identity → User authentication & role management
  • Entity Framework Core → Data access
  • ASP.NET MVC → Web interface
  • SQLite → Database storage

✨ Features

🔑 User Registration & Authentication

  • Students can register and log in.
  • Librarians can only log in (registration not available).
  • Role-based access control is managed using ASP.NET Core Identity.

👩‍🎓 Student Features

  • Additional properties for student accounts
  • Borrow and return books
  • Leave and list reviews
  • View all books and categorized book lists

📚 Librarian Features

  • Additional properties for librarian accounts
  • Full CRUD operations:
    • Add books, genres, authors, and categories
    • Update and delete books

👥 Shared Features (Students & Librarians)

  • Search for books
  • View book lists
  • Access user info
  • List and view reviews

⚙️ Implementation Details

👤 Users & Models

  • User entity inherits from IdentityUser
  • Student and Librarian inherit from User

Models Implemented:

  • User
  • Student
  • Librarian
  • Author
  • Category
  • Genre
  • Review

🧭 Controllers

  • HomeController → Directs to Account and Dashboard
  • AccountController → Handles login & registration
  • DashboardController → Main functionality for the application

🌱 Seed Data

  • Multiple seed data files created to populate the database in advance
  • Views implemented for almost all actions

🐞 Challenges Faced

During development, several issues were encountered and resolved, including:

  • SQLite Error 19: UNIQUE constraint failed: AspNetUsers.NormalizedUserName
  • Unable to track an entity of type 'User' because its primary key property 'Id' is null
  • FOREIGN KEY constraint failed
  • The model item passed into the ViewDataDictionary is of type 'Book', but requires IEnumerable<Book>
  • System.NullReferenceException: Object reference not set to an instance of an object
  • Request matching multiple endpoints
  • Validation issues (e.g., "Student field is required")

✅ Conclusion

This project successfully demonstrates the development of a Library Management System using ASP.NET Core Identity.

Key concepts implemented:

  • Role-based access control
  • Custom user attributes
  • Integration with a relational database

🔮 Future Improvements

  • Introduce additional roles
  • Enhance UI/UX design
  • Add a notification system
  • Advanced analytics (e.g., student borrowing patterns)

📚 References

  • YouTube tutorials on ASP.NET Core Identity
  • StackOverflow discussions
  • ChatGPT assistance
  • Course documents from the professor

About

This project implements a Library Management System that allows students to register and log in, while librarians can only log in (not register)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages