How serenbeam/ai-grammar-checker works
O’ Grammar Checker is a React Native app for AI grammar correction. The main flow is Check Screen → grammar hook → grammar service → OpenRouter API, with results held in the grammar store and successful checks added to history. History and Settings are separate product branches; the README documents persisted history and a settings interface. Several service and screen internals were not sampled, so uncertain persistence wiring is shown as unverified rather than asserted.
Main entry points: CheckScreen.tsx Check Screen · BottomTabNavigator.tsx Bottom Tabs · useGrammar.ts Grammar Hook · useHistory.ts History Hook
Components 27
App and Navigation
- App Entry
App.tsx - App Navigator
src/navigation/AppNavigator.tsx - Bottom Tabs
src/navigation/BottomTabNavigator.tsx - Screen Container
src/components/navigation/SreenContainer/SreenContainer.tsx - Custom Header
src/components/navigation/CustomHeader/CustomHeader.tsx
Grammar Checking
- Check Screen
src/screens/Check/CheckScreen.tsx - Check Sections
src/screens/Check/components - Check Screen Styles
src/screens/Check/CheckScreen.styles.ts - Grammar Hook
src/hooks/useGrammar.ts - Grammar State
src/store/grammar.store.ts - Grammar Service
src/services/grammar.services.ts - API Client
src/services/api.services.ts - Result Card
src/components/common/ResultCard/ResultCard.styles.ts
History and Storage
- History Screen
src/screens/History/HistoryScreen.tsx - History Hook
src/hooks/useHistory.ts - History State
src/store/history.store.ts - History Service
src/services/history.services.ts - Local Storage
src/services/storage.services.ts - History List
src/screens/History/components/HistoryList/HistoryList.tsx
Settings and Shared UI
- Settings Screen
src/screens/Settings/SettingsScreen.tsx - Theme Section
src/screens/Settings/components/ThemeSection/ThemeSection.tsx - About Section
src/screens/Settings/components/AboutSection/AboutSection.tsx - Settings State
src/store/settings.store.ts - Theme Hook
src/hooks/useTheme.ts - Shared UI Controls
src/components/common/Button/Button.styles.ts
Other components
- App User
- OpenRouter API
Connections 24
- App User → App Entry: opens
README.md - App Entry → App Navigator: renders
App.tsx - App Navigator → Bottom Tabs: routes to
src/navigation/AppNavigator.tsx - Bottom Tabs → Check Screen: routes to
src/navigation/BottomTabNavigator.tsx - Bottom Tabs → History Screen: routes to
src/navigation/BottomTabNavigator.tsx - Bottom Tabs → Settings Screen: routes to
src/navigation/BottomTabNavigator.tsx - Check Screen → Grammar Hook: uses
src/screens/Check/CheckScreen.tsx - Check Screen → Check Sections: renders
src/screens/Check/CheckScreen.tsx - Check Screen → Check Screen Styles: uses
src/screens/Check/CheckScreen.tsx - Grammar Hook → Grammar State: reads and updates
src/hooks/useGrammar.ts - Grammar Hook → Grammar Service: requests check
src/hooks/useGrammar.ts - Grammar Hook → History Hook: adds result
src/hooks/useGrammar.ts - Grammar Service → API Client: sends request
src/services/grammar.services.ts - API Client → OpenRouter API: HTTP request
README.md - History Screen → History Hook: reads history
src/screens/History/HistoryScreen.tsx - History Screen → History List: renders
src/screens/History/HistoryScreen.tsx - History Hook → History State: reads and updates
src/hooks/useHistory.ts - History Hook → History Service: persists changes
src/hooks/useHistory.ts - History Service → Local Storage: uses storage
- Settings Screen → Theme Section: renders
src/screens/Settings/SettingsScreen.tsx - Settings Screen → About Section: renders
src/screens/Settings/SettingsScreen.tsx - Theme Section → Theme Hook: uses
src/screens/Settings/components/ThemeSection/ThemeSection.tsx - Theme Hook → Settings State: reads state
src/hooks/useTheme.ts - Check Screen → Screen Container: renders
src/screens/Check/CheckScreen.tsx