Web API for library simulation.
- Registration and authorization.
- Retrieve a list of all books.
- Retrieve a list of all authors.
- Retrieve a list of all genres.
- Retrieve a specific book by its Id or ISBN.
- Add a new book.
- Update information about an existing book.
- Delete a book.
- Hire or return a list of books.
- .NET 7.0
- Entity Framework Core
- MS SQL
- JWT Bearer Auth
- Swagger
Clone this repository to your local machine.
Find and open the appsettings.json
file and update the connection string:
"ConnectionStrings": {
"Default": "YOUR_CONNECTION_STRING"
},
Run the following command to launch the application:
$ dotnet run --project .\TestTask.WebApi.csproj --launch-profile https
- A Clean/Onion architecture was chosen for this project. This architecture includes four layers: presentation, application, infrastructure, and core.
- Services were chosen instead of the CQRS approach.
- The Value ID approach was chosen for GUIDs due to its convenience.
- Unauthorized users will receive a 401 error when trying to perform any operation other than registration or login.
- Middleware has been created for global exception handling.
- Passwords are encrypted using an algorithm before being stored in the database.
- Swagger annotations have been added for more detailed descriptions of endpoints.
- Status codes that are returned after endpoints are executed are also described.