Git Product home page Git Product logo

narchitecture.gen's Introduction


nArchitecture Project Code Generator Tool

Report Bug · Request Feature

💻 About The Project

As Kodlama.io, we have chosen to unveil examples of finalized projects. Natively integrated with Clean Architecture principles, nArchitecture CLI tool epitomizes cutting-edge development methodologies. This monolithic project incorporates Clean Architecture, CQRS, Advanced Repository patterns, Dynamic Querying capabilities, JWT and OTP authentication mechanisms, Google & Microsoft Auth integration, Role-Based Management systems, Distributed Caching powered by Redis, Logging functionalities leveraging Serilog, Elastic Search functionalities, and a feature-rich Code Generator. By actively contributing, you not only bolster the project but also acquire invaluable insights and expertise.

Built With

⚙️ Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • .NET 8

Installation

  1. Install the tool globally:

    dotnet tool install --global NArchitecture.Gen

    You can also install the tool locally in the project:

    1. Create dotnet tool manifest:
    dotnet new tool-manifest
    1. Install the tool locally:
    dotnet tool install NArchitecture.Gen

🚀 Usage

  1. Run nArchGen command in project solution directory.

🚧 Roadmap

See the open issues for a list of proposed features (and known issues).

🤝 Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the project and clone your local machine

  2. Create your Feature Branch:

    git checkout -b <Feature>/<AmazingFeature>
  3. Develop

  4. Commit your Changes:

    git add . && git commit -m '<SemanticCommitType>(<Scope>): <AmazingFeature>'

    💡 Check Semantic Commit Messages.

    💡 You can also use Commitizen CLI.

  5. Push to the Branch:

    git push origin <Feature>/<AmazingFeature>
  6. Open a Pull Request

Analysis

  1. If not, Install dotnet tool dotnet tool restore.
  2. Run anaylsis command dotnet roslynator analyze

Format

  1. If not, Install dotnet tool dotnet tool restore.
  2. Run format command dotnet csharpier .

⚖️ License

Distributed under the MIT License. See LICENSE for more information.

📧 Contact

Project Link: https://github.com/kodlamaio-projects/nArchitecture.Gen

narchitecture.gen's People

Contributors

ahmet-cetinkaya avatar halitkalayci avatar muhammet-klc avatar piscu7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

narchitecture.gen's Issues

RefreshToken Hatası

REfresh token mekanizmassı çalışmıyor. Token sonsuz döngü yaratıyor. Aşağıdaki de hata mesajımız:

System.Text.Json.JsonException: A possible object cycle was detected. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32. Consider using ReferenceHandler.Preserve on JsonSerializerOptions to support cycles. Path: $.RefreshToken.User.RefreshTokens.User.RefreshTokens.User.RefreshTokens.User.RefreshTokens.User.RefreshTokens.User.RefreshTokens.User.RefreshTokens.User.RefreshTokens.User.RefreshTokens.User.RefreshTokens.UserId.

Sorun bence RefreshToken türü ile user arasında oluşturulan llişkiden veya komple refresh token mekanizmasından kaynaklı

For MacOs

nArchGen i Mac veya unix bilgisayarlarda çalıştırmak için path yollarını gösteren "" işaretlerinin "/" ile değiştirilmesi gerekiyor. fakat nasıl yapabileceğimi bulamadım. yardımcı olursanız sevinirim.

Auth Business Rules GetLocalizedAsync Method Error #160

341905048-8ae95253-ec72-4bce-afe3-31c5b0a23c56
Swagger'da hatasız bir şekilde çalışırken Postman vb. şekilde işlem yaptığımda
{
"type": "https://example.com/probs/internal",
"title": "Internal server error",
"status": 500,
"detail": "Internal server error"
}
şeklinde bir çıktı alıyorum.
Swagger'da olması gerektiği gibi bu şekilde bir çıktı alabiliyorum.

{
"type": "https://example.com/probs/business",
"title": "Rule violation",
"status": 400,
"detail": "PasswordDontMatch"
}

Ek olarak otomatik olarak oluşturulan yaml dosyaları ile eşleştirip olması gereken mesajı dönmüyor. Code şeklinde mesajda yazdırıyor. UserNotFound gibi normalde, yaml dosyasından veriyi getirip user not found yazması lazım.

Cannot run Update-Database

