Code Monkey home page Code Monkey logo

apiproject-onioncqrs's Introduction

Onion Architecture - CQRS Design Pattern Api Project

Kullanılan Teknolojiler

  • C# .Net Core 7.0 Web Api
  • Entity Framework Core
  • Microsoft Identity
  • Fluent Validation
  • Auto Mapper
  • Mssql
  • JWT
  • Redis Cache

Proje Detayları

Projemi onion(clean) architecture ile geliştirdim. Mediatr kütüphanesi ile CQRS design pattern uyguladım. Küçük bir e-ticaret alt yapısı kurguladım ve asıl amacım deneyim kazanmak. Projede Kategori, Ürün, Marka, Kullanıcı, Rol tabloları oluşturdum. Global Exception Middleware yazarak exceptionları Middleware seviyesinde global olarak yakaladım ve gerekli işlemleri yaptım. Fluent Validation kütüphanesini kullanarak Validation PipelineBehavior geliştrdim ve validasyonlarımı Mediatr sayesinde burada yaptım. AutoMapper ile mapleme işlemlerini gerçekleştirdim. Güvenlik olarak JWT kullandım. Projemde iş kurallarını nesne bazında Rules olarak geliştirdim bu sayede iç içe karmaşık ''if-else'' yazmamış oldum. Her iş kuralının kendine ait exception sınıflarını kodladım. Daha okunaklı gelişime daha açık hale gelmiş oldu. Cache için Redis kullandım. Yine Rediside PipelineBehavior ile geliştirdim ve isteklerimi cache tutup cacheTime geçmediyse mevcutta bir cache varsa cevap olarak buradan döndüm. Bogus kütüphanesini kullanarak 1milyon fake data ekledim ve bunu Sql sorgusu - Entity Framework - Cache olarak cevap sürelerini karşılaştırdım. Projeyi tamamen deneyim amaçlı geliştirdim.

Clone oluşturmak için

Visual studio ide üzerinden projeyi locale çektikten sona Presentation katmanında api projesi altında 'appsettings.Development.json' dosyasında Database yolunu belirtebilirsiniz. Yine bu dosya içerisinde projenin JWT ve Redis ayarlarıda tutulmaktadır redis db içinde connectionString verip çalıştırabilirsiniz. Brand Controller içerisinde CreateBrand metodunda fake 1milyon brand oluşturacaktır istek atarken dikkat edilmesi gerekmektedir.

apiproject-onioncqrs's People

Contributors

melihhok avatar melihomer avatar

Watchers

 avatar

Forkers

shsahin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.