Skip to content

akkoshak/AIChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

132 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 AI Chat App

An AI-driven SwiftUI chat application where users create AI-generated avatars with unique personalities and profile images, then interact with them through personalized conversations. The project focuses on advanced SwiftUI architecture, clean code practices, and scalable iOS app design.

📸 Visual Overview

Coming soon...

 

✨ Features

🧑‍🎨 AI Avatars & Chat Experience

  • AI Avatar Creation

    Users can create AI-generated avatars, each with a unique personality and behaviour profile.

  • AI-Generated Profile Images

    Avatar profile images are generated using AI, giving each avatar a distinct visual identity.

  • Personalised AI Conversations

    Users can chat with multiple avatars, with each avatar maintaining its own conversation context and personality-driven responses.

  • Cloud-Based AI Processing

    AI text generation and image generation are handled via Cloud Functions, keeping sensitive logic secure and scalable.

 

📱 App Experience & UI

  • Onboarding Flow: A guided onboarding experience introducing users to the app and its core functionality.

  • Explore Screen: Discover and browse available AI avatars.

  • Chats Screen: View and manage conversations with multiple AI avatars.

  • Profile Screen: Manage user-related settings and preferences.

  • iPad Support, Dark Mode & Accessibility: Optimised layouts for iPad, full Dark Mode support, and accessibility-friendly.

  • Deep Linking: Supports deep links to specific areas of the app.

  • Local Push Notifications: Keeps users engaged with local notification reminders.

  • App Store Rating Prompt: Smart prompts encouraging users to rate the app at appropriate moments.

 

🔐 Authentication & User Management

Firebase Authentication - Supports Anonymous Sign-In and Sign in with Apple.

 

💰 Monetisation

 

📊 Analytics, Experimentation & Reliability

  • Analytics Integration

    • Firebase Analytics
    • Mixpanel Analytics
  • A/B Testing

    • Firebase Remote Config
    • Development scheme with custom A/B testing configurations
    • Experiment result tracking using Mixpanel charts
  • Crash Reporting

    • Firebase Crashlytics
  • Structured Logging

    • Console logging using OSLog

 

🧪 Testing & Quality

  • Unit Testing

    • Unit tests for data models and data managers.
  • UI Testing

    • UI tests covering onboarding flow and tab bar navigation.
  • Code Quality Enforcement

    • SwiftLint integration for consistent code style and best practices.

 

🏗️ Architecture & Engineering

  • Multiple Build Schemes & Configurations

    • Separate configurations for Mock, Development, and Production environments.
  • Dependency-Agnostic Design

    • Core logic is decoupled from third-party services for flexibility and testability.
  • Dependency Injection & Protocol-Oriented Programming

    • Ensures modular, testable, and maintainable code.
  • Architectural Patterns

    • MVC & MVVM
    • Refactoring to MVVM
    • Enterprise architectures including VIPER
    • Exploration of RIBs and modularisation
  • Decoupled Views & Routing

    • Clean separation between UI, navigation, and business logic.

 

🏗️ Architecture Overview

This project follows a layered, modular architecture inspired by enterprise iOS patterns such as MVVM, VIPER, and RIBs, with a strong emphasis on separation of concerns, decoupling, and scalability.

At a high level:

  • Views are responsible only for rendering UI and user interactions.
  • Presenters handle presentation logic and transform data for the UI.
  • Interactors contain business logic and coordinate data flow.
  • Managers & Services encapsulate domain-specific operations, external APIs, and data sources.
  • Routers manage navigation and routing in a fully decoupled manner through a central routing layer.
  • Core builders and core layers handle dependency creation and injection, keeping features dependency-agnostic.

Shared UI components and core modules are reused across features to reduce duplication and improve maintainability. Dependencies flow in a single direction, ensuring predictable behaviour, testability, and long-term extensibility.

This architecture allows individual features to evolve independently while maintaining a clean and consistent overall structure.

 

🧭 Architecture Progression

This diagram illustrates the progression from minimal architecture to more structured, enterprise-level architectures in SwiftUI applications.

On the left, simpler approaches such as Views-only, MV, and MVC require less upfront structure but can become difficult to maintain as an application grows. Moving toward the centre, MVVM introduces clearer separation between UI and logic, while adding dependency injection and protocols improves testability, modularity, and flexibility.

On the right, more advanced architectures like VIPER and RIBs provide strong boundaries between components, explicit routing, and highly decoupled modules. These approaches are better suited for large-scale, long-lived applications where scalability and team collaboration are critical.

This project explores and applies patterns across this spectrum, selecting the appropriate level of architecture based on feature complexity rather than defaulting to a one-size-fits-all solution.

 

🛠️ Tech Stack

Swift • SwiftUI • OpenAI API • Firebase (Auth, Functions, Analytics, Remote Config, Crashlytics) • Mixpanel • StoreKit • RevenueCat • MVVM / VIPER / RIBs • Dependency Injection • SwiftLint • Xcode Cloud

 

🎓 Learning Outcomes & Motivation

Why I Enrolled?

I enrolled in the SwiftUI Advanced Architecture course to move beyond building feature-focused apps and gain a deeper understanding of scalable, production-ready iOS architecture. My goal was to learn how to structure SwiftUI applications that can grow in complexity while remaining maintainable, testable, and easy to evolve.

I was particularly interested in learning how real-world iOS apps handle architecture, dependency management, experimentation, analytics, monetisation, and CI/CD—areas that are often missing from smaller tutorial projects.


What I Learned?

Through this project, I gained hands-on experience with production-level iOS development, focusing on scalability, architecture, and real-world workflows:

  • Advanced SwiftUI Architecture – Applied MVVM, VIPER, and RIBs with clear separation of concerns and decoupled routing.
  • Scalable & Modular Design – Used dependency injection, protocol-oriented programming, and modularisation for maintainability.
  • AI Integration – Implemented AI-powered chat and image generation using the OpenAI API and Cloud Functions.
  • Experimentation & Analytics – Built A/B testing and feature flags with Firebase Remote Config and analysed results using Mixpanel.
  • Testing & Quality – Wrote unit tests for core logic and UI tests for critical user flows.
  • Monetisation – Integrated in-app purchases using StoreKit and RevenueCat with a custom paywall.
  • CI/CD & Release Readiness – Set up Xcode Cloud, multiple build schemes, and environment-based configurations.

 

🙏 Acknowledgements

This project was built as part of the SwiftUI Advanced Architecture course by Swiftful Thinking and is primarily intended for learning and educational purposes.

The repository reflects my personal implementation, experimentation, and incremental development while following the course material. Throughout the project, I focused on understanding the underlying architectural decisions and adapting them to reinforce best practices in real-world iOS development.

Parts of the architecture, patterns, and ideas explored in this project may be reused or adapted in future projects, as they represent foundational concepts applicable to production-ready SwiftUI applications.

Credit goes to Swiftful Thinking for the course structure and learning material that made this project possible.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages