diff --git a/.gitignore b/.gitignore index 589bc5d..f290cfb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ server/.env server/node_modules +app/newHere1/newHere.xcodeproj/xcuserdata/* +app/newHere1/newHere.xcodeproj/xcshareddata/* +app/newHere1/newHere.xcodeproj/project.xcworkspace/xcuserdata diff --git a/app/here/.DS_Store b/app/.DS_Store similarity index 77% rename from app/here/.DS_Store rename to app/.DS_Store index 5f6fb57..3ffd0dc 100644 Binary files a/app/here/.DS_Store and b/app/.DS_Store differ diff --git a/app/here.xcodeproj/project.pbxproj b/app/here.xcodeproj/project.pbxproj deleted file mode 100644 index 2db50a7..0000000 --- a/app/here.xcodeproj/project.pbxproj +++ /dev/null @@ -1,613 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 55; - objects = { - -/* Begin PBXBuildFile section */ - 15E71F672ADB24FB0076B662 /* Messages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15E71F662ADB24FB0076B662 /* Messages.swift */; }; - 3BDFCFB72AD9E6D40088E497 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BDFCFB62AD9E6D40088E497 /* Profile.swift */; }; - 3BDFCFB92ADB0CCB0088E497 /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BDFCFB82ADB0CCB0088E497 /* Home.swift */; }; - 4BC8F3F42AC8868100A47671 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC8F3F32AC8868100A47671 /* AppDelegate.swift */; }; - 4BC8F3F62AC8868100A47671 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC8F3F52AC8868100A47671 /* SceneDelegate.swift */; }; - 4BC8F3F82AC8868100A47671 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC8F3F72AC8868100A47671 /* ViewController.swift */; }; - 4BC8F3FB2AC8868100A47671 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4BC8F3F92AC8868100A47671 /* Main.storyboard */; }; - 4BC8F3FD2AC8868200A47671 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4BC8F3FC2AC8868200A47671 /* Assets.xcassets */; }; - 4BC8F4002AC8868200A47671 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4BC8F3FE2AC8868200A47671 /* LaunchScreen.storyboard */; }; - 4BC8F40B2AC8868200A47671 /* hereTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC8F40A2AC8868200A47671 /* hereTests.swift */; }; - 4BC8F4152AC8868200A47671 /* hereUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC8F4142AC8868200A47671 /* hereUITests.swift */; }; - 4BC8F4172AC8868200A47671 /* hereUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC8F4162AC8868200A47671 /* hereUITestsLaunchTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 4BC8F4072AC8868200A47671 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BC8F3E82AC8868100A47671 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BC8F3EF2AC8868100A47671; - remoteInfo = here; - }; - 4BC8F4112AC8868200A47671 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BC8F3E82AC8868100A47671 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BC8F3EF2AC8868100A47671; - remoteInfo = here; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 15E71F662ADB24FB0076B662 /* Messages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Messages.swift; sourceTree = ""; }; - 3BDFCFB62AD9E6D40088E497 /* Profile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = ""; }; - 3BDFCFB82ADB0CCB0088E497 /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = ""; }; - 4BC8F3F02AC8868100A47671 /* here.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = here.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BC8F3F32AC8868100A47671 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 4BC8F3F52AC8868100A47671 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 4BC8F3F72AC8868100A47671 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 4BC8F3FA2AC8868100A47671 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 4BC8F3FC2AC8868200A47671 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 4BC8F3FF2AC8868200A47671 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 4BC8F4012AC8868200A47671 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 4BC8F4062AC8868200A47671 /* hereTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = hereTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BC8F40A2AC8868200A47671 /* hereTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = hereTests.swift; sourceTree = ""; }; - 4BC8F4102AC8868200A47671 /* hereUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = hereUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BC8F4142AC8868200A47671 /* hereUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = hereUITests.swift; sourceTree = ""; }; - 4BC8F4162AC8868200A47671 /* hereUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = hereUITestsLaunchTests.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 4BC8F3ED2AC8868100A47671 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BC8F4032AC8868200A47671 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BC8F40D2AC8868200A47671 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 4BC8F3E72AC8868100A47671 = { - isa = PBXGroup; - children = ( - 4BC8F3F22AC8868100A47671 /* here */, - 4BC8F4092AC8868200A47671 /* hereTests */, - 4BC8F4132AC8868200A47671 /* hereUITests */, - 4BC8F3F12AC8868100A47671 /* Products */, - ); - sourceTree = ""; - }; - 4BC8F3F12AC8868100A47671 /* Products */ = { - isa = PBXGroup; - children = ( - 4BC8F3F02AC8868100A47671 /* here.app */, - 4BC8F4062AC8868200A47671 /* hereTests.xctest */, - 4BC8F4102AC8868200A47671 /* hereUITests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 4BC8F3F22AC8868100A47671 /* here */ = { - isa = PBXGroup; - children = ( - 4BC8F3F32AC8868100A47671 /* AppDelegate.swift */, - 3BDFCFB62AD9E6D40088E497 /* Profile.swift */, - 3BDFCFB82ADB0CCB0088E497 /* Home.swift */, - 15E71F662ADB24FB0076B662 /* Messages.swift */, - 4BC8F3F52AC8868100A47671 /* SceneDelegate.swift */, - 4BC8F3F72AC8868100A47671 /* ViewController.swift */, - 4BC8F3F92AC8868100A47671 /* Main.storyboard */, - 4BC8F3FC2AC8868200A47671 /* Assets.xcassets */, - 4BC8F3FE2AC8868200A47671 /* LaunchScreen.storyboard */, - 4BC8F4012AC8868200A47671 /* Info.plist */, - ); - path = here; - sourceTree = ""; - }; - 4BC8F4092AC8868200A47671 /* hereTests */ = { - isa = PBXGroup; - children = ( - 4BC8F40A2AC8868200A47671 /* hereTests.swift */, - ); - path = hereTests; - sourceTree = ""; - }; - 4BC8F4132AC8868200A47671 /* hereUITests */ = { - isa = PBXGroup; - children = ( - 4BC8F4142AC8868200A47671 /* hereUITests.swift */, - 4BC8F4162AC8868200A47671 /* hereUITestsLaunchTests.swift */, - ); - path = hereUITests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 4BC8F3EF2AC8868100A47671 /* here */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BC8F41A2AC8868200A47671 /* Build configuration list for PBXNativeTarget "here" */; - buildPhases = ( - 4BC8F3EC2AC8868100A47671 /* Sources */, - 4BC8F3ED2AC8868100A47671 /* Frameworks */, - 4BC8F3EE2AC8868100A47671 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = here; - productName = here; - productReference = 4BC8F3F02AC8868100A47671 /* here.app */; - productType = "com.apple.product-type.application"; - }; - 4BC8F4052AC8868200A47671 /* hereTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BC8F41D2AC8868200A47671 /* Build configuration list for PBXNativeTarget "hereTests" */; - buildPhases = ( - 4BC8F4022AC8868200A47671 /* Sources */, - 4BC8F4032AC8868200A47671 /* Frameworks */, - 4BC8F4042AC8868200A47671 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4BC8F4082AC8868200A47671 /* PBXTargetDependency */, - ); - name = hereTests; - productName = hereTests; - productReference = 4BC8F4062AC8868200A47671 /* hereTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 4BC8F40F2AC8868200A47671 /* hereUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BC8F4202AC8868200A47671 /* Build configuration list for PBXNativeTarget "hereUITests" */; - buildPhases = ( - 4BC8F40C2AC8868200A47671 /* Sources */, - 4BC8F40D2AC8868200A47671 /* Frameworks */, - 4BC8F40E2AC8868200A47671 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4BC8F4122AC8868200A47671 /* PBXTargetDependency */, - ); - name = hereUITests; - productName = hereUITests; - productReference = 4BC8F4102AC8868200A47671 /* hereUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 4BC8F3E82AC8868100A47671 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1330; - LastUpgradeCheck = 1330; - TargetAttributes = { - 4BC8F3EF2AC8868100A47671 = { - CreatedOnToolsVersion = 13.3; - }; - 4BC8F4052AC8868200A47671 = { - CreatedOnToolsVersion = 13.3; - TestTargetID = 4BC8F3EF2AC8868100A47671; - }; - 4BC8F40F2AC8868200A47671 = { - CreatedOnToolsVersion = 13.3; - TestTargetID = 4BC8F3EF2AC8868100A47671; - }; - }; - }; - buildConfigurationList = 4BC8F3EB2AC8868100A47671 /* Build configuration list for PBXProject "here" */; - compatibilityVersion = "Xcode 13.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 4BC8F3E72AC8868100A47671; - productRefGroup = 4BC8F3F12AC8868100A47671 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 4BC8F3EF2AC8868100A47671 /* here */, - 4BC8F4052AC8868200A47671 /* hereTests */, - 4BC8F40F2AC8868200A47671 /* hereUITests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 4BC8F3EE2AC8868100A47671 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BC8F4002AC8868200A47671 /* LaunchScreen.storyboard in Resources */, - 4BC8F3FD2AC8868200A47671 /* Assets.xcassets in Resources */, - 4BC8F3FB2AC8868100A47671 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BC8F4042AC8868200A47671 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BC8F40E2AC8868200A47671 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 4BC8F3EC2AC8868100A47671 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BC8F3F82AC8868100A47671 /* ViewController.swift in Sources */, - 15E71F672ADB24FB0076B662 /* Messages.swift in Sources */, - 3BDFCFB72AD9E6D40088E497 /* Profile.swift in Sources */, - 3BDFCFB92ADB0CCB0088E497 /* Home.swift in Sources */, - 4BC8F3F42AC8868100A47671 /* AppDelegate.swift in Sources */, - 4BC8F3F62AC8868100A47671 /* SceneDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BC8F4022AC8868200A47671 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BC8F40B2AC8868200A47671 /* hereTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BC8F40C2AC8868200A47671 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BC8F4172AC8868200A47671 /* hereUITestsLaunchTests.swift in Sources */, - 4BC8F4152AC8868200A47671 /* hereUITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 4BC8F4082AC8868200A47671 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BC8F3EF2AC8868100A47671 /* here */; - targetProxy = 4BC8F4072AC8868200A47671 /* PBXContainerItemProxy */; - }; - 4BC8F4122AC8868200A47671 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BC8F3EF2AC8868100A47671 /* here */; - targetProxy = 4BC8F4112AC8868200A47671 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 4BC8F3F92AC8868100A47671 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 4BC8F3FA2AC8868100A47671 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 4BC8F3FE2AC8868200A47671 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 4BC8F3FF2AC8868200A47671 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 4BC8F4182AC8868200A47671 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.4; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 4BC8F4192AC8868200A47671 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.4; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 4BC8F41B2AC8868200A47671 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = here/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = here.here; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 4BC8F41C2AC8868200A47671 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = here/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = here.here; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 4BC8F41E2AC8868200A47671 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.4; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = here.hereTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/here.app/here"; - }; - name = Debug; - }; - 4BC8F41F2AC8868200A47671 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.4; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = here.hereTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/here.app/here"; - }; - name = Release; - }; - 4BC8F4212AC8868200A47671 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = here.hereUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = here; - }; - name = Debug; - }; - 4BC8F4222AC8868200A47671 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = here.hereUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = here; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4BC8F3EB2AC8868100A47671 /* Build configuration list for PBXProject "here" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BC8F4182AC8868200A47671 /* Debug */, - 4BC8F4192AC8868200A47671 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BC8F41A2AC8868200A47671 /* Build configuration list for PBXNativeTarget "here" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BC8F41B2AC8868200A47671 /* Debug */, - 4BC8F41C2AC8868200A47671 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BC8F41D2AC8868200A47671 /* Build configuration list for PBXNativeTarget "hereTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BC8F41E2AC8868200A47671 /* Debug */, - 4BC8F41F2AC8868200A47671 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BC8F4202AC8868200A47671 /* Build configuration list for PBXNativeTarget "hereUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BC8F4212AC8868200A47671 /* Debug */, - 4BC8F4222AC8868200A47671 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 4BC8F3E82AC8868100A47671 /* Project object */; -} diff --git a/app/here.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/app/here.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/app/here.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/app/here.xcodeproj/project.xcworkspace/xcuserdata/ericwang.xcuserdatad/UserInterfaceState.xcuserstate b/app/here.xcodeproj/project.xcworkspace/xcuserdata/ericwang.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index ea7ffa0..0000000 Binary files a/app/here.xcodeproj/project.xcworkspace/xcuserdata/ericwang.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/app/here.xcodeproj/project.xcworkspace/xcuserdata/lindsaychen.xcuserdatad/UserInterfaceState.xcuserstate b/app/here.xcodeproj/project.xcworkspace/xcuserdata/lindsaychen.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 4dad605..0000000 Binary files a/app/here.xcodeproj/project.xcworkspace/xcuserdata/lindsaychen.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/app/here.xcodeproj/project.xcworkspace/xcuserdata/phucduong.xcuserdatad/UserInterfaceState.xcuserstate b/app/here.xcodeproj/project.xcworkspace/xcuserdata/phucduong.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index c8d8eed..0000000 Binary files a/app/here.xcodeproj/project.xcworkspace/xcuserdata/phucduong.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/app/here.xcodeproj/xcuserdata/ericwang.xcuserdatad/xcschemes/xcschememanagement.plist b/app/here.xcodeproj/xcuserdata/ericwang.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 5507d12..0000000 --- a/app/here.xcodeproj/xcuserdata/ericwang.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - here.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/app/here.xcodeproj/xcuserdata/lindsaychen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/app/here.xcodeproj/xcuserdata/lindsaychen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index e2968cb..0000000 --- a/app/here.xcodeproj/xcuserdata/lindsaychen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/app/here.xcodeproj/xcuserdata/lindsaychen.xcuserdatad/xcschemes/xcschememanagement.plist b/app/here.xcodeproj/xcuserdata/lindsaychen.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 5507d12..0000000 --- a/app/here.xcodeproj/xcuserdata/lindsaychen.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - here.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/app/here.xcodeproj/xcuserdata/phucduong.xcuserdatad/xcschemes/xcschememanagement.plist b/app/here.xcodeproj/xcuserdata/phucduong.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 5507d12..0000000 --- a/app/here.xcodeproj/xcuserdata/phucduong.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - here.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/app/here/AppDelegate.swift b/app/here/AppDelegate.swift deleted file mode 100644 index 9f3c130..0000000 --- a/app/here/AppDelegate.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// AppDelegate.swift -// here -// -// Created by Phuc Duong on 9/30/23. -// - -import UIKit - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - // MARK: UISceneSession Lifecycle - - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } - - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. - } - - -} - diff --git a/app/here/Assets.xcassets/AccentColor.colorset/Contents.json b/app/here/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb87897..0000000 --- a/app/here/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/app/here/Assets.xcassets/AppIcon.appiconset/Contents.json b/app/here/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 5a3257a..0000000 --- a/app/here/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/app/here/Assets.xcassets/Contents.json b/app/here/Assets.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/app/here/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/app/here/Assets.xcassets/profilePicture.imageset/4A17C929-321F-4D1A-A4DC-8C2E56B7E71A_1_105_c.jpeg b/app/here/Assets.xcassets/profilePicture.imageset/4A17C929-321F-4D1A-A4DC-8C2E56B7E71A_1_105_c.jpeg deleted file mode 100644 index f08d458..0000000 Binary files a/app/here/Assets.xcassets/profilePicture.imageset/4A17C929-321F-4D1A-A4DC-8C2E56B7E71A_1_105_c.jpeg and /dev/null differ diff --git a/app/here/Assets.xcassets/profilePicture.imageset/Contents.json b/app/here/Assets.xcassets/profilePicture.imageset/Contents.json deleted file mode 100644 index 7015d28..0000000 --- a/app/here/Assets.xcassets/profilePicture.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "4A17C929-321F-4D1A-A4DC-8C2E56B7E71A_1_105_c.jpeg", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/app/here/Base.lproj/LaunchScreen.storyboard b/app/here/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e932..0000000 --- a/app/here/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/here/Base.lproj/Main.storyboard b/app/here/Base.lproj/Main.storyboard deleted file mode 100644 index 25a7638..0000000 --- a/app/here/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/here/Bubble.swift b/app/here/Bubble.swift deleted file mode 100644 index a05ad83..0000000 --- a/app/here/Bubble.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// Bubble.swift -// here -// -// Created by Eric Wang on 10/28/23. -// - -import Foundation -import ARKit - -class Bubble: SCNNode { - - override init() { - super.init() - let bubble = SCNPlane(width: 0.25, height: 0.25) - let material = SCNMaterial() - material.diffuse.contents = #imageLiteral(resourceName: "bubbleText") - material.isDoubleSided = true - material.writesToDepthBuffer = false - material.blendMode = .screen - bubble.materials = [material] - self.geometry = bubble - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - -} diff --git a/app/here/CustomARView.swift b/app/here/CustomARView.swift deleted file mode 100644 index 380db0e..0000000 --- a/app/here/CustomARView.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// CustomARView.swift -// new_here -// -// Created by TRACY LI on 2023/10/28. -// - -import ARKit -import RealityKit -import SwiftUI - -class CustomARView: ARView { - required init (frame frameRect: CGRect){ - super.init(frame: frameRect) - } - - dynamic required init?(coder decoder: NSCoder){ - fatalError("init(coder:) has not been implemented") - } - - convenience init(){ - self.init(frame: UIScreen.main.bounds) - } -} diff --git a/app/here/CustomARViewRepresentable.swift b/app/here/CustomARViewRepresentable.swift deleted file mode 100644 index 607366e..0000000 --- a/app/here/CustomARViewRepresentable.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// CustomARViewRepresentable.swift -// new_here -// -// Created by TRACY LI on 2023/10/28. -// - -import SwiftUI - -struct CustomARViewRepresentable: UIViewRepresentable { - func makeUIView(context: Context) -> CustomARView { - return CustomARView() - } - - func updateUIView (_ uiView: CustomARView, context: Context) {} -} diff --git a/app/here/Home.swift b/app/here/Home.swift deleted file mode 100644 index f354c6a..0000000 --- a/app/here/Home.swift +++ /dev/null @@ -1,89 +0,0 @@ -// -// Home.swift -// here -// -// Created by Lindsay Chen on 10/14/23. -// - -import SwiftUI -import ARKit -import RealityKit - -struct HomePageView: View { - @State private var isShowingProfile = false - @State private var isShowingMessages = false - @State private var isShowingPosts = false - - var body: some View { - CustomARViewRepresentable() - .ignoresSafeArea() - .overlay(alignment: .bottom){ - ScrollView(.horizontal){ - VStack(){ - Spacer() - HStack{ - HStack(alignment: .bottom, spacing: 28.0) { - Button{ - - }label: - { - Image(systemName: "map") - } - - Button{isShowingMessages.toggle() - - }label: - { - Image(systemName: "message") - } - - Button{isShowingPosts.toggle() - - }label: - { - Image(systemName: "plus.circle") - .scaleEffect(2) - } - - Button{ - - }label: - { - Image(systemName: "square.and.arrow.up") - } - - Button{isShowingProfile.toggle() - - }label: - { - Image(systemName: "person") - } - - }.alignmentGuide(.bottom) { d in d[.bottom]} - .font(.largeTitle) - .padding(10) - } - } - .sheet(isPresented: $isShowingProfile) { - ProfilePopup(isPresented: $isShowingProfile) // Pass the binding to control visibility - } - .sheet(isPresented: $isShowingMessages) { - MessagesPopup(isPresented: $isShowingMessages) - } - .sheet(isPresented: $isShowingPosts){ - PostsPopup(isPresented: $isShowingPosts) - } - - } - } - - } -} - -struct HomePageView_Previews: PreviewProvider { - static var previews: some View { - HomePageView() - } -} - - diff --git a/app/here/Info.plist b/app/here/Info.plist deleted file mode 100644 index dd3c9af..0000000 --- a/app/here/Info.plist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main - - - - - - diff --git a/app/here/Messages.swift b/app/here/Messages.swift deleted file mode 100644 index 93064cf..0000000 --- a/app/here/Messages.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// Messages.swift -// here -// -// Created by Eric Wang on 10/14/23. -// - -import SwiftUI - -struct MessagesPopup: View { - @Binding var isPresented: Bool - - var body: some View { - ZStack{ - Image("cross_campus") - .font(.system(size: 50)) - LazyVStack { - HStack { - Spacer() - Button(action: { - isPresented.toggle() // Close the popup - }) { - Text("Close") - .font(.headline) - .padding() - .background(Color.blue) - .foregroundColor(.white) - .cornerRadius(10) - } - .padding(.trailing, 20) // Adjust the position of the close button - } - ForEach(1...5, id: \.self) { count in - Button(action: {}) { - HStack { - ProfilePicture() - Text("Message Title") - .foregroundColor(.black) - Image(systemName: "map") - .foregroundColor(.black) - } - .padding(EdgeInsets(top: 10, leading: 20, bottom: 10, trailing: 20)) // Set margins for the entire button - } - .background(Color.white.opacity(0.9)) - .opacity(/*@START_MENU_TOKEN@*/0.8/*@END_MENU_TOKEN@*/) - - } - } - - } - } -} - -struct ProfilePicture: View { - var body : some View { - Image("profilePicture") - .resizable() - .aspectRatio(contentMode: .fill) - .frame(width: 50, height: 50) - .clipShape(Circle()) - .padding() - } -} - diff --git a/app/here/Post.swift b/app/here/Post.swift deleted file mode 100644 index 6e80e5d..0000000 --- a/app/here/Post.swift +++ /dev/null @@ -1,116 +0,0 @@ -// -// Message_View.swift -// here -// -// Created by Liyang Wang on 10/10/23. -// - -import SwiftUI -import ARKit - -struct PostsPopup: View { - @Binding var isPresented: Bool - @State private var noteMessage: String = "This is your message!" - let senderName: String = "Username" - - var body: some View { - GeometryReader { geometry in - ZStack { - ARBackgroundView() - - VStack(spacing: 10) { - Spacer() - - HStack { - Spacer() - Button(action: { - isPresented.toggle() // Close the popup - }) { - Text("Close") - .font(.headline) - .padding() - .background(Color.blue) - .foregroundColor(.white) - .cornerRadius(10) - } - .padding(.trailing, 20) // Adjust the position of the close button - } - .padding(.leading, 20) - - ZStack { - RoundedRectangle(cornerRadius: 10) - .fill(Color.white) - .shadow(radius: 5) - - VStack { - TextEditor(text: $noteMessage) - .padding(.all, 30) - - Spacer(minLength: 20) - - HStack { - Button(action: { - // Share Action - }, label: { - Image(systemName: "square.and.arrow.up.fill") - .resizable() - .foregroundColor(.blue) - .frame(width: 24, height: 24) - .padding(.leading, 20) - }) - - Spacer() - - Button(action: { - // Send Action - }, label: { - Image(systemName: "paperplane.fill") - .resizable() - .foregroundColor(.blue) - .frame(width: 24, height: 24) - .padding(.trailing, 20) - }) - } - .padding(.bottom, 25) - } - } - .opacity(0.5) - .frame(width: geometry.size.width - 40, height: geometry.size.width - 40) - - Spacer() - } - } - } - } -} - -struct ARBackgroundView: UIViewRepresentable { - func makeUIView(context: Context) -> ARSCNView { - let arView = ARSCNView(frame: .zero) - - arView.session.delegate = context.coordinator - - let configuration = ARWorldTrackingConfiguration() - configuration.planeDetection = .horizontal - configuration.environmentTexturing = .automatic - - arView.session.run(configuration) - - return arView - } - - func updateUIView(_ uiView: ARSCNView, context: Context) {} - - // ARKit delegate methods - func makeCoordinator() -> Coordinator { - Coordinator() - } - - class Coordinator: NSObject, ARSessionDelegate {} -} - -//struct NoteMessageView_Previews: PreviewProvider { -// static var previews: some View { -// -// } -//} diff --git a/app/here/Profile.swift b/app/here/Profile.swift deleted file mode 100644 index 50f55fb..0000000 --- a/app/here/Profile.swift +++ /dev/null @@ -1,188 +0,0 @@ -// -// Profile.swift -// here -// -// Created by Lindsay Chen on 10/13/23. -// - -import SwiftUI - -//struct ContentView: View { -// @State private var isShowingProfile = false -// -// var body: some View { -// NavigationView { -// ScrollView { -// VStack { -// Button(action: { -// isShowingProfile.toggle() -// }) { -// Text("Show Profile") -// .font(.headline) -// .padding() -// .background(Color.blue) -// .foregroundColor(.white) -// .cornerRadius(10) -// } -// } -// } -// .navigationBarTitle("Home", displayMode: .inline) -// } -// .sheet(isPresented: $isShowingProfile) { -// ProfilePopup(isPresented: $isShowingProfile) // Pass the binding to control visibility -// } -// } -//} - - - -struct ProfilePopup: View { - @Binding var isPresented: Bool // Added binding to control visibility - - var body: some View { - ZStack { - Color.white - VStack { - HStack { - Spacer() - Button(action: { - isPresented.toggle() // Close the popup - }) { - Text("Close") - .font(.headline) - .padding() - .background(Color.blue) - .foregroundColor(.white) - .cornerRadius(10) - } - .padding(.trailing, 20) // Adjust the position of the close button - } - ProfileHeader() - Divider() - ProfileStats() - Divider() - PostGrid() - } - } - .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .top) // Adjust size and alignment - } -} - - -//struct ContentView_Previews: PreviewProvider { -// static var previews: some View { -// ContentView() -// } -//} - -struct ProfileHeader: View { - var body: some View { - HStack { - Image("profilePicture") - .resizable() - .aspectRatio(contentMode: .fill) - .frame(width: 80, height: 80) - .clipShape(Circle()) - .padding() - - VStack(alignment: .leading, spacing: 8) { - Text("Username") - .font(.title) - .bold() - - Text("Bio or description") - .font(.subheadline) - - ProfileButtons() - } - - Spacer() - } - .padding() - } -} - -struct ProfileButtons: View { - var body: some View { - HStack { - Button(action: { - // Action for Edit Profile - }) { - Text("Edit") - .font(.headline) - .padding(EdgeInsets(top: 6, leading: 12, bottom: 6, trailing: 12)) - .border(Color.gray, width: 1) - .cornerRadius(5) - } - - - Button(action: { - // Action for Add Friend - }) { - Image(systemName: "person.badge.plus") - .font(.system(size: 20)) - .padding(10) - .background(Color.blue) - .foregroundColor(.white) - .clipShape(Circle()) - } - } - } -} - -struct ProfileStats: View { - let stats: [(title: String, value: String)] = [ - ("Notes", "10"), - ("Friends", "100") - ] - - var body: some View { - HStack { - ForEach(stats, id: \.title) { stat in - VStack { - Text(stat.title) - .font(.caption) - .foregroundColor(.gray) - - Text(stat.value) - .font(.headline) - } - .padding() - .background(Color.white) - .cornerRadius(8) - .shadow(radius: 3) - } - } - .padding() - } -} - -struct ProfileStatItem: View { - let title: String - let value: String - - var body: some View { - VStack { - Text(value) - .font(.headline) - .bold() - - Text(title) - .font(.subheadline) - .foregroundColor(.gray) - } - } -} - -struct PostGrid: View { - var body: some View { - // Replace with a grid or list of posts - Text("Posts Grid") - .font(.title) - .padding() - } -} - -//#Preview { -// ContentView() -//} diff --git a/app/here/SceneDelegate.swift b/app/here/SceneDelegate.swift deleted file mode 100644 index 788d6b6..0000000 --- a/app/here/SceneDelegate.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// SceneDelegate.swift -// here -// -// Created by Phuc Duong on 9/30/23. -// - -import UIKit - -class SceneDelegate: UIResponder, UIWindowSceneDelegate { - - var window: UIWindow? - - - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - guard let _ = (scene as? UIWindowScene) else { return } - } - - func sceneDidDisconnect(_ scene: UIScene) { - // Called as the scene is being released by the system. - // This occurs shortly after the scene enters the background, or when its session is discarded. - // Release any resources associated with this scene that can be re-created the next time the scene connects. - // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). - } - - func sceneDidBecomeActive(_ scene: UIScene) { - // Called when the scene has moved from an inactive state to an active state. - // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. - } - - func sceneWillResignActive(_ scene: UIScene) { - // Called when the scene will move from an active state to an inactive state. - // This may occur due to temporary interruptions (ex. an incoming phone call). - } - - func sceneWillEnterForeground(_ scene: UIScene) { - // Called as the scene transitions from the background to the foreground. - // Use this method to undo the changes made on entering the background. - } - - func sceneDidEnterBackground(_ scene: UIScene) { - // Called as the scene transitions from the foreground to the background. - // Use this method to save data, release shared resources, and store enough scene-specific state information - // to restore the scene back to its current state. - } - - -} - diff --git a/app/here/ViewController.swift b/app/here/ViewController.swift deleted file mode 100644 index d34c8ec..0000000 --- a/app/here/ViewController.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// ViewController.swift -// here -// -// Created by Phuc Duong on 9/30/23. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view. - } - -} - diff --git a/app/here/new_hereApp.swift b/app/here/new_hereApp.swift deleted file mode 100644 index dd69a3e..0000000 --- a/app/here/new_hereApp.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// new_hereApp.swift -// new_here -// -// Created by YIMING GUAN on 2023/10/28. -// - -import SwiftUI - -@main -struct new_hereApp: App { - var body: some Scene { - WindowGroup { - HomePageView() - } - } -} diff --git a/app/hereTests/hereTests.swift b/app/hereTests/hereTests.swift deleted file mode 100644 index 8fd802f..0000000 --- a/app/hereTests/hereTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// hereTests.swift -// hereTests -// -// Created by Phuc Duong on 9/30/23. -// - -import XCTest -@testable import here - -class hereTests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - // Any test you write for XCTest can be annotated as throws and async. - // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. - // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. - } - - func testPerformanceExample() throws { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/app/hereUITests/hereUITests.swift b/app/hereUITests/hereUITests.swift deleted file mode 100644 index e6beb7f..0000000 --- a/app/hereUITests/hereUITests.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// hereUITests.swift -// hereUITests -// -// Created by Phuc Duong on 9/30/23. -// - -import XCTest - -class hereUITests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // UI tests must launch the application that they test. - let app = XCUIApplication() - app.launch() - - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testLaunchPerformance() throws { - if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { - // This measures how long it takes to launch your application. - measure(metrics: [XCTApplicationLaunchMetric()]) { - XCUIApplication().launch() - } - } - } -} diff --git a/app/hereUITests/hereUITestsLaunchTests.swift b/app/hereUITests/hereUITestsLaunchTests.swift deleted file mode 100644 index 3b5e7ef..0000000 --- a/app/hereUITests/hereUITestsLaunchTests.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// hereUITestsLaunchTests.swift -// hereUITests -// -// Created by Phuc Duong on 9/30/23. -// - -import XCTest - -class hereUITestsLaunchTests: XCTestCase { - - override class var runsForEachTargetApplicationUIConfiguration: Bool { - true - } - - override func setUpWithError() throws { - continueAfterFailure = false - } - - func testLaunch() throws { - let app = XCUIApplication() - app.launch() - - // Insert steps here to perform after app launch but before taking a screenshot, - // such as logging into a test account or navigating somewhere in the app - - let attachment = XCTAttachment(screenshot: app.screenshot()) - attachment.name = "Launch Screen" - attachment.lifetime = .keepAlways - add(attachment) - } -} diff --git a/app/newHere1/newHere.xcodeproj/project.pbxproj b/app/newHere1/newHere.xcodeproj/project.pbxproj index bc0dd3a..0735809 100644 --- a/app/newHere1/newHere.xcodeproj/project.pbxproj +++ b/app/newHere1/newHere.xcodeproj/project.pbxproj @@ -20,7 +20,6 @@ 1531A90F2AED9917009F644E /* Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1531A90E2AED9917009F644E /* Post.swift */; }; 1531A9132AEDAE2A009F644E /* LocationDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1531A9122AEDAE2A009F644E /* LocationDataManager.swift */; }; 1531A9152AEDCADB009F644E /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1531A9142AEDCADB009F644E /* Message.swift */; }; - ECB2736F2AF6CCF80033D871 /* Registration.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB2736E2AF6CCF80033D871 /* Registration.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -58,7 +57,6 @@ 1531A90E2AED9917009F644E /* Post.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Post.swift; sourceTree = ""; }; 1531A9122AEDAE2A009F644E /* LocationDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationDataManager.swift; sourceTree = ""; }; 1531A9142AEDCADB009F644E /* Message.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = ""; }; - ECB2736E2AF6CCF80033D871 /* Registration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Registration.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -116,7 +114,6 @@ 1531A90A2AED964A009F644E /* Profile.swift */, 1531A90E2AED9917009F644E /* Post.swift */, 1531A9142AEDCADB009F644E /* Message.swift */, - ECB2736E2AF6CCF80033D871 /* Registration.swift */, 1531A9122AEDAE2A009F644E /* LocationDataManager.swift */, 1531A8E12AED95FF009F644E /* Assets.xcassets */, 1531A8E32AED95FF009F644E /* newHere.entitlements */, @@ -284,7 +281,6 @@ 1531A8E02AED95FD009F644E /* ContentView.swift in Sources */, 1531A90B2AED964A009F644E /* Profile.swift in Sources */, 1531A90D2AED9663009F644E /* Messages.swift in Sources */, - ECB2736F2AF6CCF80033D871 /* Registration.swift in Sources */, 1531A90F2AED9917009F644E /* Post.swift in Sources */, 1531A9152AEDCADB009F644E /* Message.swift in Sources */, 1531A9092AED9618009F644E /* Home.swift in Sources */, diff --git a/app/newHere1/newHere.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/app/newHere1/newHere.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/app/newHere1/newHere.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/app/here.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app/newHere1/newHere.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 72% rename from app/here.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to app/newHere1/newHere.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings index 18d9810..0c67376 100644 --- a/app/here.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ b/app/newHere1/newHere.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -1,8 +1,5 @@ - - IDEDidComputeMac32BitWarning - - + diff --git a/app/newHere1/newHere.xcodeproj/project.xcworkspace/xcuserdata/ericwang.xcuserdatad/UserInterfaceState.xcuserstate b/app/newHere1/newHere.xcodeproj/project.xcworkspace/xcuserdata/ericwang.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 8f3c4cb..0000000 Binary files a/app/newHere1/newHere.xcodeproj/project.xcworkspace/xcuserdata/ericwang.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/app/newHere1/newHere.xcodeproj/project.xcworkspace/xcuserdata/sophia.xcuserdatad/UserInterfaceState.xcuserstate b/app/newHere1/newHere.xcodeproj/project.xcworkspace/xcuserdata/sophia.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 79dc761..0000000 Binary files a/app/newHere1/newHere.xcodeproj/project.xcworkspace/xcuserdata/sophia.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/app/newHere1/newHere.xcodeproj/xcuserdata/ericwang.xcuserdatad/xcschemes/xcschememanagement.plist b/app/newHere1/newHere.xcodeproj/xcuserdata/ericwang.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index c2dd834..0000000 --- a/app/newHere1/newHere.xcodeproj/xcuserdata/ericwang.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - newHere.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/app/newHere1/newHere/ContentView.swift b/app/newHere1/newHere/ContentView.swift index b01a931..b9a5ecb 100644 --- a/app/newHere1/newHere/ContentView.swift +++ b/app/newHere1/newHere/ContentView.swift @@ -9,13 +9,16 @@ import SwiftUI struct ContentView: View { @State private var isRegistered = false - + @ObservedObject var locationDataManager = LocationDataManager() + var body: some View { - if isRegistered { - HomePageView() - } else { - RegistrationView(isRegistered: $isRegistered) - } + HomePageView() + .environmentObject(locationDataManager) + // if isRegistered { +// HomePageView() +// } else { +// RegistrationView(isRegistered: $isRegistered) +// } } } diff --git a/app/newHere1/newHere/CustomARViewRepresentable.swift b/app/newHere1/newHere/CustomARViewRepresentable.swift index 607366e..6df2a29 100644 --- a/app/newHere1/newHere/CustomARViewRepresentable.swift +++ b/app/newHere1/newHere/CustomARViewRepresentable.swift @@ -6,11 +6,153 @@ // import SwiftUI +import ARKit + +//class ARViewModel: ObservableObject { +// var messageToPlant: Message? +// +// func plantMessage(_ message: Message) { +// messageToPlant = message +// } +//} struct CustomARViewRepresentable: UIViewRepresentable { - func makeUIView(context: Context) -> CustomARView { - return CustomARView() + @EnvironmentObject var messageState: MessageState + @EnvironmentObject var fetchedMessagesState: FetchedMessagesState + + func makeUIView(context: Context) -> ARSCNView { +// return CustomARView() + let sceneView = ARSCNView() + sceneView.delegate = context.coordinator + + let configuration = ARWorldTrackingConfiguration() + sceneView.session.run(configuration) + + getUserMessages(userId: "653d51478ff5b3c9ace45c26") { + result in + switch result { + case .success(let response): + print("Messages fetched successfully: \(response)") + var convertedMessages:[Message] = [] + for m in response { + do { + let convertedMessage = try Message(id: m._id, + location: m.location.toCLLocation(), + messageStr: m.text) + convertedMessages.append(convertedMessage) + } + catch { + // Handle the error + print("Error: \(error)") + } + } + + fetchedMessagesState.fetchedMessages = convertedMessages + renderBubbleNodeHistory(to: sceneView, messages: convertedMessages) + + case .failure(let error): + print("Error getting messages: \(error.localizedDescription)") + } + } + + return sceneView + } + + func updateUIView (_ uiView: ARSCNView, context: Context) { + if let messageToPlant = messageState.currentMessage { + plantBubbleNode(to: uiView, message: messageToPlant) + messageState.currentMessage = nil + } + + } + + func makeCoordinator() -> Coordinator { + Coordinator(self) + } + + class Coordinator: NSObject, ARSCNViewDelegate { + var parent: CustomARViewRepresentable + + init(_ parent: CustomARViewRepresentable) { + self.parent = parent + } + } + + func plantBubbleNode(to sceneView: ARSCNView, message: Message) { + // Set the position based on the provided position + if let frame = sceneView.session.currentFrame { + let transform = frame.camera.transform + + // Get the camera's forward direction (z-axis) + let forwardDirection = SCNVector3(-transform.columns.2.x, -transform.columns.2.y, -transform.columns.2.z) + + // Calculate the position 2 meters in front of the camera + let shifted_position = SCNVector3( + transform.columns.3.x + forwardDirection.x * 0.5, + transform.columns.3.y + forwardDirection.y * 0.5, + transform.columns.3.z + forwardDirection.z * 0.5 + ) + + newBubbleNode(to: sceneView, message: message, position: shifted_position) + } } - func updateUIView (_ uiView: CustomARView, context: Context) {} + func renderBubbleNodeHistory(to sceneView: ARSCNView, messages: [Message]) { + // Create a random number generator + var randomNumberGenerator = SystemRandomNumberGenerator() + + // Define the range of random positions for x, y, and z coordinates + let xRange: ClosedRange = -3.0...3.0 // Represents a 10-meter width (-5m to +5m) + let yRange: ClosedRange = 0.0...3.0 // Represents a height range above the ground (0m to +2m) + let zRange: ClosedRange = -3.0...3.0 // Represents a 10-meter depth (-5m to +5m) + + for message in messages { + // Generate random positions + let randomX = Float.random(in: xRange, using: &randomNumberGenerator) + let randomY = Float.random(in: yRange, using: &randomNumberGenerator) + let randomZ = Float.random(in: zRange, using: &randomNumberGenerator) + + // Create an SCNVector3 using the random positions + let randomPosition = SCNVector3(randomX, randomY, randomZ) + + newBubbleNode(to: sceneView, message: message, position: randomPosition) + } + } + + func newBubbleNode(to sceneView: ARSCNView, message:Message, position:SCNVector3) { + let bubble = SCNSphere(radius: 0.05) + bubble.firstMaterial?.diffuse.contents = UIColor(red: 135.0/255.0, green: 206.0/255.0, blue: 235.0/255.0, alpha: 1.0) + + let bubbleNode = SCNNode(geometry: bubble) + + // Create an SCNText geometry for the first text + let textGeometry1 = SCNText(string: message.id, extrusionDepth: 0.001) + textGeometry1.firstMaterial?.diffuse.contents = UIColor.black + let textNode1 = SCNNode(geometry: textGeometry1) + + + // TEXT POSITIONING RELATIVE TO BUBBLE - WILL HAVE TO ADJUST LATER + + // Position the first textNode inside the bubble + textNode1.position = SCNVector3(-0.05, 0, -0.05) // Adjust the position inside the bubble + textNode1.scale = SCNVector3(0.001, 0.001, 0.001) + + // Create an SCNText geometry for the second text + let textGeometry2 = SCNText(string: message.messageStr, extrusionDepth: 0.001) + textGeometry2.firstMaterial?.diffuse.contents = UIColor.black + let textNode2 = SCNNode(geometry: textGeometry2) + + // Position the second textNode inside the bubble, stacked on top of the first + textNode2.position = SCNVector3(-0.05, 0, 0.05) // Adjust the vertical position inside the bubble + textNode2.scale = SCNVector3(0.001, 0.001, 0.001) + + // Add both text nodes as children of the bubbleNode + bubbleNode.addChildNode(textNode1) + bubbleNode.addChildNode(textNode2) + + print("\(message.id), \(message.messageStr)") + // Set the node's position to the calculated position 2 meters in front of the camera + bubbleNode.position = position + sceneView.scene.rootNode.addChildNode(bubbleNode) + } } diff --git a/app/newHere1/newHere/Home.swift b/app/newHere1/newHere/Home.swift index cc548f7..f4f573b 100644 --- a/app/newHere1/newHere/Home.swift +++ b/app/newHere1/newHere/Home.swift @@ -6,39 +6,54 @@ // import SwiftUI +import ARKit + +class MessageState: ObservableObject { + @Published var currentMessage: Message? +} + +class FetchedMessagesState: ObservableObject { + var fetchedMessages: [Message]? +} struct HomePageView: View { @State private var isShowingProfile = false @State private var isShowingMessages = false @State private var isShowingPosts = false - @State private var storedMessages: [Message] = [] - + @EnvironmentObject var locationDataManager: LocationDataManager + @StateObject var messageState = MessageState() + @StateObject var fetchedMessagesState = FetchedMessagesState() + var body: some View { CustomARViewRepresentable() + .environmentObject(messageState) + .environmentObject(fetchedMessagesState) .ignoresSafeArea() .overlay(alignment: .bottom){ VStack(){ - if let currentLocation = locationDataManager.location { - Text("Your current location is:") - Text("Latitude: \(currentLocation.coordinate.latitude.description)") - Text("Longitude: \(currentLocation.coordinate.longitude.description)\n") - } else { - Text("Finding your location...\n") - ProgressView() - } +// if let currentLocation = locationDataManager.location { +// Text("Your current location is:") +// Text("Latitude: \(currentLocation.coordinate.latitude.description)") +// Text("Longitude: \(currentLocation.coordinate.longitude.description)\n") +// } else { +// Text("Finding your location...\n") +// ProgressView() +// } - // render the stored messages on the screen - if !storedMessages.isEmpty { - List { - ForEach(0.. CLLocation { + guard type == "Point" else { + throw GeoJSONError.invalidType + } + guard coordinates.count == 2 else { + throw GeoJSONError.invalidCoordinates + } + return CLLocation(latitude: coordinates[1], longitude: coordinates[0]) + } +} + +extension CLLocation { + func toGeoJSONPoint() -> GeoJSONPoint { + return GeoJSONPoint(latitude: self.coordinate.latitude, longitude: self.coordinate.longitude) + } +} + class LocationDataManager: NSObject, ObservableObject, CLLocationManagerDelegate { @Published var location: CLLocation? private var locationManager = CLLocationManager() + override init() { super.init() locationManager.delegate = self @@ -19,3 +51,4 @@ class LocationDataManager: NSObject, ObservableObject, CLLocationManagerDelegate } } } + diff --git a/app/newHere1/newHere/Message.swift b/app/newHere1/newHere/Message.swift index 05f8cd0..f832044 100644 --- a/app/newHere1/newHere/Message.swift +++ b/app/newHere1/newHere/Message.swift @@ -9,17 +9,15 @@ import Foundation import CoreLocation class Message { + var id: String + var user_id: String var location: CLLocation - var author: String var messageStr: String - init(location:CLLocation, author: String, messageStr: String) { + init(id:String, location:CLLocation, messageStr: String) { + self.id = id + self.user_id = "653d51478ff5b3c9ace45c26" self.location = location - self.author = author self.messageStr = messageStr } - - func displayMessage() -> String { - return "Author: \(author)\n\(location.coordinate.latitude.description), \(location.coordinate.longitude.description), \n\(messageStr)" - } } diff --git a/app/newHere1/newHere/Post.swift b/app/newHere1/newHere/Post.swift index 19cf8ca..5af94dc 100644 --- a/app/newHere1/newHere/Post.swift +++ b/app/newHere1/newHere/Post.swift @@ -9,26 +9,77 @@ import SwiftUI import CoreLocation import Foundation +let apiKey = "qe5YT6jOgiA422_UcdbmVxxG1Z6G48aHV7fSV4TbAPs" + +struct PostMessageRequest: Codable { + let user_id: String + let text: String + let visibility: String + let location: GeoJSONPoint +} + +struct MessageResponse: Codable { + let _id: String + let user_id: String + let text: String + let visibility: String + let location: GeoJSONPoint +} + struct PostsPopup: View { @Binding var isPresented: Bool - @Binding var storedMessages: [Message] +// @Binding var storedMessages: [Message] @State private var noteMessage: String = "This is your message!" + @EnvironmentObject var messageState: MessageState let senderName: String = "Username" @EnvironmentObject var locationDataManager: LocationDataManager - - func handleSubmitForm() { + + func postMessage(user_id: String, text: String, visibility: String, completion: @escaping (Result) -> Void) { + // make sure you can get the current location if let currentLocation = locationDataManager.location { - let newMessage = Message(location: currentLocation, - author: senderName, - messageStr: noteMessage) - self.storedMessages.append(newMessage) + + guard let url = URL(string: "https://here-swe.vercel.app/message/post_message") else { + print("Invalid URL") + return + } + + var request = URLRequest(url: url) + + request.httpMethod = "POST" + request.addValue("application/json", forHTTPHeaderField: "Content-Type") + request.addValue(apiKey, forHTTPHeaderField: "X-API-Key") + + let requestBody = PostMessageRequest(user_id: user_id, text: text, visibility: visibility, location: currentLocation.toGeoJSONPoint()) + request.httpBody = try? JSONEncoder().encode(requestBody) + let task = URLSession.shared.dataTask(with: request) { data, response, error in + if let error = error { + completion(.failure(error)) + return + } + guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode), let data = data else { + // Handle the case when the response is not an HTTPURLResponse or the status code is not in the range. + let statusCode = (response as? HTTPURLResponse)?.statusCode ?? -1 + completion(.failure(NSError(domain: "", code: statusCode, userInfo: nil))) + return + } + do { + let messageResponse = try JSONDecoder().decode(MessageResponse.self, from: data) + completion(.success(messageResponse)) + } catch { + completion(.failure(error)) + } + } + task.resume() } + + + } - + var body: some View { GeometryReader { geometry in ZStack { @@ -77,7 +128,33 @@ struct PostsPopup: View { Spacer() Button(action: { - handleSubmitForm() + postMessage(user_id: "653d51478ff5b3c9ace45c26", text: noteMessage, visibility: "friends") { + result in + switch result { + case .success(let response): + print("Message posted successfully: \(response)") + + + do { + let newMessage = try Message( + id: response._id, + location: response.location.toCLLocation(), + messageStr: response.text) + // Use newMessage here +// self.storedMessages.append(newMessage) + + messageState.currentMessage = newMessage + + } catch { + // Handle the error + print("Error: \(error)") + } + + + case .failure(let error): + print("Error posting message: \(error.localizedDescription)") + } + } }, label: { Image(systemName: "paperplane.fill") .resizable() diff --git a/app/newHere1/newHere/api_call.swift b/app/newHere1/newHere/api_call.swift new file mode 100644 index 0000000..22db972 --- /dev/null +++ b/app/newHere1/newHere/api_call.swift @@ -0,0 +1,70 @@ +// +// api_call.swift +// newHere +// +// Created by Phuc Duong on 11/5/23. +// + + +import Foundation + +let apiKey2 = "qe5YT6jOgiA422_UcdbmVxxG1Z6G48aHV7fSV4TbAPs" + +struct UserMessage: Codable { + struct Location: Codable { + let type: String + let coordinates: [Double] + } + + let location: GeoJSONPoint + let _id: String + let user_id: String + let text: String + let likes: Int + let visibility: String + let replies: [String] +} + +func getUserMessages(userId: String, completion: @escaping (Result<[MessageResponse], Error>) -> Void) { + let urlString = "https://here-swe.vercel.app/user/\(userId)/messages" + + guard let url = URL(string: urlString) else { + completion(.failure(URLError(.badURL))) + return + } + + var request = URLRequest(url: url) + request.httpMethod = "GET" + request.addValue("application/json", forHTTPHeaderField: "Accept") + request.addValue(apiKey2, forHTTPHeaderField: "X-API-Key") + + let task = URLSession.shared.dataTask(with: request) { data, response, error in + if let error = error { + completion(.failure(error)) + return + } + + guard let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode == 200 else { + completion(.failure(URLError(.badServerResponse))) + return + } + + guard let data = data else { + completion(.failure(URLError(.cannotParseResponse))) + return + } + + do { + let messages = try JSONDecoder().decode([MessageResponse].self, from: data) + completion(.success(messages)) + + + + } catch { + completion(.failure(error)) + } + } + + task.resume() + +} diff --git a/server/README.md b/server/README.md index 6fb2e88..0245336 100644 --- a/server/README.md +++ b/server/README.md @@ -1,108 +1,221 @@ -Note that base url will change with deployment of backend. - -# AUTH -- REGISTER: POST "http://localhost:6000/auth/register" - - params: - { - "userName": "JohnDED", - "firstName": "John", - "lastName": "Doe", - "email": "johnDoE@yale.edu", - "password": "secretpassword" - } - -- LOGIN: GET "http://localhost:6000/auth/login" - - params: - { - "inputLogin": "JaneD", - "password": "secretpassword" - } - -# MESSAGE -- POST MESSAGE: POST "http://localhost:6000/message/post_message" - - params: - { - "user_id": "653d51478ff5b3c9ace45c26", - "text": "Hi, this is a test message - Jane", - "visibility": "friends", - "location": { - "type": "Point", - "coordinates": [40.7128, -74.0060] - } - } - -- DELETE MESSAGE: POST "http://localhost:6000/message/delete_message" - - params: - { - "messageId": "653d62a37ce9c61f28dcaa7f" - } - -- INCREMENT LIKES: POST "http://localhost:6000/message/increment_likes" - - params: - { - "id": "653d62de7ce9c61f28dcaa87" - } - -- CHANGE VISIBILITY: POST "http://localhost:6000/message/change_visibility" - - params: - { - "id": "dsfsf", - "new_data": "" - } - -# REPLY -- ADD REPLY: POST "http://localhost:6000/reply/reply_to_message" - - params: - { - "message_id": "653ea4a35b858b2542ea4f13", - "content": "this is a test reply to a test message" - } - -- LIKE REPLY: GET "http://localhost:6000/reply/like_reply" - - params: - { - "reply_id": "somekindofreplyid" - } - -# USER -- SEARCH USER BY USER_ID: GET "http://localhost:6000/user/search" - - params: - { - "userId": "" - } -- SEARCH USER BY EMAIL: GET "http://localhost:6000/user/search" - - params: - { - "email": "janedoe@yale.edu" - } - -- SEARCH USER BY USERNAME: GET "http://localhost:6000/user/search" - - params: - { - "userName": "" - } - -- ADD USER FRIEND: PUT "http://localhost:6000/user/userid" - - params: - { - "friendId": "friend's id" - } - -- GET FRIEND OF USER: GET "http://localhost:6000/user/userId/friends" - -- TOGGLE NOTIFY FRIENDS: PUT "http://localhost:6000/user/userId/toggle-notify-friends" - -- UPDATE PROFILE: PUT "http://localhost:6000/user/userId/update-profile" - - params: - { - "userName": "john_d", - "password": "hello", - "firstName": "Johnn", - "lastName": "Doee", - "email": "john.doe@yale.edu", - "avatar": "" - } - -- REMOVE USER FRIEND: GET "http://localhost:6000/user/search/johndoe@yale.edu" - -- DELETE USER: DELETE "http://localhost:6000/user/653d58a37ab5eaf376965b82" +# API Documentation + +This document outlines the API endpoints for Here. Please contact the developer for the X-API-Key. + +## Base URL + +- **Base URL:** `https://here-swe.vercel.app/` + +## Authentication Endpoints + +### Register + +Creates a new user account. + +- **Endpoint:** `POST /auth/register` +- **Body:** + +```json +{ + "userName": "JohnD", + "firstName": "John", + "lastName": "Doe", + "email": "johndoe@yale.edu", + "password": "secretpassword" +} +``` + +### Login + +Authenticates a user and returns user data if successful. + +- **Endpoint:** `GET /auth/login` +- **Body:** + +```json +{ + "inputLogin": "JohnD", + "password": "secretpassword" +} +``` + +## User Endpoints + +### Search User by Email or Username + +Search for a user by their email address or username. Do not need to include both. + +- **Endpoint:** `GET /user/search` +- **Body:** + +```json +{ + "email": "user@yale.edu", + "userName": "JohnD" +} +``` + +### Get User by ID + +Retrieve a user by their unique identifier. + +- **Endpoint:** `GET /user/:userId` + +### Get User Friends + +Retrieve a list of friends for a user. + +- **Endpoint:** `GET /user/:userId/friends` + +### Get User's Messages + +Retrieve messages for a user. + +- **Endpoint:** `GET /user/:userId/messages` + +### Add User's Friend + +Add a friend to a user's friend list. Will also add that user to the other user's friend list. + +- **Endpoint:** `PUT /user/:userId/friends` +- **Body:** + +```json +{ + "friendId": "friendUserId" +} +``` + +### Remove User's Friend + +Remove a friend from a user's friend list. + +- **Endpoint:** `DELETE /user/:userId/friends` +- **Body:** + +```json +{ + "friendId": "friendUserId" +} +``` + +### Toggle Notify Friends + +Toggle the notification setting for a user's friends. + +- **Endpoint:** `PUT /user/:userId/toggle-notify-friends` + +### Update User's Profile + +Update a user's profile information. + +- **Endpoint:** `PUT /user/:userId/update-profile` +- **Body:** + +```json +{ + "userName": "newUserName", + "password": "newPassword", + "firstName": "newFirstName", + "lastName": "newLastName", + "email": "newEmail@yale.edu", + "avatar": "urlToAvatar" +} +``` + +### Delete User + +Delete a user and their associated messages. + +- **Endpoint:** `DELETE /user/:userId` + + +## Message Endpoints + +### Post Message + +Allows a user to post a message. + +- **Endpoint:** `POST /message/post_message` +- **Body:** + +```json +{ + "user_id": "653d51478ff5b3c9ace45c26", + "text": "Hi, this is a test message - Jane", + "visibility": "friends", + "location": { + "type": "Point", + "coordinates": [40.7128, -74.0060] + } +} +``` + +### Delete Message + +Allows a user to delete their message. + +- **Endpoint:** `POST /message/delete_message` +- **Body:** + +```json +{ + "messageId": "653d62a37ce9c61f28dcaa7f" +} +``` + +### Increment Likes + +Increments the number of likes on a message. + +- **Endpoint:** `POST /message/increment_likes` +- **Body:** + +```json +{ + "id": "653d62de7ce9c61f28dcaa87" +} +``` + +### Change Visibility + +Changes the visibility of a user's message. + +- **Endpoint:** `POST /message/change_visibility` +- **Body:** + +```json +{ + "id": "653d62de7ce9c61f28dcaa87", + "new_visibility": "public" +} +``` + +## Reply Endpoints + +### Like Reply + +Increments the number of likes on a reply. + +- **Endpoint:** `GET /reply/like_reply` +- **Body:** + +```json +{ + "reply_id": "653d62de7ce9c61f28dcaa87" +} +``` + +### Add Reply + +Add a reply to a message. + +- **Endpoint:** `POST /reply/reply_to_message` +- **Body:** + +```json +{ + "message_id": "653ea4a35b858b2542ea4f13", + "content": "this is a test reply to a test message" +} +``` \ No newline at end of file diff --git a/server/controllers/user.js b/server/controllers/user.js index 30b9a2e..16d339b 100644 --- a/server/controllers/user.js +++ b/server/controllers/user.js @@ -7,6 +7,7 @@ import { handleBadRequest, } from "../utils/handlers.js"; import MessageModel from "../models/Message.js"; +import ReplyModel from "../models/Reply.js"; export const getUserById = async (req, res) => { try { @@ -125,7 +126,14 @@ export const getUserMessages = async (req, res) => { try { const { userId } = req.params; - const user = await UserModel.findById(userId); + const user = await UserModel.findById(userId).populate({ + path: "messages", + model: MessageModel, + populate: { + path: "replies", + model: ReplyModel, + }, + }); if (!user) { return handleNotFound(res, "User not found"); diff --git a/server/routes/user.js b/server/routes/user.js index ddaa8c5..3a301c1 100644 --- a/server/routes/user.js +++ b/server/routes/user.js @@ -17,7 +17,7 @@ router.get("/search", getUserByEmailOrUsername); router.get("/:userId", getUserById); router.get("/:userId/friends", getUserFriends); -router.get("/:userId/friends", getUserMessages); +router.get("/:userId/messages", getUserMessages); router.put("/:userId/friends", addUserFriend); router.put("/:userId/toggle-notify-friends", toggleNotifyFriends);