eServiceApps — Mobile Super App v1.0.0
Feature-modular Flutter super app combining social networking, ride-sharing, travel planning, and delivery services into a single mobile platform. Built with Dart/Flutter using clean architecture, Riverpod state management, GoRouter navigation, and Firebase backend.
Stack: Dart 3 + Flutter 3.x | State: Riverpod | Navigation: GoRouter | Backend: Firebase | License: MIT
Social — User profiles, posts, feeds, messaging.
Ride — Ride-sharing with map integration and tracking.
Travel — Destinations, bookings, itineraries.
Delivery — Package/food delivery with order tracking.
Each module follows clean architecture: features/[name]/models, services, views, widgets.
🏗 Architecture
Feature-modular Flutter with Riverpod + GoRouter + Firebase.
Project Structure
eServiceApps/
lib/
app/ App widget, theme, router
core/ Shared utilities, constants, extensions
features/
social/ models/ services/ views/ widgets/
ride/ models/ services/ views/ widgets/
travel/ models/ services/ views/ widgets/
delivery/ models/ services/ views/ widgets/
auth/ models/ services/ views/ widgets/
shared/ Shared widgets, providers, mixins
test/ Unit and widget tests
integration_test/ Integration tests
firebase/ Security rules, indexesEach feature module is self-contained with models/ (data classes), services/ (business logic + API), views/ (screens), and widgets/ (reusable UI). Cross-feature communication uses Riverpod providers.
Core Dependencies
flutter_riverpod | ^2.4.0 | State management |
go_router | ^13.0.0 | Declarative routing |
firebase_core | ^2.24.0 | Firebase initialization |
cloud_firestore | ^4.13.0 | NoSQL database |
firebase_auth | ^4.15.0 | Authentication |
firebase_storage | ^11.5.0 | File storage |
google_maps_flutter | ^2.5.0 | Maps integration |
freezed | ^2.4.0 | Immutable data classes |
SocialService SocialService(FirebaseFirestore db, FirebaseAuth auth)Core social networking service managing posts, feeds, user profiles, and real-time messaging.
Parameters
| db | FirebaseFirestore | Firestore instance. |
| auth | FirebaseAuth | Auth instance. |
Example
final socialService = ref.watch(socialServiceProvider);PostModel
id | String | Unique post ID |
authorId | String | Author user ID |
content | String | Post text content |
mediaUrls | List<String> | Attached media URLs |
likes | int | Like count |
comments | int | Comment count |
createdAt | DateTime | Creation timestamp |
Future<void> createPost(PostModel post)Create a new post. Uploads media to Firebase Storage, stores metadata in Firestore, and notifies followers.
Example
await socialService.createPost(PostModel(
content: 'Hello world!',
mediaUrls: [uploadedUrl],
));Stream<List<PostModel>> getFeed(String userId, {int limit = 20})Real-time feed stream using Firestore snapshots. Merges posts from followed users, sorted by timestamp.
Future<void> sendMessage(String chatId, MessageModel msg)Send a real-time message in a chat thread. Updates Firestore and triggers push notification.
🚗 Ride Module
Ride-sharing with map integration, booking, and live tracking.
RideService RideService(FirebaseFirestore db, GoogleMapsApi maps)Ride booking, driver matching, real-time tracking, and fare calculation.
Parameters
| db | FirebaseFirestore | Firestore instance. |
| maps | GoogleMapsApi | Maps API client. |
BookingModel
id | String | Booking ID |
riderId | String | Rider user ID |
driverId | String? | Matched driver (null until matched) |
pickup | LatLng | Pickup coordinates |
destination | LatLng | Destination coordinates |
status | RideStatus | requested, matched, in_progress, completed, cancelled |
fare | double | Calculated fare |
Future<BookingModel> requestRide(LatLng pickup, LatLng dest)Request a ride. Calculates route, estimates fare, and enters driver matching queue.
Example
final booking = await rideService.requestRide(
LatLng(37.78, -122.41), LatLng(37.33, -121.89)
);Stream<DriverLocation> trackDriver(String bookingId)Real-time driver location stream via Firestore. Updates every 3 seconds during active rides.
MapView
Interactive Google Maps widget showing pickup/destination markers, route polyline, and live driver position. Uses google_maps_flutter with custom markers and info windows.
✈ Travel Module
Travel planning with destinations, bookings, and itineraries.
TravelService TravelService(FirebaseFirestore db)Destination discovery, hotel/flight bookings, and itinerary management.
DestinationModel
id | String | Destination ID |
name | String | Destination name |
country | String | Country |
imageUrl | String | Cover image |
rating | double | Average rating (0-5) |
priceRange | PriceRange | budget, moderate, luxury |
Future<List<DestinationModel>> searchDestinations(String query, {DestinationFilter? filter})Search destinations with optional filters: country, priceRange, rating, activities.
Future<Itinerary> createItinerary(String destId, DateRange dates)Generate a day-by-day itinerary for a destination and date range.
📦 Delivery Module
Package and food delivery with order tracking.
DeliveryService DeliveryService(FirebaseFirestore db)Order placement, real-time tracking, delivery status updates.
OrderModel
id | String | Order ID |
userId | String | Customer user ID |
items | List<OrderItem> | Ordered items |
status | OrderStatus | placed, preparing, picked_up, in_transit, delivered |
deliveryAddress | Address | Delivery address |
estimatedArrival | DateTime | ETA |
trackingUrl | String? | Live tracking URL |
Future<OrderModel> placeOrder(List<OrderItem> items, Address addr)Place a delivery order. Validates items, calculates total, assigns courier.
Example
final order = await deliveryService.placeOrder(
[OrderItem(name:'Pizza',qty:2,price:12.99)],
Address(street:'123 Main St',city:'SF')
);Stream<OrderStatus> trackOrder(String orderId)Real-time order status stream. Emits updates as order progresses through stages.
🔒 Authentication
Firebase Auth with email/password and social login.
AuthService AuthService(FirebaseAuth auth)Authentication service with email/password, Google, and Apple sign-in. Manages auth state and user sessions.
Parameters
| auth | FirebaseAuth | Firebase Auth instance. |
Example
final authService = ref.watch(authServiceProvider);Future<UserCredential> signInWithEmail(String email, String password)Sign in with email and password. Throws AuthException on failure.
Example
await authService.signInWithEmail('user@example.com', 'pass123');Future<UserCredential> signInWithGoogle()Sign in with Google OAuth. Opens native Google sign-in flow.
Example
final cred = await authService.signInWithGoogle();Future<UserCredential> signInWithApple()Sign in with Apple ID. iOS 13+ required.
Example
final cred = await authService.signInWithApple();Future<void> signOut()Sign out the current user and clear local session.
AuthGuard
Route guard that redirects unauthenticated users to the login screen. Integrates with GoRouter's redirect callback.
GoRouter(
redirect: (context, state) {
final loggedIn = ref.read(authStateProvider).valueOrNull != null;
if (!loggedIn) return '/login';
return null;
},
routes: [...]
);
🔌 Routing
GoRouter declarative navigation with deep linking and guards.
GoRouter createAppRouter(Ref ref)Create the app router with all feature routes, auth guards, and deep link support.
Example
final router = createAppRouter(ref);app_router.dart Configuration
final appRouter = GoRouter(
initialLocation: '/social/feed',
routes: [
GoRoute(path: '/social/feed', builder: (_, __) => FeedView()),
GoRoute(path: '/social/profile/:id', builder: (_, s) => ProfileView(id: s.pathParameters['id']!)),
GoRoute(path: '/ride', builder: (_, __) => RideHomeView()),
GoRoute(path: '/ride/booking/:id', builder: (_, s) => BookingView(id: s.pathParameters['id']!)),
GoRoute(path: '/travel', builder: (_, __) => TravelHomeView()),
GoRoute(path: '/delivery', builder: (_, __) => DeliveryHomeView()),
GoRoute(path: '/delivery/track/:id', builder: (_, s) => TrackingView(id: s.pathParameters['id']!)),
GoRoute(path: '/login', builder: (_, __) => LoginView()),
],
);
All routes support deep linking via go_router. URLs like eserviceapps://ride/booking/abc123 open directly to the booking screen on mobile.
🎨 Theming
Material 3 with custom theme, light/dark modes, and brand colors.
AppTheme
class AppTheme {
static ThemeData light() => ThemeData(
useMaterial3: true,
colorSchemeSeed: const Color(0xFF3B82F6),
brightness: Brightness.light,
fontFamily: 'Inter',
);
static ThemeData dark() => ThemeData(
useMaterial3: true,
colorSchemeSeed: const Color(0xFF3B82F6),
brightness: Brightness.dark,
fontFamily: 'Inter',
);
}
Brand Colors
Primary | #3B82F6 | Blue - primary actions |
Secondary | #10B981 | Green - success, ride |
Tertiary | #8B5CF6 | Purple - travel |
Error | #EF4444 | Red - errors, alerts |
Surface | #FFFFFF / #1E1E1E | Light/dark backgrounds |
ThemeProvider ThemeProvider()Riverpod StateNotifier managing theme mode (light, dark, system). Persists preference to SharedPreferences.
Example
final themeMode = ref.watch(themeProvider);
ref.read(themeProvider.notifier).toggle();⚙ State Management
Riverpod providers for feature isolation and reactive state.
Provider — Read-only computed values.StateProvider — Simple mutable state.StateNotifierProvider — Complex state with business logic.FutureProvider — Async one-shot data.StreamProvider — Real-time reactive data.
Best Practices for Feature Isolation
// Each feature defines its own providers
// features/social/providers.dart
final socialServiceProvider = Provider<SocialService>((ref) {
final db = ref.watch(firestoreProvider);
final auth = ref.watch(firebaseAuthProvider);
return SocialService(db, auth);
});
final feedProvider = StreamProvider.family<List<PostModel>, String>((ref, userId) {
return ref.watch(socialServiceProvider).getFeed(userId);
});
// In views - use AsyncValue for loading/error/data states
ref.watch(feedProvider(userId)).when(
data: (posts) => PostList(posts: posts),
loading: () => const CircularProgressIndicator(),
error: (e, st) => ErrorWidget(e),
);
🔥 Firebase Integration
Firestore, Storage, Analytics, Crashlytics configuration.
Firebase Services
Firestore | NoSQL document database | User profiles, posts, bookings, orders |
Firebase Auth | Authentication | Email/password, Google, Apple sign-in |
Firebase Storage | File/media storage | Profile images, post media, documents |
Analytics | Event tracking | Screen views, user actions, conversions |
Crashlytics | Crash reporting | Real-time crash reports with stack traces |
Security Rules
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth.uid == userId;
}
match /posts/{postId} {
allow read: if request.auth != null;
allow create: if request.auth != null
&& request.resource.data.authorId == request.auth.uid;
allow delete: if resource.data.authorId == request.auth.uid;
}
match /bookings/{bookingId} {
allow read, write: if request.auth != null
&& (resource.data.riderId == request.auth.uid
|| resource.data.driverId == request.auth.uid);
}
match /orders/{orderId} {
allow read, write: if request.auth != null
&& resource.data.userId == request.auth.uid;
}
}
}
Data Model
Firestore Collections
users | User profiles, preferences, followers | Document per user |
posts | Social posts with media refs | Subcollections: comments, likes |
chats | Chat threads | Subcollections: messages |
bookings | Ride bookings | Status updates via Firestore triggers |
destinations | Travel destinations | Cached with offline persistence |
orders | Delivery orders | Real-time status via snapshots |
👥 Social Module
Social networking: profiles, posts, feeds, messaging.