-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
228 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!-- File: ios/SmartJournal/Resources/Info.plist --> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSRequiresIPhoneOS</key> | ||
<true/> | ||
<key>UIApplicationSceneManifest</key> | ||
<dict> | ||
<key>UIApplicationSupportsMultipleScenes</key> | ||
<false/> | ||
<key>UISceneConfigurations</key> | ||
<dict> | ||
<key>UIWindowSceneSessionRoleApplication</key> | ||
<array> | ||
<dict> | ||
<key>UISceneConfigurationName</key> | ||
<string>Default Configuration</string> | ||
<key>UISceneDelegateClassName</key> | ||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</dict> | ||
<key>UIApplicationSupportsIndirectInputEvents</key> | ||
<true/> | ||
<key>UILaunchStoryboardName</key> | ||
<string>LaunchScreen</string> | ||
<key>UIRequiredDeviceCapabilities</key> | ||
<array> | ||
<string>armv7</string> | ||
</array> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
<key>UISupportedInterfaceOrientations~ipad</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ struct JournalEntry: Identifiable, Codable { | |
let content: String | ||
var sentiment: String? | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// File: ios/SmartJournal/Sources/Services/LLMService.swift | ||
import Foundation | ||
import Combine | ||
|
||
class LLMService { | ||
private let baseURL = "https://your-backend-url.com/api" | ||
|
||
func analyzeEntry(_ entry: JournalEntry) -> AnyPublisher<String, Error> { | ||
let url = URL(string: "\(baseURL)/analyze")! | ||
var request = URLRequest(url: url) | ||
request.httpMethod = "POST" | ||
request.setValue("application/json", forHTTPHeaderField: "Content-Type") | ||
|
||
let body = ["content": entry.content] | ||
request.httpBody = try? JSONEncoder().encode(body) | ||
|
||
return URLSession.shared.dataTaskPublisher(for: request) | ||
.map { $0.data } | ||
.decode(type: AnalysisResponse.self, decoder: JSONDecoder()) | ||
.map { $0.advice } | ||
.eraseToAnyPublisher() | ||
} | ||
} | ||
|
||
struct AnalysisResponse: Codable { | ||
let sentiment: String | ||
let advice: String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// File: ios/SmartJournal/Sources/Views/EntryRowView.swift | ||
import SwiftUI | ||
|
||
struct EntryRowView: View { | ||
let entry: JournalEntry | ||
|
||
var body: some View { | ||
VStack(alignment: .leading, spacing: 8) { | ||
Text(entry.date, style: .date) | ||
.font(.subheadline) | ||
.foregroundColor(.secondary) | ||
Text(entry.content) | ||
.font(.body) | ||
.lineLimit(2) | ||
if let sentiment = entry.sentiment { | ||
Text("Sentiment: \(sentiment)") | ||
.font(.caption) | ||
.foregroundColor(.secondary) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// File: ios/SmartJournal/Sources/Views/EntryDetailView.swift | ||
import SwiftUI | ||
|
||
struct EntryDetailView: View { | ||
let entry: JournalEntry | ||
@ObservedObject var viewModel: JournalViewModel | ||
|
||
var body: some View { | ||
ScrollView { | ||
VStack(alignment: .leading, spacing: 16) { | ||
Text(entry.date, style: .date) | ||
.font(.subheadline) | ||
.foregroundColor(.secondary) | ||
|
||
Text(entry.content) | ||
.font(.body) | ||
|
||
if let sentiment = entry.sentiment { | ||
Text("Sentiment: \(sentiment)") | ||
.font(.subheadline) | ||
.foregroundColor(.secondary) | ||
} | ||
|
||
if let advice = viewModel.getAdvice(for: entry) { | ||
Text("Advice:") | ||
.font(.headline) | ||
Text(advice) | ||
.font(.body) | ||
} | ||
} | ||
.padding() | ||
} | ||
.navigationTitle("Journal Entry") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// File: ios/SmartJournal/Sources/Views/NewEntryView.swift | ||
import SwiftUI | ||
|
||
struct NewEntryView: View { | ||
@ObservedObject var viewModel: JournalViewModel | ||
@State private var content: String = "" | ||
@Environment(\.presentationMode) var presentationMode | ||
|
||
var body: some View { | ||
NavigationView { | ||
Form { | ||
Section(header: Text("New Entry")) { | ||
TextEditor(text: $content) | ||
.frame(height: 200) | ||
} | ||
} | ||
.navigationTitle("New Entry") | ||
.toolbar { | ||
ToolbarItem(placement: .cancellationAction) { | ||
Button("Cancel") { | ||
presentationMode.wrappedValue.dismiss() | ||
} | ||
} | ||
ToolbarItem(placement: .confirmationAction) { | ||
Button("Save") { | ||
let newEntry = JournalEntry(id: UUID().uuidString, date: Date(), content: content) | ||
viewModel.addEntry(newEntry) | ||
presentationMode.wrappedValue.dismiss() | ||
} | ||
.disabled(content.isEmpty) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# File: ios/fastlane/Appfile | ||
app_identifier("com.yourcompany.SmartJournal") # The bundle identifier of your app | ||
apple_id("your@apple.id") # Your Apple ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#File: ios/fastlane/Fastfile | ||
default_platform(:ios) | ||
|
||
platform :ios do | ||
desc "Run tests" | ||
lane :test do | ||
run_tests(scheme: "SmartJournal") | ||
end | ||
|
||
desc "Build and upload to TestFlight" | ||
lane :beta do | ||
increment_build_number | ||
build_app(scheme: "SmartJournal") | ||
upload_to_testflight | ||
end | ||
|
||
desc "Build and upload to App Store" | ||
lane :release do | ||
increment_build_number | ||
build_app(scheme: "SmartJournal") | ||
upload_to_app_store | ||
end | ||
end |