Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
b437175
init: template
Astrol99 Apr 15, 2025
787d60f
feat: added basic button variants and cleaned up screens
Astrol99 Apr 15, 2025
20ba107
ops: added zod react-hook-form and resolver
Astrol99 Apr 15, 2025
2ab7b1d
feat: added basic login form
Astrol99 Apr 15, 2025
e164800
feat: auth flow
Astrol99 Apr 15, 2025
3872a73
feat: fixed some styling
Astrol99 Apr 15, 2025
b934970
fix: auth flow bug
Astrol99 Apr 15, 2025
04433a4
fix: types
Astrol99 Apr 15, 2025
dbec280
fix: entire auth flow
Astrol99 Apr 15, 2025
cc03bb0
fix: auth store
Astrol99 Apr 15, 2025
a35238e
feat: added more tabs
Astrol99 Apr 15, 2025
830a936
ops: added recommended vscode extensions
Astrol99 Apr 15, 2025
ce1777a
updated extensions
Astrol99 Apr 16, 2025
6db2dba
feat: added user registration
Astrol99 Apr 16, 2025
7ed4def
chore: cleaned up some packages
Astrol99 Apr 16, 2025
fe92976
feat: added google oauth
Astrol99 Apr 16, 2025
66813ab
ops: supabase init
Astrol99 Apr 20, 2025
9008492
fix: migration history
Astrol99 Apr 20, 2025
846c47a
feat: spot db structure init
Astrol99 Apr 21, 2025
ca46303
feat: added local google oauth
Astrol99 Apr 21, 2025
64ef39e
fix: supabase RLS and indexings
Astrol99 Apr 21, 2025
fde3fa1
feat: added create spot modal
Astrol99 Apr 22, 2025
01cf780
chore: some cleanup
Astrol99 Apr 22, 2025
854ba70
feat: WORKING PERSISTENT AUTH FLOW
Astrol99 Apr 22, 2025
a83b7a0
feat: added database types with supazod
Astrol99 Apr 22, 2025
ffa44a9
fix: small auth flow error
Astrol99 Apr 22, 2025
495126d
style: updated colors
Astrol99 Apr 22, 2025
5041201
feat: added auth uid as default for user_id
Astrol99 Apr 22, 2025
0636592
feat: added spot creation
Astrol99 Apr 22, 2025
a9a023a
feat: added tagging feature
Astrol99 Apr 22, 2025
7b29286
feat: added spots list
Astrol99 Apr 22, 2025
4dc29c0
style: made it look better
Astrol99 Apr 22, 2025
2272721
style: added tab bar icons
Astrol99 Apr 22, 2025
2ac82a3
feat: added spot list refresh
Astrol99 Apr 22, 2025
c14e9f1
added owner
Astrol99 Apr 23, 2025
7a9f65a
feat: updated schema
Astrol99 Apr 23, 2025
61f1769
feat: added small loading shimmer
Astrol99 Apr 23, 2025
6976704
style: added tab bar icon active colors
Astrol99 Apr 23, 2025
d0887a0
feat: added image upload
Astrol99 Apr 23, 2025
581b0cb
refact: removed extra image item info
Astrol99 Apr 23, 2025
1f323d8
feat: added image upload!!!
Astrol99 Apr 23, 2025
3b2f8f5
fix: upsert slug tag conflict duplicates and removed created_by for tags
Astrol99 May 17, 2025
5fd8b4d
feat: fetched media coorelating to spot
Astrol99 May 17, 2025
1dbb7a8
feat: made storage buckets public
Astrol99 May 19, 2025
13722ff
pkgs: expo-clipboard
Astrol99 May 19, 2025
fd49288
feat: added image preview
Astrol99 May 19, 2025
c5f8167
feat: preview image uses user position index
Astrol99 May 19, 2025
cc18f7c
Merge branch 'main' of https://github.com/Longhorn-Developers/Longhor…
Astrol99 May 19, 2025
7fba92b
cleanup
Astrol99 May 19, 2025
09a27e8
fix: image upload to use Promise to prevent race condition
Astrol99 May 19, 2025
2bbb6d6
feat: hovering new spot button
Astrol99 May 19, 2025
b3dd56e
dep: bumped expo version to sdk 53 for expo-map support
Astrol99 May 19, 2025
2791798
feat: added basic map
Astrol99 May 19, 2025
1205725
feat: added location picker and image exif gps info
Astrol99 May 20, 2025
7de8d63
feat: added react hook form validation to location picker with zod
Astrol99 May 20, 2025
ff120fa
feat: call auth api to check on initial sessions
Astrol99 May 20, 2025
5c3ddf5
feat: saved geolocation data on backend
Astrol99 May 20, 2025
e3ceca2
feat: added db view of spots + tags + media + geo
Astrol99 May 21, 2025
e3a40ab
feat: added spot fetch with map markers
Astrol99 May 21, 2025
dd42523
feat: refetch spots on map screen + misc design updates
Astrol99 May 21, 2025
05f41bf
refact: used spots view instead of manual joining for explore
Astrol99 May 21, 2025
91fd774
feat: qualify of life stuff: fixed pin on map picker + image exif geo…
Astrol99 May 21, 2025
cb39a91
feat: removed groups for now
Astrol99 May 21, 2025
4e09cc0
feat: moved database types to supabase folder
Astrol99 May 22, 2025
db8763a
feat: moved spot creation to edge function
Astrol99 May 22, 2025
2eb1106
fix: zustand dependency bug
Astrol99 May 23, 2025
3165944
feat: added Safesearch APi
Astrol99 May 24, 2025
73b7be9
feat: db table for favorites
Astrol99 May 28, 2025
3ca2a2f
chore: updated database types export
Astrol99 May 28, 2025
87aaf87
feat: added favorites CRUD backend logic
Astrol99 May 28, 2025
df57448
feat: preload spots favorite state
Astrol99 May 28, 2025
311b8df
fix: fixed rerender bug for prefilled favorite and updated styling
Astrol99 May 28, 2025
6887393
refact: moved spot card to own component
Astrol99 May 28, 2025
3279433
fix: no image case
Astrol99 May 29, 2025
705f730
feat: added favorites list
Astrol99 May 29, 2025
bdb4090
refact: spot icon fallback
Astrol99 May 29, 2025
67bfa9d
feat: separated fetch for spots and favorites
Astrol99 May 29, 2025
be72e28
fix: padding for spots list and spotsIcon type compatibility
Astrol99 May 29, 2025
277fe51
feat: added a favorites page
Astrol99 May 29, 2025
6e44529
feat: removed buggy shimmer placeholder for now
Astrol99 May 29, 2025
1a236c5
feat: added basic search box
Astrol99 May 29, 2025
5cb6478
feat: moved common tags into state
Astrol99 May 29, 2025
0d9ed41
refact: tag selector into its own component from tag search
Astrol99 May 30, 2025
3e17143
feat: added tags under searchbar
Astrol99 Jun 2, 2025
8cb7838
chore: fix for expo-doctor and styling
Astrol99 Jun 2, 2025
4e5df51
feat: added search stack screen and transition
Astrol99 Jun 3, 2025
96da8f9
feat: added trending tags and popular spots in search
Astrol99 Jun 4, 2025
b8bcd28
feat: added basic search
Astrol99 Jun 4, 2025
4397429
fix: height bug extending past safeareaview for flashlist
Astrol99 Jun 4, 2025
afb4612
feat: stylized trending tags in add new study spot
Astrol99 Jun 4, 2025
4eb0e18
feat: more styling stuff
Astrol99 Jun 4, 2025
468bc48
feat: added left icon child to tag search and separated commontags fr…
Astrol99 Jun 4, 2025
e83c47b
feat: merged searchTag queries with selectedTags for good UX
Astrol99 Jun 4, 2025
521d294
refact: onTagChange unnecessary here
Astrol99 Jun 4, 2025
cf6e545
feat: added tag search
Astrol99 Jun 6, 2025
6c8bec4
feat: updated tag type to make id optional
Astrol99 Jun 6, 2025
362ec7d
feat: added optional showTrendingTags parameter to TagSearch
Astrol99 Jun 6, 2025
4206244
style: padding and margins
Astrol99 Jun 6, 2025
2581702
feat: resetted queries on unmount
Astrol99 Jun 6, 2025
47524d4
feat: added spotcard on map marker click
Astrol99 Jun 6, 2025
3a3df94
feat: added animation to spot card map
Astrol99 Jun 6, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ios/
android/
8 changes: 3 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"deno.enablePaths": [
"longhorn-studies/supabase/functions"
],
"deno.enablePaths": ["longhorn-studies/supabase/functions"],
"deno.lint": true,
"deno.unstable": [
"bare-node-builtins",
Expand All @@ -19,6 +17,6 @@
"net"
],
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
}
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
}
16 changes: 12 additions & 4 deletions longhorn-studies/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"expo": {
"name": "longhorn-studies",
"name": "Longhorn Studies",
"slug": "longhorn-studies",
"owner": "longhorn-developers",
"version": "1.0.0",
"scheme": "longhorn-studies",
"web": {
Expand All @@ -22,7 +23,14 @@
{
"iosUrlScheme": "com.googleusercontent.apps.117866795198-nn8qmvqdg6fdhkd6lulnu005t0ct85o9"
}
]
],
[
"expo-maps",
{
"requestLocationPermission": "true"
}
],
"expo-web-browser"
],
"newArchEnabled": true,
"experiments": {
Expand All @@ -40,14 +48,14 @@
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.astrol.longhornstudies"
"bundleIdentifier": "com.longhorndevelopers.longhornstudies"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.astrol.longhornstudies"
"package": "com.longhorndevelopers.longhornstudies"
},
"extra": {
"router": {
Expand Down
39 changes: 21 additions & 18 deletions longhorn-studies/app/(app)/(protected)/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
import AntDesign from '@expo/vector-icons/AntDesign';
import { Link, Tabs } from 'expo-router';

import { Button } from '~/components/Button';
import { AntDesign, Entypo } from '@expo/vector-icons';
import { Tabs } from 'expo-router';

export default function AppLayout() {
// This layout can be deferred because it's not the root layout.
return (
<Tabs>
<Tabs screenOptions={{ tabBarActiveTintColor: '#d97706' }}>
<Tabs.Screen
name="index"
options={{
title: 'Home',
headerRight: () => (
<Link href="/create-spot" asChild>
<Button
size="small"
icon={<AntDesign name="plus" color="white" />}
title="New Spot"
/>
</Link>
),
title: 'Explore',
headerShown: false,
tabBarIcon: ({ color }) => <Entypo name="magnifying-glass" size={24} color={color} />,
}}
/>
<Tabs.Screen
name="map/index"
options={{
title: 'Map',
headerShown: false,
tabBarIcon: ({ color }) => <Entypo name="map" size={24} color={color} />,
}}
/>
<Tabs.Screen
name="profile/index"
options={{
title: 'Profile',
tabBarIcon: ({ color }) => <AntDesign name="user" size={24} color={color} />,
}}
/>
<Tabs.Screen name="groups/index" options={{ title: 'Groups' }} />
<Tabs.Screen name="map/index" options={{ title: 'Map' }} />
<Tabs.Screen name="profile/index" options={{ title: 'Profile' }} />
</Tabs>
);
}
19 changes: 0 additions & 19 deletions longhorn-studies/app/(app)/(protected)/(tabs)/groups/index.tsx

This file was deleted.

177 changes: 165 additions & 12 deletions longhorn-studies/app/(app)/(protected)/(tabs)/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,172 @@
import { View } from 'react-native';
import { Entypo, Ionicons } from '@expo/vector-icons';
import { FlashList } from '@shopify/flash-list';
import { Link } from 'expo-router';
import { useEffect, useState } from 'react';
import { Pressable, Text, View } from 'react-native';

import { Button } from '~/components/Button';
import { Container } from '~/components/Container';
import SpotCard from '~/components/SpotCard';
import SpotIcon from '~/components/SpotIcon';
import { useAuth } from '~/store/AuthProvider';
import {
PublicSpotsWithDetailsRowSchema,
PublicSpotFavoritesRowSchema,
} from '~/supabase/functions/new-spot/types/schemas_infer';
import { supabase } from '~/utils/supabase';

export default function Explore() {
const { user } = useAuth();

const [spots, setSpots] = useState<PublicSpotsWithDetailsRowSchema[]>([]);
const [favorites, setFavorites] = useState<PublicSpotFavoritesRowSchema[]>([]);

const [spotsLoading, setSpotsLoading] = useState(true);
const [favoritesLoading, setFavoritesLoading] = useState(true);

async function fetchFavorites() {
// Fetch favorites from the database
setFavoritesLoading(true);
try {
// Fetch favorites for the current user
const { data: favorites_data, error: favorites_error } = await supabase
.from('spot_favorites')
.select()
.eq('user_id', user!.id); // Ensure to filter by the current user

if (favorites_error) {
console.error('Error fetching favorites:', favorites_error);
return;
}

setFavorites(favorites_data);
console.log('Explore fetched favorites');
} catch (error) {
console.error('Error in fetchFavorites:', error);
} finally {
setFavoritesLoading(false);
}
}

async function fetchSpots() {
// Fetch spots from the database
setSpotsLoading(true);
try {
// Fetch spots with their tags and media
const { data: spots_data, error: spots_error } = await supabase
.from('spots_with_details')
.select()
.limit(20);

if (spots_error) {
console.error('Error fetching spots:', spots_error);
return;
}

setSpots(spots_data);
console.log('Explore fetched spots');
} catch (error) {
console.error('Error in fetchSpots:', error);
} finally {
setSpotsLoading(false);
}
}

useEffect(() => {
fetchFavorites();
fetchSpots();
}, []);

export default function Home() {
const { signOut } = useAuth();
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Button
title="Sign Out"
onPress={() => {
// The `app/(app)/_layout.tsx` will redirect to the sign-in screen.
signOut();
}}
/>
</View>
<Container>
{/* Spot Explorer */}
<View className="flex-1 gap-4">
{/* Search box placeholder transition */}
<Link href="/search" asChild>
<Pressable>
<View
// sharedTransitionTag="explore-search"
className="flex-row items-center rounded-xl border border-gray-300 px-3">
<Ionicons name="search" size={20} color="gray" />
<Text className="flex-1 p-4 text-gray-300">Explore study spots</Text>
</View>
</Pressable>
</Link>

{/* Favorites List */}
<View>
{/* Header */}
<View className="flex-row items-center justify-between">
<Text className="text-2xl font-bold text-gray-800">Your Favorites</Text>
<Link href="/favorites" asChild>
<Text className="font-bold text-amber-600">see all</Text>
</Link>
</View>

{/* Favorites Horizontal List */}
<View className="mt-4">
<FlashList
horizontal
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
data={[{ id: 'add-button' }, ...favorites]}
estimatedItemSize={10}
renderItem={({ item }: { item: PublicSpotsWithDetailsRowSchema }) => {
if (item.id === 'add-button') {
return (
// <Link href="/favorites/add" asChild>
<View className="mr-4 h-20 w-20 items-center justify-center rounded-xl border-2 border-dashed border-gray-300">
<Entypo name="plus" size={28} color="#9CA3AF" />
</View>
// </Link>
);
}

return <SpotIcon spot={item} />;
}}
onRefresh={fetchFavorites}
refreshing={favoritesLoading}
/>
</View>
</View>

{/* Spots List */}
<View className="flex-1">
{/* Header */}
<Text className="text-2xl font-bold text-gray-800">Spots For You</Text>
{/* Spots List */}
<FlashList
data={spots}
renderItem={({ item }: any) => (
<SpotCard spot={item} favorited={favorites.some((fav) => fav.id === item.id)} />
)}
estimatedItemSize={20}
showsVerticalScrollIndicator={false}
className="mt-2"
// TODO: Fix bottom pad with useBottomTabBarHeight when using with shimmer placeholder
// not supported in expo??? https://github.com/expo/expo/discussions/26714
// contentContainerStyle={{ paddingBottom: 200 }}
onRefresh={fetchSpots}
refreshing={spotsLoading}
ListEmptyComponent={
<View className="mt-5 items-center justify-center">
<Text className="text-gray-500">No spots found</Text>
</View>
}
/>
</View>
</View>

{/* Floating New Spot Button */}
<Link href="/create-spot" asChild>
<Button
title="New Spot"
icon={<Entypo name="plus" size={18} color="white" />}
iconPosition="left"
className="absolute bottom-1 right-1 h-12 w-28 justify-center"
size="small"
/>
</Link>
</Container>
);
}
Loading