A modern ASP.NET Core MVC web application for managing a library system, featuring user authentication, book management, JWT-based APIs, and robust logging.
- User registration, login, and profile management (with email confirmation)
- Book CRUD operations (add, list, search, details)
- JWT authentication for secure API access
- Role-based access control
- Email notifications (SMTP)
- Logging with Serilog (console and SQL Server)
- Responsive Razor views
├── Controllers/ # MVC controllers (Account, Library, Home)
├── Data/ # Entity Framework DbContext
├── Interfaces/ # Service and repository interfaces
├── Migrations/ # EF Core migrations
├── Models/ # Entity models (User, Book, etc.)
├── Repositories/ # Data access repositories
├── Services/ # Business logic and utilities (JWT, Email, etc.)
├── Utilities/ # Helper classes
├── ViewModels/ # View models for MVC
├── Views/ # Razor views (Account, Library, Home, Shared)
├── wwwroot/ # Static files (css, js, images)
├── appsettings.json # Main configuration
├── Program.cs # Application entry point
├── LibraryAppMVC.csproj # Project file
- .NET 9 SDK
- SQL Server (local or remote)
- Clone the repository:
git clone https://github.com/yourusername/LibraryAppMVC.git cd LibraryAppMVC
- Configure the database:
- Update the
ConnectionStrings:LibraryDB
inappsettings.json
with your SQL Server details.
- Update the
- Configure SMTP (for email):
- Update the
SMTP
section inappsettings.json
with your email provider credentials.
- Update the
- Configure JWT (optional):
- Adjust the
JwtSettings
inappsettings.json
as needed.
- Adjust the
- Apply migrations:
dotnet ef database update
- Run the application:
The app will be available at
dotnet run
https://localhost:5001
(or as configured).
- Register a new user (email confirmation required)
- Login and manage your profile
- Add, view, search, and manage books
- Admins can manage users and books
- ASP.NET Core MVC (.NET 9)
- Entity Framework Core (SQL Server)
- ASP.NET Identity
- Serilog (logging)
- Razor Views
- Controllers/: Handle HTTP requests and responses
- Models/: Define data entities (Book, User, etc.)
- Services/: Business logic (BookService, AccountService, JwtService, EmailSender)
- Repositories/: Data access logic (BookRepository)
- ViewModels/: Data transfer objects for views
- Views/: UI (Razor pages for Account, Library, Home, Shared)
- Utilities/: Helper classes (e.g., ResultTask)
- Data/: EF Core DbContext (LibraryDB)
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.