The tool does not allow running Update-Database command because DbContext is not configured for the connection string. The closed suggestion of running DesignTimeDbContextFactory does not work. Please resolve this error.

narchgen generate crud (Hatası)

Projede yeni bir sınıf oluşturalım. İsimlendirme kısmında dikkat edilmesi gereken bir durum var. Oluşturduğumuz sınıfların isimlerinin sonuna sadece sayı ekleniyor, örneğin: Deneme2 gibi. Sonrasında "narchgen generate crud" komutu ile generate işlemine başlayalım. İçeride istediğimizi seçerek oluşturun.
Ancak, şu bir hata var: "narchgen generate crud" komutunu çalıştırdığımızda, Application/Features altında dosya oluştururken normalde Deneme2s yapmasını bekleriz. Ancak bu, doğru şekilde yapılmıyor ve sadece Deneme2 olarak oluşturuluyor. Bu durum, domain içindeki referansı karıştırarak hata almamıza neden oluyor.

Cache sistemi yeterli mi?

Örnek bir senaryo vereceğim ve bu senaryo için cache sisteminin yeterli olup olmadığını eğer yeterliyse nasıl kullanmamız gerektiğini soracağım.

Senaryo: bir muhasebe sistemi düşünelim, Cari hesapların, faturaların ve ödemelerin tutulduğu 3 tablo olsun.
Cari hesabın Borç alacak farkı yani bakiyesi, o carihesapla ilişkili tüm faturaların tutarı(borç) ve ilişkili tüm ödemelerin tutarı(alacak) farkı ile bulunuyor olsun. listelenirken üçünün de ayrı listelendiği sayfalar olsun. Fatura yeni eklenince hem kendi cacheninin silinmesi hem de CariHesabın listelendiği cache'in temizlenmesi gerekiyor, aynı şekilde ödemeler için de geçerli.

Özetle: Bir tablodaki veri diğer tablolardaki verilere göre geliyorsa bu sistemde cache yapısı nasıl olmalı.

Not: Derdimi daha iyi anlatmak için Türkçe yazdım :)

Entity Framework .Net CLI işlemlerindeki hataya çözüm

Diyelimki vs editörümüz yok veya mac bir bilgisayarımız var bu durumda vs da ki Package Manager di sanırım bu olmadığından dolayı .Net CLI kullanarak migratiosn işlemleri yapmamız gerekicek . Buradaki hata da tam olarak bu dur . Aşağıdaki kodu eklerseniz sorun çözülüyor . Sevdiğim bir Code generator olduğu için bunun da sisteme eklenmesini isterim.

  •       namespace Persistence.Contexts;
    
           public class DesingTimeDbContextFactory : IDesignTimeDbContextFactory<BaseDbContext>
           {
               public BaseDbContext CreateDbContext(string[] args)
               {
                   IConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
           
                   string basePath = Path.Combine(Directory.GetCurrentDirectory(), "..", "WebAPI");
                   configurationBuilder.SetBasePath(basePath);
           
                   // appsettings.json dosyasının olduğu yolu ekleyin
                   configurationBuilder.AddJsonFile("appsettings.json");
           
                   IConfiguration configuration = configurationBuilder.Build();
           
                   // appsettings.json içindeki "BaseDb" bağlantı dizesini alın
                   string connection = configuration.GetConnectionString("BaseDb");
           
                   // DbContextOptionsBuilder kullanarak bağlantıyı belirtin
                   DbContextOptionsBuilder<BaseDbContext> dbContextOptionsBuilder = new DbContextOptionsBuilder<BaseDbContext>();
                   dbContextOptionsBuilder.UseSqlServer(connection);
           
                   // BaseDbContext örneğini oluşturun ve bağlantıyı geçirin
                   return new BaseDbContext(dbContextOptionsBuilder.Options);
               }
           }

Logout methodu eksikliği

Generated apilerimizde Logout methodu yok. AccessTokeni revoke da edemiyoruz. Bu özellik eklenmeli diye düşünüyorum

Entities alt klasörleri için alt projelerin de oluşturulabilmesi

Entities Klasörünün altına birbirinde farklı domainlere ait entityleri farklı klaörlere koyduğumuz varsayalım. Örneğin Bir klasör Customer olsun diğer bir klasör Product olsun. Generatorun bu iki alt klasörü algılayıp bunlar için ayrı alt projeler oluşturabilse faydalı olurdu.

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.