Notes API

Back to ASP.Net Core

A RESTful notes management API built with ASP.NET Core Minimal APIs on .NET 10. The project covers the full lifecycle of a backend service: domain modelling, database access via Entity Framework Core, interactive API documentation, and a Docker Compose setup for local development.

Tech

  • ASP.NET Core
  • C#
  • .NET 10
  • Entity Framework Core
  • PostgreSQL
  • Docker
  • Scalar

API

Five endpoints cover the full CRUD surface for notes:

  • GET /notes — paginated list with optional full-text search across title and content.
  • GET /notes/{id} — fetch a single note by ID.
  • POST /notes — create a new note; returns the created entity.
  • PUT /notes/{id} — update title and/or content; sets UpdatedAt automatically.
  • DELETE /notes/{id} — permanently remove a note.

Architecture

  • Minimal API pattern — endpoints defined as extension methods on WebApplication, keeping Program.cs minimal and grouping related routes in NotesEndpoints.cs.
  • EF Core with migrations — PostgreSQL as the production database; schema managed through EF Core migrations.
  • DTOs — separate request/response objects decouple the API contract from the domain model.
  • OpenAPI + Scalar — interactive API reference auto-generated and served at /scalar in development.
  • Docker Compose — single docker-compose.yml spins up the API and a PostgreSQL instance for local development.