How mshivam019/storysail works
Project Type and Purpose
• Story Sail is a mobile application built with Expo and React Native. Its purpose is to allow users to explore captivating stories across various genres.
• The README emphasizes features like notifications, rich text editing, swipeable tabs, sortable lists, deep linking, and integration with Supabase and FCM. This indicates a full-featured mobile front-end that communicates with a backend (Supabase) and uses third-party services (Firebase for notifications).
File Structure
• The top-level directories include:
• app: Contains the routing structure, layout files, and screen components (organized as tabs for account, create, explore, favourites, and home).
• assets: Contains static files such as images and JSON used for onboarding and home data.
• components: Provides reusable UI elements for various screens (Create, Explore, Favourites, Home, Onboarding, Settings, etc.).
• provider: Hosts the AuthProvider, which likely manages user authentication states.
• store: Houses state management files (stores for home, notifications, user data, writings, etc.), suggesting a clear separation of presentation and state logic.
• lib: Contains service configuration such as the Supabase connection.
• supabase: Contains backend configuration, functions (like push notifications), migrations, and seeds.
• utils: Contains custom hooks like useHaptic and other utility methods.
• Additional configuration files (e.g., .env.local.example, babel.config.js, tsconfig.json) indicate a standard mobile project setup with environment management, linting, and TypeScript support.
a. Frontend (Mobile Client):
• Expo/React Native App:
• UI Components: Group components by category (e.g., Home cards, Create components like RichEditor and DynamicInput, Onboarding components, etc.).
• Routing and Layouts: Display the hierarchy where higher-level layout components (_layout.tsx files) wrap the child routes.
b. Backend & External Services:
• Supabase Backend:
• Database and API: Represent Supabase as the primary backend service (drawing connections between the mobile client and Supabase), touching upon migrations, seed data, and connection handling via lib/supabase.ts.
• Functions: Indicate the push notification function in supabase/functions/push.
• Firebase Cloud Messaging (FCM):
• External Notification Service: Show how FCM integrates with Supabase and the mobile client (for in-app notifications).
c. Architectural Interactions:
• Data Flow:
• Architectural Patterns:
• Separation of Concerns: Distinction between UI (components/screens), business logic/state (store, providers), and backend integration (lib & supabase).
• Modular Routing: The use of multiple layouts and tabs for organizing different features.
• Dependency Injection: Usage of providers (like AuthProvider) to make authentication and related state available globally.
Additional Details to Capture
• In the mobile client section, differentiate between presentation (UI components under app, assets and components directories) and application logic (store and provider directories).
• Routing structure based on the file tree structure under the “app” folder (e.g., tab-based navigation that distinguishes between account, create, explore, favourites, and home).
• Integration points for third-party setups. For instance, mention that environment variables (from .env files) and configuration files (such as google-services.json) are vital when connecting to FCM and Supabase.
• That the Supabase folder is not just a library but also includes database migrations and functions meant to support the mobile app’s functionality.