Skip to content

A secure and scalable note-taking API built with ASP.NET Core, designed to demonstrate real-world backend development skills. It features clean architecture, authentication, ownership control, and flexible search capabilities.

License

Notifications You must be signed in to change notification settings

AbdolrezaKalantari/Note-taking--API

Repository files navigation

Project Logo

📝 NotesApp — Clean Architecture with ASP.NET Core

A secure and scalable note-taking API built with ASP.NET Core, designed to demonstrate real-world backend development skills. It features clean architecture, authentication, ownership control, and flexible search capabilities.


🛠️ Technologies Used

  • ASP.NET Core 8 — Web API framework
  • Entity Framework Core — ORM for database access
  • SQL Server — Relational database
  • AutoMapper — Object-to-object mapping between entities and DTOs
  • Cookie Authentication — Secure user login and session management
  • LINQ — Querying and filtering data
  • Swagger / Swashbuckle — API documentation and testing
  • Clean Architecture Principles — Layered separation of concerns
  • C# 11 — Modern language features
  • Visual Studio 2022 — Development environment

✨ Features

  • 🔐 Authentication with Cookie & Claims — Secure login flow with user identity stored in claims
  • 👤 User Ownership Enforcement — Only the owner of a note can view, update, or delete it
  • 🔍 Flexible Search API — Search notes by title, content, or tags using OR logic
  • 📄 DTO Mapping with AutoMapper — Clean separation between entities and exposed data
  • 🧱 Clean Architecture — Layered structure for scalability and maintainability
  • 🧠 User-Specific Filtering — Logged-in users can retrieve only their own notes
  • 🛡️ Secure Configuration — Sensitive data excluded from public repositories
  • 📚 Ready for Extension — Easily add roles, date filters, dashboards, or UI

📁 Project Structure

  • NotesApp.Api/ # Controllers and API configuration
  • NotesApp.Application/ # Services, DTOs, business logic
  • NotesApp.Domain/ # Entities and interfaces
  • NotesApp.Infrastructure/ # EF Core and repositories

    📦 API Endpoints

Method Endpoint Description
POST /api/notes Create a new note
GET /api/notes Get all notes
GET /api/notes/my-notes Get notes for the logged-in user
GET /api/notes/{id} Get a specific note (ownership enforced)
PUT /api/notes/{id} Update a note (ownership enforced)
DELETE /api/notes/{id} Delete a note (ownership enforced)
POST /api/notes/search Search notes by title, content, or tags

▶️ Getting Started

To run the project locally:

  1. Clone the repository
    git clone https://github.com/AbdolrezaKalantari/Note-taking-API.git
  2. **Configure the connection string
    {
    "Logging": {
     "LogLevel": {
       "Default": "Information",
       "Microsoft.AspNetCore": "Warning"
     }
    },
    "ConnectionStrings": {
     "DefaultConnection": "YourConnectionStringHere"
    },
     "AllowedHosts": "*"
    }
  3. **(Optional) Update the design-time DbContext factory if you're using EF Core CLI tools (e.g., dotnet ef migrations), make sure the connection string in AppDbContextFactory.cs is correct:
optionsBuilder.UseSqlServer("YourConnectionStringHere");

🚀 Ready to build, learn, and showcase — NotesApp is complete.

About

A secure and scalable note-taking API built with ASP.NET Core, designed to demonstrate real-world backend development skills. It features clean architecture, authentication, ownership control, and flexible search capabilities.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages