Project Overview
Built a production-ready, cross-platform social media application for pet owners from the ground up. The platform enables pet parents to share moments, connect with other pet families, discover local events, and build a community—all while maintaining consistent user experience across iOS, Android, and web platforms.
Greenfield Development from Inception
Joined the project at inception, contributing to critical architecture decisions and establishing best practices that enabled rapid, scalable development. Built 50+ reusable React Native components, implemented real-time features with GraphQL subscriptions, and resolved 40+ cross-platform compatibility issues to deliver a polished, production-ready application.
The Challenge & Technical Complexity
Problem: PetoLab needed a comprehensive social media platform for pet owners built from scratch. The challenge was creating a scalable, cross-platform application capable of handling real-time social interactions, media-heavy content, and providing seamless experience across iOS, Android, and web.
Technical Requirements: Build a production-ready social platform with real-time messaging, content feeds, user authentication, media uploads, and social features. The architecture needed to support future scaling to thousands of concurrent users while maintaining smooth performance.
Cross-Platform Consistency
Ensure identical user experience and visual consistency across iOS, Android, and web with shared codebase
Real-Time Features
Implement GraphQL subscriptions for instant messaging, live notifications, and content feed updates
Media Performance
Handle video/image uploads, compression, thumbnail generation, and playback optimization
Internationalization
Support multiple languages (English/Chinese) with RTL compatibility and locale-aware formatting
System Architecture
1. Presentation Layer
React Native + Expo
50+ components, responsive layouts, platform adapters2. State Management
Redux Toolkit
Centralized state, async thunks, slice patterns3. Data Layer
GraphQL + REST
Queries, mutations, subscriptions, media uploads4. Platform Services
Expo Modules
Camera, location, push notifications, Firebase auth5. Native Platforms
iOS / Android / Web
Platform-specific optimizations// Cross-Platform Architecture
Presentation (React Native/Web) →
State Management (Redux Toolkit) →
API Layer (GraphQL/REST) →
Platform Services (Expo Modules) →
Native Platforms (iOS/Android/Web)
Key Technical Contributions
Comprehensive Component Library (50+ Components)
Challenge: Build reusable, cross-platform UI components ensuring consistent design language and user experience across iOS, Android, and web.
Solution: Architected component library with platform adapters, theming system, and responsive layouts:
Core Components
- Avatar, Badge, Button, Icon, Image
- Text, Chip, Divider, Modal, BottomSheet
- LoadingIndicator, Carousel, Overlay
Input Components
- TextInput, PasswordInput, SearchInput
- DatePicker, TimePicker, PickerInput
- ImageInput, VideoEditor, CameraModule
- LocationPicker, QRCodeScanner
Social Components
- PostItem, CommentItem, MessageListItem
- UserProfileCard, PetProfileCard
- ActivityFeed, NotificationCard
- ChatMessage, GroupAvatar
Layout Components
- ScreenLayout, PagerScreen, StackScreen
- ScrollList, VirtualizedList
- Header, TabBar, NavigationDrawer
// Platform-Specific Component Adapter
// Image.tsx (Web)
import React from 'react';
export const Image = ({ source, style, ...props }) => (
);
// Image.native.tsx (iOS/Android)
import FastImage from '@d11/react-native-fast-image';
export const Image = ({ source, style, ...props }) => (
);
Real-Time Social Features with GraphQL Subscriptions
Challenge: Implement instant messaging, live notifications, and real-time content feed updates for responsive social experience.
Solution: Integrated GraphQL subscriptions with WebSocket connections for bidirectional real-time communication:
Instant Messaging
- Direct chat with real-time message delivery
- Group chat with typing indicators
- Read receipts and message status
- Media attachments (images, videos)
Live Notifications
- Push notifications via Firebase Cloud Messaging
- In-app notification center
- Activity feed with live updates
- Friend requests and invitations
Content Feed Updates
- New post notifications
- Comment and like counters
- Event RSVP updates
- Optimistic UI updates
// GraphQL Subscription for Real-Time Messages
import { useSubscription } from '@apollo/client';
import { graphql } from './graphql';
const NEW_MESSAGE_SUBSCRIPTION = graphql(`
subscription OnNewMessage($chatId: ID!) {
messageAdded(chatId: $chatId) {
id
content
sender {
id
name
avatar
}
createdAt
}
}
`);
export const useChatSubscription = (chatId: string) => {
const { data, loading } = useSubscription(
NEW_MESSAGE_SUBSCRIPTION,
{
variables: { chatId },
onData: ({ data }) => {
// Update local cache with new message
updateChatMessages(data.messageAdded);
},
}
);
return { newMessage: data?.messageAdded, loading };
};
Redux Architecture for Complex State Management
Challenge: Manage complex application state including user sessions, content feeds, chat history, and real-time updates across multiple screens.
Solution: Designed Redux architecture with feature-based slices, async thunks, and selectors:
State Slices
authSlice- User authentication & sessionspostSlice- Content feed & post managementchatSlice- Messaging & conversationspetProfileSlice- Pet profiles & relationshipseventSlice- Events & attendancemessageSlice- Notifications & activities
Architecture Patterns
- Feature-based slice organization
- Memoized selectors with Reselect
- Async thunks for API integration
- Normalized state for relational data
- Persistent storage with AsyncStorage
// Redux Slice with Async Thunks
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import { postConnector } from '@/connectors/postConnector';
export const fetchPostFeed = createAsyncThunk(
'post/fetchFeed',
async ({ cursor, limit }: FeedParams) => {
const response = await postConnector.getPostFeed(cursor, limit);
return response;
}
);
const postSlice = createSlice({
name: 'post',
initialState: {
feed: [],
loading: false,
error: null,
hasMore: true,
},
reducers: {
optimisticLikePost: (state, action) => {
const post = state.feed.find(p => p.id === action.payload);
if (post) post.isLiked = !post.isLiked;
},
},
extraReducers: (builder) => {
builder
.addCase(fetchPostFeed.pending, (state) => {
state.loading = true;
})
.addCase(fetchPostFeed.fulfilled, (state, action) => {
state.feed = [...state.feed, ...action.payload.posts];
state.hasMore = action.payload.hasMore;
state.loading = false;
});
},
});
Multilingual Support with LinguiJS
Challenge: Support English and Chinese languages with proper locale formatting, pluralization rules, and dynamic language switching.
Solution: Implemented comprehensive i18n system using LinguiJS with message extraction, compilation, and runtime switching:
Automated extraction from source code, PO file management, compiled message catalogs for performance
Pluralization rules, number/date formatting, currency handling, time zone awareness
TypeScript integration, IDE autocomplete, compile-time validation, hot reload support
// LinguiJS Implementation
import { Trans, t } from '@lingui/macro';
import { useLingui } from '@lingui/react';
export const WelcomeScreen = () => {
const { i18n } = useLingui();
return (
Welcome to PetoKingdom!
{i18n._(t`You have ${count} new notifications`)}
);
};
// Extracted messages (messages.po)
// msgid "Welcome to PetoKingdom!"
// msgstr "欢迎来到宠物王国!"
Cross-Platform Compatibility & Bug Resolution (40+ Issues)
Challenge: Resolve platform-specific bugs including styling inconsistencies, responsive design issues, and native module incompatibilities.
Solution: Systematic debugging approach with platform-specific testing and fixes:
Styling Inconsistencies
- Flexbox behavior differences across platforms
- Font rendering and typography issues
- Shadow and elevation inconsistencies
- Border radius and clipping problems
Responsive Design
- Screen size adaptation (tablets/phones)
- Keyboard handling and avoidance
- Safe area insets (notches, home indicators)
- Orientation changes and layout shifts
Native Module Issues
- Camera permissions and functionality
- Video playback performance
- File system access differences
- Deep linking and URL schemes
Performance Optimizations
- Image lazy loading and caching
- List virtualization for large datasets
- Memory leak prevention
- Bundle size optimization
Advanced Media Handling & Optimization
Challenge: Handle image/video uploads, compression, thumbnail generation, and playback across platforms with varying capabilities.
Solution: Integrated native media libraries with custom compression and optimization:
Camera capture, gallery selection, cropping/editing, HEIC conversion, compression (70% quality), thumbnail generation, chunked upload
Recording with time limits, trimming editor, FFmpeg compression, poster frame extraction, adaptive streaming, background upload
Lazy loading, progressive JPEG, FastImage caching, CDN integration, WebP on Android, format conversion
// Video Compression with FFmpeg
import { FFmpegKit } from 'ffmpeg-kit-react-native';
const compressVideo = async (inputPath: string) => {
const outputPath = `${FileSystem.cacheDirectory}compressed_${Date.now()}.mp4`;
const command = `-i ${inputPath} -c:v libx264 -crf 28 -preset fast ` +
`-c:a aac -b:a 128k -movflags +faststart ${outputPath}`;
const session = await FFmpegKit.execute(command);
const returnCode = await session.getReturnCode();
if (returnCode.isValueSuccess()) {
return outputPath; // Typically 60-80% size reduction
}
throw new Error('Compression failed');
};
Complete Technology Stack
Core Framework
State & Data
UI & Styling
Navigation & Routing
Media Handling
Platform Services
Internationalization
Development Tools
Results & Business Impact
Key Achievement Highlights
Single codebase supporting iOS, Android, and web with consistent user experience and platform-specific optimizations
Instant messaging, live notifications, and dynamic content updates via GraphQL subscriptions
Comprehensive component library accelerating feature development while maintaining design consistency
Complete i18n implementation with English and Chinese language support using LinguiJS
Systematic debugging and testing ensuring production-ready quality across all platforms
Scalable architecture ready to support thousands of concurrent users with smooth performance
Core Application Features
Social Networking
- User profiles & pet profiles
- Friend connections & family crews
- Content feed with posts & media
- Comments, likes, and shares
- Hashtag discovery
Messaging
- Direct chat (1-on-1)
- Group chat with multiple users
- Real-time message delivery
- Media sharing (images/videos)
- Read receipts & typing indicators
Events & Activities
- Create & discover local pet events
- Map-based event discovery
- RSVP & attendance tracking
- Event notifications & reminders
- Lost pet alerts
Content Creation
- Photo/video capture & upload
- AI-powered breed detection
- Content editing & filters
- QR code pet profiles
- Draft management
Key Engineering Learnings
Architecture Decisions Matter Early
Building from scratch taught the importance of making thoughtful architecture decisions at inception. Choosing cross-platform development and modular architecture enabled rapid feature development throughout the project lifecycle.
Performance Optimization from Day One
Implementing performance optimizations (virtualization, lazy loading, image caching) from the beginning is far easier than retrofitting. Early focus on performance ensures the app remains smooth as features are added.
Component Reusability Accelerates Development
Creating comprehensive component library early in development significantly accelerated feature implementation by 40% and maintained UI consistency across the entire platform.
Platform-Specific Testing is Critical
Cross-platform development requires testing on all target platforms. Small differences in behavior (flexbox, keyboard handling, native modules) can cause significant UX issues if not caught early.
State Management Shapes Architecture
Redux Toolkit's slice pattern and async thunks provided excellent structure for complex state management. Normalized state and memoized selectors prevented performance issues at scale.
Real-Time Features Require Careful Design
GraphQL subscriptions with optimistic updates created responsive UX, but required careful connection management, error handling, and reconnection logic to ensure reliability.
Production-Ready Cross-Platform Application
Comprehensive social media platform built from scratch, ready for launch across iOS, Android, and web.
Cross-Platform Development
React Native + Expo delivering consistent experience across iOS, Android, and web with shared codebase
Modern Tech Stack
TypeScript, Redux Toolkit, GraphQL subscriptions, Firebase auth, real-time features
Production Quality
50+ components, 40+ bugs resolved, multilingual support, scalable architecture