Skip to content

LearningDotNet is an ASP.NET Core Web API project that fetches book data from the Open Library API and serves a responsive frontend UI. It supports full CRUD operations on an in-memory book collection, enabling easy testing and interaction via both API and web interface.

Notifications You must be signed in to change notification settings

VrajVyas11/LearningDotNet

Repository files navigation

LearningDotNet

A simple ASP.NET Core Web API project that dynamically fetches a list of books from the Open Library API and allows users to perform CRUD operations on the locally stored collection.


Live Demo :- Click here


Features

  • Fetches book data dynamically from the Open Library API on first request.
  • Stores the fetched books in a local in-memory collection.
  • Supports Create, Read, Update, and Delete (CRUD) operations on the book collection.
  • Uses HttpClientFactory for external API calls.
  • Minimal and clean REST API design.

API Endpoints

Method Endpoint Description
GET /api/books Get all books
GET /api/books/{id} Get a book by ID
POST /api/books Add a new book
PUT /api/books/{id} Update an existing book
DELETE /api/books/{id} Delete a book

Demo

FrontEnd

Demo Image Swagger

Demo Image Swagger

Swagger

Demo Image Swagger

Replace the above image with your actual demo screenshot.


Getting Started

Prerequisites

Running the Project

  1. Clone the repository or download the source code.

  2. Navigate to the project directory:

    cd LearningDotNet
  3. Restore dependencies and run the project:

    dotnet restore
    dotnet run
  4. The API will be available at:

    https://localhost:5124
    
  5. Use tools like Postman, curl, or your browser to test the endpoints.


Example Requests

  • Get all books:

    curl https://localhost:5124/api/books -k
  • Get a book by ID:

    curl https://localhost:5124/api/books/1 -k
  • Add a new book:

    curl -X POST https://localhost:5124/api/books -H "Content-Type: application/json" -d \
    '{"title":"New Book","author":"Author Name","year":2025}' -k
  • Update a book:

    curl -X PUT https://localhost:5124/api/books/1 -H "Content-Type: application/json" -d \
    '{"id":1,"title":"Updated Title","author":"Updated Author","year":2024}' -k
  • Delete a book:

    curl -X DELETE https://localhost:5124/api/books/1 -k

Technologies Used

About

LearningDotNet is an ASP.NET Core Web API project that fetches book data from the Open Library API and serves a responsive frontend UI. It supports full CRUD operations on an in-memory book collection, enabling easy testing and interaction via both API and web interface.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published