A modern multi-platform e-commerce application built with SwiftUI for iOS and macOS. ISIS lets customers browse products, manage a shopping cart, track orders, and manage their profile — while giving admins full control over products, categories, users, and orders.
| Platform | Minimum Version | Navigation |
|---|---|---|
| iOS | 17.0 | TabView (5 tabs) |
| macOS | 14.0 | NavigationSplitView + sidebar |
Both targets share models, networking, ViewModels, and reusable UI components from the Shared/ directory.
- Product catalog — grid/list browse with real-time search (400 ms debounce) and category filtering
- Shopping cart — add, update quantity, remove items, stock validation, and checkout
- Order history — paginated list, detail view, status tracking, cancel pending orders
- Profile — update name/password, delete account
- Authentication — login, register, forgot/reset password, JWT with automatic token refresh
- User management — list all users, update roles
- Product management — create, edit, delete products with images and categories
- Category management — create, update, delete categories
- Order management — view all orders, update order status
Views (SwiftUI)
└── @Observable ViewModels
└── APIClient (Swift Actor)
└── REST API (http://<host>:8080)
- MVVM with Swift's
@Observablemacro (no Combine required) - Async/await throughout — no completion handlers
- Actor-based
APIClientfor thread-safe HTTP operations - Environment injection of ViewModels into the view hierarchy
- Shared code across iOS and macOS (44 Swift files total)
OsirisApp/
├── iOS/
│ ├── OsirisApp.swift # App entry point
│ ├── Info.plist
│ └── Views/
│ ├── RootView.swift # TabView navigation
│ ├── Auth/
│ ├── Products/
│ ├── Cart/
│ ├── Orders/
│ ├── Profile/
│ └── Admin/
├── macOS/
│ ├── OsirisApp.swift
│ ├── Info.plist
│ └── Views/
│ ├── RootView.swift # NavigationSplitView sidebar
│ ├── Auth/
│ ├── Products/
│ ├── Cart/
│ ├── Orders/
│ ├── Profile/
│ └── Admin/
├── Shared/
│ ├── Models/
│ │ └── Models.swift # Data models & API types
│ ├── Networking/
│ │ ├── APIClient.swift # HTTP client, token refresh
│ │ └── KeychainService.swift
│ ├── ViewModels/
│ │ ├── AuthViewModel.swift
│ │ ├── ProductsViewModel.swift
│ │ ├── CartViewModel.swift
│ │ ├── OrdersViewModel.swift
│ │ ├── AdminViewModel.swift
│ │ └── ProfileViewModel.swift
│ ├── Views/
│ │ ├── ProductImageView.swift
│ │ ├── ProductFormView.swift
│ │ ├── CategoryFormView.swift
│ │ └── StatusBadge.swift
│ └── Utilities/
│ └── Utilities.swift
├── project.yml # xcodegen configuration
└── OsirisApp.xcodeproj/
APIClient is a Swift actor singleton (APIClient.shared) that handles all HTTP communication.
Base URL: http://192.168.0.13:8080 (local development — update APIConfig.baseURL for other environments)
Authentication: Bearer JWT tokens stored securely in the Keychain. On a 401 response the client automatically refreshes the access token and retries the original request once.
| Resource | Method | Path |
|---|---|---|
| Auth | POST | /auth/login, /auth/register, /auth/logout, /auth/logout-all, /auth/forgot-password, /auth/reset-password, /auth/refresh |
| Users | GET/PUT/DELETE | /users/me |
| Products | GET/POST/PUT/DELETE | /products, /products/{id} |
| Cart | GET/POST/PUT/DELETE | /cart, /cart/items, /cart/items/{id} |
| Orders | GET/POST/DELETE | /orders, /orders/{id}, /orders/checkout, /orders/{id}/cancel |
| Categories | GET/POST/PUT/DELETE | /categories, /categories/{id} |
| Admin | GET/PUT | /admin/users, /admin/users/{id}/role, /admin/orders, /admin/orders/{id}/status |
All prices are stored and transmitted in cents (integer) and formatted to USD by the formatPrice utility.
AuthResponse // accessToken, refreshToken
UserResponse // id, name, email, role, emailVerified
ProductResponse // id, name, description, price (cents), stock, imageUrl, category
CategoryResponse // id, name, description
CartResponse // id, items, total (cents)
OrderResponse // id, status, totalAmount, createdAt, items
Page<T> // content, totalElements, totalPagesOrder status values: PENDING · PROCESSING · SHIPPED · DELIVERED · CANCELLED
- Xcode 15+
- xcodegen (
brew install xcodegen) - A running backend at the configured base URL
# Clone the repo
git clone <repo-url>
cd OsirisApp
# Generate the Xcode project
xcodegen generate
# Open in Xcode
open OsirisApp.xcodeprojSelect the OsirisApp-iOS or OsirisApp-macOS scheme and run.
Note: The backend URL is hard-coded in
Shared/Networking/APIClient.swift(APIConfig.baseURL). Change it to point at your server before building.
None. The app relies exclusively on Apple frameworks:
- SwiftUI — UI
- Foundation / URLSession — Networking
- Security — Keychain storage
MIT