PetFinder is a mobile app that helps connect animals in shelters or foster homes with people who want to adopt, making the adoption process simpler, faster, and more transparent for everyone. It focuses on showing pets with rich, friendly profiles instead of cold listings, so each animal feels like a real companion, not just an ID number. For tutors and shelters, it offers an easy way to publish pets with photos and details, keep information updated, and follow up with interested adopters. For adopters, it brings a swipe-based experience that is fun to use but still serious about responsible adoption, including health, location, and contact information. The project is open-source, designed so other developers can learn from and extend a real-world React Native + backend stack. The goal is to lower the barrier for both adopters and organizations, helping more animals find safe, loving homes.
React Native + Expo mobile app that lets adopters swipe through pets, view rich profiles, save favorites, and tutors post new pets with images. Authentication, search, messaging, notifications, and location support are built in.
| Swipe like | Swipe skip | Pet detail |
|---|---|---|
![]() |
![]() |
![]() |
| List of Favorites | Add pet | Profile |
|---|---|---|
![]() |
![]() |
![]() |
- Auth: login/register with token storage and refresh; protects app tabs via
AuthContext. - Discovery: Tinder-style swipe deck for available pets with preloaded images, like (favorite) or skip, open detail view.
- Search: list-based search with filters (name/breed/description, type, status) and quick chips.
- Details: image gallery, health flags, tutor info, adoption CTA, contact mail link, favorite toggle.
- Favorites: local favorite IDs in AsyncStorage, fetch pet data by IDs, remove favorites, pull-to-refresh, debug helpers.
- Add a pet: multi-step form with dropdowns, breed/weight catalogs, health flags, location fields, date picker, up to 5 photos with Expo image pickers and compression; creates pets with images through
PetService. - Profile: account info, preferences toggles, entry points for tutor upgrade, messages, favorites, logout.
- Messaging: conversations, messages, unread counts, cached in AsyncStorage.
- Notifications: Expo push registration, token storage and server sync, local notifications helpers.
- Location: fetch current position, reverse/forward geocode, nearby pets helper.
- Navigation: stack + bottom tabs in
AppNavigator(tabs: Home, Favorites, AddPet, Profile; detail pushed). Auth stack shows Login/Register when no token. - State:
AuthContextholds auth state, tokens, user info, refresh flow. AsyncStorage persists auth and favorites. - Services (src/services): typed API helpers on top of Axios client (
apiClient) with token injection and retry logic. Key modules: AuthService, PetService, FavoritesService, SearchService, AdoptionService, MessagingService, NotificationService, ImagesService, LocationService. - UI: screens under
src/screens, swipe deck component incomponents/PetSwipeCardwith Reanimated gestures and prefetching. - Data: static catalogs (breeds, pet options) in
src/data; images fetched via/pets/images/{id}.
-
Backend API repo: https://github.com/RobertoDure/petfinder-api
-
Base API:
/api(configured insrc/services/apiClient.js). Auth base is/api/v1/auth(AuthService). Update the IPs before running on device. -
Core endpoints used: pets CRUD, pets search, favorites by IDs, adoption requests, messages, notification tokens, images upload, auth login/register/refresh.
- Expo SDK 54, React Native 0.81, React 19. Uses Reanimated, Gesture Handler, Expo Camera/Image Picker/Image Manipulator, AsyncStorage, Notifications, Location.
- Dev base URLs: change
http://192.168.0.139:8080insrc/services/apiClient.jsandsrc/services/AuthService.jsto match your backend host (use 10.0.2.2 for Android emulator; device needs your machine IP). - Auth tokens persisted under
userToken,refreshToken,userInfoin AsyncStorage. - Favorites stored locally (
user_favorite_pet_ids,user_favorite_pets_data) and synced by IDs.
- Sign in/up → token stored → tabs unlocked.
- Home swipe deck → like saves to favorites; tap opens detail.
- Detail → view gallery, health, tutor info; adoption CTA; contact mailto; favorite toggle.
- Search → filter list; open detail.
- Favorites → list saved pets; remove; tap to detail.
- Add Pet → fill form, pick/compress images, submit to API with multipart/form-data.
- Optional: notifications registration; messaging flows (conversations/messages) via services.
- Install:
npm install - Start:
npm start(ornpm run android/npm run ios/npm run web) - Use Expo Go or emulator; ensure device can reach your backend IP/port (update services URLs).
petfinder-app/
├─ App.js # Root, providers, navigation container
├─ src/
│ ├─ navigation/ # Stack/tab setup
│ ├─ context/ # AuthContext
│ ├─ screens/ # Home, Search, Detail, Favorites, AddPet, Profile, Auth
│ ├─ components/ # PetSwipeCard (deck), shared UI
│ ├─ services/ # API clients, auth, pets, favorites, search, messaging, notifications, location, images
│ ├─ data/ # breeds catalog, pet options
│ └─ utils/ # Image utils, favorites debugger
- Image uploads:
PetService.createPetWithImagesexpects FormData with 3+ images. - Filtering: Home filters available pets client-side after fetching
/pets/status/AVAILABLE. - Preloading: swipe deck prefetches upcoming images for smoother swipes.
- Location: grant permissions before calling
LocationService.getCurrentLocation. - Notifications: physical device required for push; ensure Expo projectId is set.
MIT







