Skip to content

mohammed-salah-zidane/TheCountries

Repository files navigation

The Countries 🌎

iOS Xcode Swift SwiftUI License

📝 Table of Contents

📱 Preview

Demo GIF

🔍 About

The Countries is a sophisticated iOS application demonstrating advanced software architecture, concurrent programming, and modern iOS development practices. Built with Clean Architecture principles, the app showcases enterprise-level architecture decisions, robust error handling, and efficient resource management.

🌟 Features

  • 🔍 Display and manage countries list (max 5)
  • 🔎 Advanced country search functionality
  • 📍 Location-based country detection
  • 💾 Offline support with sophisticated caching
  • ⚡ Swipe-to-delete functionality
  • 🎨 Clean and responsive UI

🏗 Architecture

Implements Clean Architecture with three distinct modules:

Core Module (Domain Layer)

  • Domain Models with thread-safety
  • Use Cases with caching strategies
  • Location Services with actor isolation
  • Repository Interfaces with error handling

Data Module (Infrastructure Layer)

  • Custom URLSession networking stack
  • Thread-safe local storage using actors
  • Repository implementation with caching
  • Comprehensive error handling

Presentation Module (UI Layer)

  • MVVM architecture with SwiftUI
  • Reactive UI with Combine
  • Thread-safe operations
  • Type-safe navigation

🔧 Technical Details

Concurrency & Thread Safety

  • Actor-based isolation
  • async/await implementation
  • MainActor annotations
  • Race condition prevention

Memory Management

  • Resource cleanup protocols
  • Cache eviction policies
  • Memory leak prevention
  • Reference cycle handling

Error Handling

  • Comprehensive error types
  • Recovery mechanisms
  • Logging infrastructure
  • User-friendly presentation

📁 Project Structure

TheCountries/
├── Core/                # Domain Layer
├── Data/                # Data Layer
├── Presentation/        # UI Layer
└── TheCountries/        # Main App

📋 Requirements

  • iOS 16.0+
  • Xcode 15.0+
  • Swift 6.0

🔨 Installation

  1. Clone the repository
git clone https://github.com/yourusername/TheCountries.git
  1. Open the project in Xcode
cd TheCountries
open TheCountries.xcodeproj
  1. Build and run the project

🎯 Usage

  1. Launch the app
  2. Browse available countries
  3. Search for specific countries
  4. View country details
  5. Enable location services for local detection

✅ Testing

Comprehensive test coverage including:

  • Unit Tests

Run tests using:

xcodebuild test -scheme TheCountries -destination 'platform=iOS Simulator,name=iPhone 15'

📐 Design Patterns

  • Clean Architecture
  • MVVM
  • Repository Pattern
  • Coordinator Pattern
  • Factory Pattern
  • Observer Pattern

🤝 Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details

✍ Authors

🎉 Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages