How odtboun/simple-flashcard-app works
Project Type & Purpose
• This is a mobile flashcard app built with React Native and Expo that leverages a custom spaced repetition algorithm to aid learning.
• It employs React Navigation for screen management and AsyncStorage for local persistence, while also integrating with a backend using Supabase (with migration scripts provided in the “supabase” directory).
Main Components
a. User Interface (UI):
• Mobile Screens: Represent the various screens found in “src/screens” (e.g., HomeScreen, AuthScreen, DeckListScreen, ReviewSessionScreen).
• UI Components: Include reusable components from “src/components” like Flashcard.js.
• Navigation: Mark the integration of React Navigation to move among screens.
b. State and Context Management:
c. Business Logic & Services:
• Services: Separate components such as “cardService.js”, “deckService.js”, “fsrsService.js”, and “userService.js” that encapsulate business logic and API interactions.
• Custom Utilities: Highlight the “spacedRepetition.js” in “src/utils” responsible for implementing the spaced repetition algorithm, and “theme.js” for UI theming.
d. Data Layer / Backend Integration:
• Supabase Integration: Indicate the connection via “src/lib/supabase.js”—this module likely handles API calls to the Supabase backend.
• Database: Outline the Supabase database with migration files (in the “supabase/migrations” directory) that set up tables like decks, cards, profiles, etc.
e. Configuration & Deployment:
• Project configuration files (babel.config.js, app.json, tsconfig.json) can be noted as supporting files for app setup.
• The “index.js” and “App.js” files act as bootstrap entry points linking all components.
Relationship and Interactions
• Connections from the screens to the service layer. The service layer, in turn, communicates with:
◦ Local persistence (AsyncStorage) for caching or offline support.
◦ The Supabase backend via “src/lib/supabase.js” for remote data operations.
Architectural Patterns & Design Principles
• That the app follows a separation of concerns: UI presentation (screens/components), business logic (services and utilities), and state management (contexts).
• Mention the use of hooks and custom logic for spaced repetition as a key feature.
• Optionally, note that the project embraces a modular design, where each domain (authentication, flashcards, reviews) is encapsulated in its own module.