AppointmentGuard is a secure and scalable appointment management system developed using enterprise-standard N-Layer Architecture.
Vision: This project is not just a working application; it's a backend engineering study that implements Concurrency, Unit Testing, Containerization, and Clean Architecture principles.
User-friendly interface with dynamic time management and instant notifications.
| Feature | Preview |
|---|---|
| System Login | |
| Registration | |
| Create Appointment | |
| Cancel Appointment | |
| Race Condition |
The project is divided into layers according to the Separation of Concerns (SoC) principle.
- 🧱 Core Layer: Entities, DTOs, and Interfaces. No external dependencies.
- 💾 Data Layer: Database operations, Migrations, and Repository Pattern implementation.
- ⚙️ Service Layer: Business Logic, Validations (FluentValidation), and Mapping (AutoMapper).
- 🌐 API Layer: RESTful services.
- 💻 Web Layer (MVC): User interface.
System security is configured according to industry standards.
- Authentication: Secure session management with ASP.NET Core Cookie Authentication mechanism.
- Password Hashing: User passwords are not stored as plain-text in the database; they are hashed and protected using the BCrypt algorithm.
- Authorization: Role-Based authorization infrastructure is available.
When two users try to book an appointment with the same doctor simultaneously (within milliseconds), the system maintains data integrity.
- Solution: In addition to the validation layer, data consistency is guaranteed through Double-Check Locking and Try-Catch mechanism at the database commit time (
CommitAsync).
- Async/Await: All I/O operations (Database access) are made asynchronous to prevent thread blocking, providing high concurrent request capacity.
- Optimized LINQ: Database queries are optimized over
IQueryableto ensure only necessary data is fetched from the server.
Critical business logic of the project has been tested using xUnit and Moq.
- ✅ Collision scenario verified with
RaceCondition_ShouldThrowUserFriendlyExceptiontest.
You can choose one of two methods to run the project.
You can launch the project with a single command without dealing with SQL Server installation.
- Clone the project and navigate to the main directory.
- Run this command in the terminal:
docker-compose up --build
- The application will start at http://localhost:5000.
- Clone the project.
- Edit the Connection String in the
appsettings.jsonfile according to your SQL Server information. - Create the database via Package Manager Console:
Update-Database -Project AppointmentGuard.Data -StartupProject AppointmentGuard.API
- Start the project. Seed Data will be loaded automatically.
The following users are pre-defined for quick testing:
| User | Password | |
|---|---|---|
| User 1 (Merve) | [email protected] |
123456 |
| User 2 (Cemal) | [email protected] |
123456 |
If you'd like to contribute to the project:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: Add amazing feature') - Push your branch (
git push origin feature/amazing-feature) - Create a Pull Request
⭐ Don't forget to star the project if you like it!
AppointmentGuard, kurumsal standartlara uygun N-Katmanlı Mimari (N-Layer Architecture) kullanılarak geliştirilmiş, güvenli ve ölçeklenebilir bir randevu yönetim sistemidir.
Vizyon: Bu proje, sadece çalışan bir uygulama değil; Concurrency (Eşzamanlılık), Unit Testing, Containerization ve Clean Architecture prensiplerini uygulayan bir Backend mühendislik çalışmasıdır.
Kullanıcı dostu arayüz ile dinamik saat yönetimi ve anlık bildirimler.
| Özellik | Önizleme |
|---|---|
| Sisteme Giriş | |
| Kayıt Olma | |
| Randevu Alma | |
| Randevu İptali | |
| Race Condition |
Proje, Sorumlulukların Ayrılığı (SoC) prensibine uygun olarak katmanlara ayrılmıştır.
- 🧱 Core Layer: Entity'ler, DTO'lar ve Arayüzler (Interfaces). Dışa bağımlılığı yoktur.
- 💾 Data Layer: Veritabanı işlemleri, Migrations ve Repository Pattern implementasyonu.
- ⚙️ Service Layer: İş mantığı (Business Logic), Validasyonlar (FluentValidation) ve Mapping (AutoMapper).
- 🌐 API Layer: RESTful servisler.
- 💻 Web Layer (MVC): Kullanıcı arayüzü.
Sistem güvenliği endüstri standartlarına uygun olarak yapılandırılmıştır.
- Authentication: ASP.NET Core Cookie Authentication mekanizması ile güvenli oturum yönetimi.
- Password Hashing: Kullanıcı şifreleri veritabanında düz metin (plain-text) olarak saklanmaz; BCrypt algoritması ile hash'lenerek korunur.
- Authorization: Role-Based (Rol Bazlı) yetkilendirme altyapısı mevcuttur.
Aynı anda (milisaniyeler içinde) aynı doktora randevu almaya çalışan iki kullanıcı olduğunda, sistem veri bütünlüğünü korur.
- Çözüm: Validasyon katmanına ek olarak, veritabanı kayıt anında (
CommitAsync) Double-Check Locking ve Try-Catch mekanizması ile veri tutarlılığı garanti edilir.
- Async/Await: Tüm I/O operasyonları (Veritabanı erişimi) asenkron yapılarak thread bloklanması önlenmiş, yüksek eşzamanlı istek kapasitesi sağlanmıştır.
- Optimized LINQ: Veritabanı sorguları
IQueryableüzerinden optimize edilerek sunucuya sadece gerekli verilerin çekilmesi sağlanmıştır.
Projenin kritik iş mantıkları xUnit ve Moq kullanılarak test edilmiştir.
- ✅
RaceCondition_ShouldThrowUserFriendlyExceptiontesti ile çakışma senaryosu doğrulanmıştır.
Projeyi çalıştırmak için iki yöntemden birini seçebilirsiniz.
SQL Server kurulumuyla uğraşmadan tek komutla projeyi ayağa kaldırabilirsiniz.
- Projeyi klonlayın ve ana dizine gidin.
- Terminalde şu komutu çalıştırın:
docker-compose up --build
- Uygulama http://localhost:5000 adresinde yayına başlayacaktır.
- Projeyi klonlayın.
appsettings.jsondosyasındaki Connection String'i kendi SQL Server bilginize göre düzenleyin.- Package Manager Console üzerinden veritabanını oluşturun:
Update-Database -Project AppointmentGuard.Data -StartupProject AppointmentGuard.API
- Projeyi başlatın. Seed Data otomatik yüklenecektir.
Hızlı test için aşağıdaki kullanıcılar tanımlı gelmektedir:
| Kullanıcı | Şifre | |
|---|---|---|
| User 1 (Merve) | [email protected] |
123456 |
| User 2 (Cemal) | [email protected] |
123456 |
Projeye katkıda bulunmak isterseniz:
- Repository'yi fork edin
- Yeni bir branch oluşturun (
git checkout -b feature/amazing-feature) - Değişikliklerinizi commit edin (
git commit -m 'feat: Add amazing feature') - Branch'inizi push edin (
git push origin feature/amazing-feature) - Pull Request oluşturun
⭐ Projeyi beğendiyseniz yıldız vermeyi unutmayın!