- .NET 8
- PostgreSQL
- RabbitMQ
- Fluent Validation
- ABP Framework
docker-compose.yml dosyasını çalıştırın.
docker compose up -d
Aşağıda belirtilen projelerdeki appsettings.json connection string ifadelerini güncelleyin.
KariyerNet.Recruitment.DbMigrator
: appsettings.jsonKariyerNet.Recruitment.AuthServer
: appsettings.jsonKariyerNet.Recruitment.HttpApi.Host
: appsettings.json
İlk kurulum için KariyerNet.Recruitment.DbMigrator projesini çalıştırın. Bu sayede migration işlemleri belirtilen connection string'e veritabanına yapılacaktır.
Uygulamaları ayağa kaldırmak için KariyerNet.Recruitment.AuthServer
ve KariyerNet.Recruitment.HttpApi.Host
uygulamalarını çalıştırın.
KariyerNet.Recruitment.AuthServer
Uygulaması ekran görüntüsü
KariyerNet.Recruitment.HttpApi.Host
Uygulaması ekran görüntüsü
KariyerNet.Recruitment.Domain
: Uygulamanın domain modülü. Bu modülde entityler, domain servisler, seed datalar yer almaktadır.
KariyerNet.Recruitment.Domain.Shared
: Uygulamanın domain shared modülü. Bu modülde entityde kullanılan enumlar, const değerleri vb. bulunmaktadır.
KariyerNet.Recruitment.EntityFrameworkCore
: Uygulamanın ef core modülü. Bu modülde DbContext ve buna bağlı ayarlar bulunmaktadır.
KariyerNet.Recruitment.Application
: Uygulamanın application modülü. Bu modülde uygulamanın servisleri yer almaktadır.
KariyerNet.Recruitment.Application.Contracts
: Uygulamanın application contracts modülü. Bu modülde çoğunlukla dto, eto sınıfları yer almaktadır.
- Uygulamada bir ilan oluşturulduğunda ya da güncellendiğinde otomatik olarak bir event fırlatılıyor. Bu eventi RabbitMQ kullanarak ilgili queue'ya yönlendiriyoruz. Bu queue'yu dinleyen consumer aşağıda belirtilen handler ile yakalanıp işleniyor.
JobAdvertCreatedOrUpdatedEventHandler.cs
Recruitment API Postman Collection
Uygulama SaaS yapıda. Host ile ilan, yan haklar, pozisyonlar, yasaklı kelimeler endpointleri kullanılamayacak yapıda tasarlandı. (Permissionlar ile. İlgili permissionlar sadece tenant için kullanılabiliyor.) Bu yüzden de ilgili endpointleri kullanabilmek için tenant kullanıcına ihtiyacımız var. Tenant kullanıcısı için de tenant'a ihtiyacımız var.
Bu yüzden ilk olarak host kullanıcısı ile login olup daha sonra tenant oluşturmalıyız.
Sonrasında tenant oluşturuyoruz. Token setlememize gerek yok. Otomatik olarak Bearer token setlenecektir.
Tenant oluşturulduğu için ilgili tenant'a geçip endpointleri test edebiliriz. Bunun için tekrar login olmamız gerekiyor.
İlk olarak cookieleri temizlemeliyiz. (Aksi halde yanlış tenant bilgisini cookieden çekip ona login olmaya çalışabilir.)
Daha sonrasında __tenant
key değeri olarak tenant bilgisini yani test_firma
değerini geçmemiz gerekli.
Tenant oluştururken tenant'a ait olan kullanıcı bilgilerinin girildiğinden emin olun.
NOT:
Örnek tenant admin kullanıcısı üzerinden ilerlemiştir. Yeni bir kullanıcı oluşturup ilgili permissionlar setlendikten sonra oluşturulan kullanıcı için de testler yapılabilir. Fakat bu daha uzun bir işlem olduğundan dolayı tenant admin üzerinden ilerlemek daha uygun.
Artık endpointlere istek atıp testleri gerçekleştirebiliriz. Örneğin pozisyonlar için ekran şu şekilde olacaktır. (Her tenant oluşumunda seed data tetiklendiği için bir kaç pozisyon test kullanım için hazır gelmekte.)
Örneğin ilanlara istek atarsak kayıt sayısını 0 görürürüz.
İlan ekleyelim.
2 den fazla eklediğimizde aşağıdaki gibi hata alırız. (Her kullanıcı için maks 2 adet ilan oluşturulabilir.)
Listeleme yaptığımızda bu kullanıcıya ait olan ilanları görürüz.
İlan ile ilgili detaylı bilgiye erişmek için aşağıdaki gibi istek atabilirsiniz. (İlana ait olan pozisyon ad ve tanım bilgisini içerir.) Ek olarak quality değerinin de 5 olduğuna dikkat edelim. RabbitMQ yapısı doğru çalışıp değeri 5 olarak setlemiş.
- PostreSQL bilgileri
Host
: localhost => docker için dbPort
: 5432Database
: RecruitmentUser ID
: adminPassword
: 1q2w3E*
- pgAdmin4 UI'ına erişmek için;
http://localhost:16543/
adresi kullanılabilir.Username
: [email protected]Password
: 1q2w3E*
- RabbitMQ UI'ına erişmek için;
http://localhost:15672/
adresi kullanılabilir.Username
: guestPassword
: guest
Exchange olarak KariyerNetRecruitmentAppExchange
kullanıyoruz. Bu exchange'e bağlı olan routing keyler aşağıdadır. Oluşturduğumuz event için JobAdvert.CreatedOrUpdated
routing key kullanılıyor. Diğerleri abp framework'ün kendi içerisinde kullandığı routing keylerdir.
This is a layered startup solution based on Domain Driven Design (DDD) practises. All the fundamental ABP modules are already installed.
The solution comes with a default configuration that works out of the box. However, you may consider to change the following configuration before running your solution:
- Check the
ConnectionStrings
inappsettings.json
files under theKariyerNet.Recruitment.AuthServer
,KariyerNet.Recruitment.HttpApi.Host
andKariyerNet.Recruitment.DbMigrator
projects and change it if you need.
In the production environment, you need to use a production signing certificate. ABP Framework sets up signing and encryption certificates in your application and expects an openiddict.pfx
file in your application.
This certificate is already generated by ABP CLI, so most of the time you don't need to generate it yourself. However, if you need to generate a certificate, you can use the following command:
dotnet dev-certs https -v -ep openiddict.pfx -p 7cd40a94-ec32-4415-b985-2bc2c4dc9538
7cd40a94-ec32-4415-b985-2bc2c4dc9538
is the password of the certificate, you can change it to any password you want.
It is recommended to use two RSA certificates, distinct from the certificate(s) used for HTTPS: one for encryption, one for signing.
For more information, please refer to: https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html#registering-a-certificate-recommended-for-production-ready-scenarios
Also, see the Configuring OpenIddict documentation for more information.
Run the following command in the directory of your final application:
abp install-libs
This command installs all NPM packages for MVC/Razor Pages and Blazor Server UIs and this command is already run by the ABP CLI, so most of the time you don't need to run this command manually.
Run KariyerNet.Recruitment.DbMigrator
to create the initial database. This should be done in the first run. It is also needed if a new database migration is added to the solution later.
This is a layered monolith application that consists of the following applications:
KariyerNet.Recruitment.DbMigrator
: A console application which applies the migrations and also seeds the initial data. It is useful on development as well as on production environment.KariyerNet.Recruitment.AuthServer
: ASP.NET Core MVC / Razor Pages application that is integrated OAuth 2.0(OpenIddict
) and account modules. It is used to authenticate users and issue tokens.KariyerNet.Recruitment.HttpApi.Host
: ASP.NET Core API application that is used to expose the APIs to the clients.KariyerNet.Recruitment.Blazor
: ASP.NET Core Blazor WASM application that is a single page application that runs on the browser.
Deploying an ABP application is not different than deploying any .NET or ASP.NET Core application. However, there are some topics that you should care about when you are deploying your applications. You can check ABP's Deployment documentation before deploying your application.
You can see the following resources to learn more about your solution and the ABP Framework: