Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

on:
pull_request:
branches: [ main, develop ]

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
build_ios_app:
name: Build iOS App
runs-on: macos-latest
env:
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode.app

- name: Clean Build Folder
run: |
xcodebuild clean \
-workspace TorqueNet.xcodeproj/project.xcworkspace \
-scheme TorqueNet \
-configuration Debug

- name: Build iOS App (Debug)
run: |
xcodebuild \
-workspace TorqueNet.xcodeproj/project.xcworkspace \
-scheme TorqueNet \
-sdk iphonesimulator \
-configuration Debug \
-destination "platform=iOS Simulator,name=iPhone 15" \
build \
| xcpretty
17 changes: 17 additions & 0 deletions TorqueNet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
0477CF9C2E40BCFC00A9DB5F /* Exo2-ExtraLight.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0477CF8A2E40BCFC00A9DB5F /* Exo2-ExtraLight.ttf */; };
0477D0832E40EBCB00A9DB5F /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0477D0822E40EBCB00A9DB5F /* GoogleService-Info.plist */; };
0477D0912E40EDB400A9DB5F /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 0477D0902E40EDB400A9DB5F /* Lottie */; };
04C07A602ED5AF6400969093 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 04C07A5F2ED5AF6400969093 /* Kingfisher */; };
04C7F2C42EABBABF007C148C /* FirebaseAI in Frameworks */ = {isa = PBXBuildFile; productRef = 04C7F2C32EABBABF007C148C /* FirebaseAI */; };
04C7F2C62EABBABF007C148C /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 04C7F2C52EABBABF007C148C /* FirebaseAnalytics */; };
04C7F2C82EABBABF007C148C /* FirebaseAnalyticsCore in Frameworks */ = {isa = PBXBuildFile; productRef = 04C7F2C72EABBABF007C148C /* FirebaseAnalyticsCore */; };
Expand Down Expand Up @@ -125,6 +126,7 @@
04C7F2EC2EABBABF007C148C /* FirebaseStorage in Frameworks */,
04C7F2C82EABBABF007C148C /* FirebaseAnalyticsCore in Frameworks */,
04C7F2C42EABBABF007C148C /* FirebaseAI in Frameworks */,
04C07A602ED5AF6400969093 /* Kingfisher in Frameworks */,
04C7F2CA2EABBABF007C148C /* FirebaseAnalyticsIdentitySupport in Frameworks */,
04C7F2D22EABBABF007C148C /* FirebaseAuthCombine-Community in Frameworks */,
323D74D82E958A8200EC7543 /* GoogleSignInSwift in Frameworks */,
Expand Down Expand Up @@ -239,6 +241,7 @@
04C7F2E92EABBABF007C148C /* FirebaseRemoteConfig */,
04C7F2EB2EABBABF007C148C /* FirebaseStorage */,
04C7F2ED2EABBABF007C148C /* FirebaseStorageCombine-Community */,
04C07A5F2ED5AF6400969093 /* Kingfisher */,
);
productName = TorqueNet;
productReference = 04356D5F2E40B85B00D1C0A6 /* TorqueNet.app */;
Expand Down Expand Up @@ -326,6 +329,7 @@
0477D08F2E40EDB400A9DB5F /* XCRemoteSwiftPackageReference "lottie-spm" */,
323D74D42E958A8200EC7543 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */,
04C7F2C22EABBABF007C148C /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
04C07A5E2ED5AF6400969093 /* XCRemoteSwiftPackageReference "Kingfisher" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 04356D602E40B85B00D1C0A6 /* Products */;
Expand Down Expand Up @@ -720,6 +724,14 @@
minimumVersion = 4.5.2;
};
};
04C07A5E2ED5AF6400969093 /* XCRemoteSwiftPackageReference "Kingfisher" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/onevcat/Kingfisher";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 8.6.2;
};
};
04C7F2C22EABBABF007C148C /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
Expand All @@ -744,6 +756,11 @@
package = 0477D08F2E40EDB400A9DB5F /* XCRemoteSwiftPackageReference "lottie-spm" */;
productName = Lottie;
};
04C07A5F2ED5AF6400969093 /* Kingfisher */ = {
isa = XCSwiftPackageProductDependency;
package = 04C07A5E2ED5AF6400969093 /* XCRemoteSwiftPackageReference "Kingfisher" */;
productName = Kingfisher;
};
04C7F2C32EABBABF007C148C /* FirebaseAI */ = {
isa = XCSwiftPackageProductDependency;
package = 04C7F2C22EABBABF007C148C /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
21 changes: 21 additions & 0 deletions TorqueNet/Assets.xcassets/audi.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "audi.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file added TorqueNet/Assets.xcassets/audi.imageset/audi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions TorqueNet/Assets.xcassets/bmw.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "bmw.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file added TorqueNet/Assets.xcassets/bmw.imageset/bmw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions TorqueNet/Assets.xcassets/porsche.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "porsche.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions TorqueNet/Assets.xcassets/tesla.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "tesla.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions TorqueNet/Assets.xcassets/toyota.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "toyota.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions TorqueNet/Core/Component/Browser/SafariView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// SafariView.swift
// TorqueNet
//
// Created by MAC on 25/11/2025.
//

import Foundation
import SwiftUI
import SafariServices

struct SafariView: UIViewControllerRepresentable {
let url: URL

func makeUIViewController(context: Context) -> SFSafariViewController {
return SFSafariViewController(url: url)
}

func updateUIViewController(_ uiViewController: SFSafariViewController, context: Context) {
// Update the view controller if needed
}
}
53 changes: 33 additions & 20 deletions TorqueNet/Core/Component/ImageView/CustomImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,49 @@


import SwiftUI
import Kingfisher

struct CustomImageView: View {
let url: String
var maxWidth: CGFloat = .infinity
var height: CGFloat = 256

var body: some View {
AsyncImage(url: URL(string: url)) { phase in
switch phase {
case .failure:
Image(systemName: "photo")
//.font(.largeTitle)
.resizable()
.scaledToFill()
.foregroundColor(Color.theme.surfaceColor)
KFImage(URL(string: url))
.placeholder {
ProgressView()
}
.onFailure { _ in
print("Image failed to load: \(url)")
}
.resizable()
.scaledToFill()
.frame(maxWidth: maxWidth)
.frame(height: height)
.background(Color.theme.surfaceColor)
.clipShape(RoundedRectangle(cornerRadius: 25))
.overlay(
KFOverlay(url: url)
)
}
}

case .success(let image):
image
.resizable()
.scaledToFill()
default:
ProgressView()
}
}
.frame(maxWidth: maxWidth)
.frame( height: height)
//.clipShape(.rect(cornerRadius: 25))
}
struct KFOverlay: View {
let url: String
var body: some View {
KFImage(URL(string: url))
.resizable()
.scaledToFit()
.opacity(0)
.overlay(
Image(systemName: "profile")
.foregroundColor(.gray)
.opacity(0.7)
)
}
}


#Preview {
CustomImageView(url: "https://hws.dev/paul3.jpg")
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="24299" systemVersion="25B78" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithSwiftData="YES" userDefinedModelVersionIdentifier="">
<entity name="UserEntity" representedClassName="UserEntity" syncable="YES" codeGenerationType="class">
<attribute name="cars" optional="YES" attributeType="String"/>
<attribute name="createdAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="email" optional="YES" attributeType="String"/>
<attribute name="isSeller" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="name" optional="YES" attributeType="String"/>
<attribute name="phoneNumber" optional="YES" attributeType="String"/>
<attribute name="profileImageUrl" optional="YES" attributeType="String"/>
<attribute name="rides" optional="YES" attributeType="String"/>
<attribute name="uid" optional="YES" attributeType="String"/>
</entity>
</model>
15 changes: 8 additions & 7 deletions TorqueNet/Features/Home/Presentation/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ struct HomeView: View {

var brands: [Brand] = [
Brand(image: "benz", title: "Mercedes-Benz"),
Brand(image: "benz", title: "Tesla"),
Brand(image: "benz", title: "Audi"),
Brand(image: "benz", title: "BMW"),
Brand(image: "benz", title: "Porsche"),
Brand(image: "benz", title: "Toyota")
Brand(image: "tesla", title: "Tesla"),
Brand(image: "audi", title: "Audi"),
Brand(image: "bmw", title: "BMW"),
Brand(image: "porsche", title: "Porsche"),
Brand(image: "toyota", title: "Toyota")
]

var featuredCars: [FeaturedCar] = [
Expand Down Expand Up @@ -484,7 +484,7 @@ struct EnhancedBrandView: View {
VStack(spacing: 8) {
ZStack {
RoundedRectangle(cornerRadius: 16)
.fill(isSelected ? Color.theme.primaryColor.opacity(0.1) : Color.theme.surfaceColor)
.fill(Color.theme.surfaceColor)
.frame(width: 80, height: 80)
.shadow(color: Color.theme.onSurfaceColor.opacity(0.08), radius: 12, x: 0, y: 4)
.overlay(
Expand All @@ -494,8 +494,9 @@ struct EnhancedBrandView: View {

Image(brand.image)
.resizable()
.scaledToFit()
.scaledToFill()
.frame(width: 40, height: 40)
//.clipShape(RoundedRectangle(cornerRadius: 16))
}

Text(brand.title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ extension UserEntity {
email: self.email ?? "",
phoneNumber: self.phoneNumber ?? "",
profileImageUrl: self.profileImageUrl,
isSeller: self.isSeller
isSeller: self.isSeller,
cars: Int(self.cars ?? "0"),
rides: Int(self.rides ?? "0")
)
}

Expand All @@ -23,5 +25,7 @@ extension UserEntity {
self.phoneNumber = user.phoneNumber
self.profileImageUrl = user.profileImageUrl
self.isSeller = user.isSeller ?? false
self.cars = user.cars?.description ?? "0"
self.rides = user.rides?.description ?? "0"
}
}
Loading