How ruddyp/sleepie-frontend works
Project Type and Purpose
• Sleepie-frontend is a mobile front-end application built in React Native.
• Its purpose is to present screens for discovery, playback, creation, user auth, and settings; manage app state; and communicate with a backend service for content (stories, tracks, user data).
File Structure
Top-level:
• App.js / index.js – app entry point
• app.json, eas.json – Expo/React Native config
• components – reusable UI & feature components (Create, Player, KitUI, SignIn, SignUp…)
• screens – full-screen views (Home, Discover, Favorites, Create, Login, Profil, etc.)
• modules – pure JS utilities, constants, database actions, API wrappers
• reducers – Redux reducers for createForm, modal, stories, track, users
• service.js – REST API client
• sleepTimerStore.js – local state/persistence for timer
• package.json – dependencies
Pull Insights from README
• README simply names the project. The file names and folders confirm a Redux-backed React Native app connecting to external services for media and user data.
Main Components
a. Presentation Layer
• Screens (Home, Discover, Favorites, Create, etc.)
• Reusable Components (KitUI, Player widgets, CreateForm steps, Modals)
b. State Management Layer
• Redux Store (reducers folder)
• Actions & Action Creators (modules/databaseAction.js, modules/utils.js)
• sleepTimerStore (local persistent store)
c. Data Layer / API
• service.js (REST client)
• External Backend Services (Authentication API, Stories API, Tracks API)
d. Assets & Configuration
• assets directory
• app.json / eas.json
Relationships and Interactions
• Screens mount Components → dispatch Redux Actions → pass through Reducers → update Store → mapStateToProps back into Screens/Components.
• service.js calls to External Backend → returns JSON → dispatch success/failure Actions.
• sleepTimerStore manages local timer state for the Player.
Architectural Patterns / Design Principles
• Unidirectional Data Flow (Redux)
• Container vs. Presentational Components (Screens vs. KitUI elements)
• Modularization (modules folder for shared logic, components folder for UI)
• Feature Breakdown (CreateForm is its own sub-feature with steps/Modals)
Technologies/Frameworks to Call Out
• React Native + Expo
• Redux for state management
• REST API client (fetch/axios wrapper in service.js)
• Local storage/persistence (sleepTimerStore)
• React Navigation (implicitly via screens folder)