Skip to content

alexissdev/isis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ISIS

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.


Platforms

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.


Features

Customer

  • 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

Admin

  • 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

Architecture

Views (SwiftUI)
  └── @Observable ViewModels
        └── APIClient (Swift Actor)
              └── REST API  (http://<host>:8080)
  • MVVM with Swift's @Observable macro (no Combine required)
  • Async/await throughout — no completion handlers
  • Actor-based APIClient for thread-safe HTTP operations
  • Environment injection of ViewModels into the view hierarchy
  • Shared code across iOS and macOS (44 Swift files total)

Project Structure

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/

Networking

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.

Endpoints summary

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.


Data Models

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, totalPages

Order status values: PENDING · PROCESSING · SHIPPED · DELIVERED · CANCELLED


Getting Started

Requirements

  • Xcode 15+
  • xcodegen (brew install xcodegen)
  • A running backend at the configured base URL

Setup

# Clone the repo
git clone <repo-url>
cd OsirisApp

# Generate the Xcode project
xcodegen generate

# Open in Xcode
open OsirisApp.xcodeproj

Select 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.


Dependencies

None. The app relies exclusively on Apple frameworks:

  • SwiftUI — UI
  • Foundation / URLSession — Networking
  • Security — Keychain storage

License

MIT

About

Isis is a desktop and mobile app from horus backend.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages