How shahvir-w/locked-in works
Project Type & Purpose
• The project is a mobile application built using React Native with Expo.
• Its primary purpose is to help users track daily tasks and measure their “Locked In” consistency score by duplicating and managing daily task lists and displaying progress (with options for both light and dark themes).
• The README and file tree emphasize different tabs (habits, info, stats), user authentication (sign-in/sign-up), and integration with Firebase (in configs/FirebaseConfig.js).
File Structure
• Top level directories/files:
• app: Contains main application components, pages (layouts, tabs, auth pages, and screens for tasks and score calculations).
• components: Comprises common UI components (e.g., BarChart, Habit, TabBar, etc.) that are reused across screens.
• assets: Holds fonts and images used in the user interface.
• configs: Contains Firebase configuration for backend integration.
• databaseUtils: Includes helper scripts for interacting with databases (e.g., creating days, finding recent dates).
• The directory structure suggests component-based modular design. Notable is the use of subdirectories under “app” for tabs and authentication flows, indicating a navigational structure likely handled via React Navigation.
a. Mobile Client Core:
• Screens & Pages:
• Main App structure under "app" with separate screens for authentication, tasks, habits, and statistics.
• Tab navigation is evident (tabs, _layout.jsx files), which organizes the app into multiple sections.
• Components:
• UI components from the “components” directory (e.g., charts, list views, habit components, tab bar elements).
• These components are integrated within screens to render visual elements and handle user interactions.
b. Authentication Module:
• The app contains a dedicated “auth” folder with “sign-in” and “sign-up” pages.
• This module is responsible for user session management and likely interacts with Firebase (via configurations and databaseUtils).
c. Data & Business Logic:
• Database Utilities:
• Located in “databaseUtils”, these functions manage data operations (e.g., creating days, querying recent dates).
• They likely interact with Firebase, as indicated by configs/FirebaseConfig.js and FirebaseUtils.js.
• Scoring / Habit Calculation:
• Files like “scoreCalculationExp.jsx” show that task completion and scoring logic are important and encapsulated within dedicated scripts.
d. External Services & Configurations:
• Firebase Service:
• The “configs/FirebaseConfig.js” file sets up Firebase for database operations, authentication, and possibly analytics.
• Expo Environment:
• Related files such as “app.json”, “eas.json”, and the Expo CLI setup indicate that the app is built and deployed via Expo.
Architectural Patterns & Design Principles
• Component-Based Architecture:
• The separation of concerns is evident through distinct directories: views/screens (app), reusable components, and utility functions.
• Modular Organization:
• Separation between UI components, data handling, and configuration promotes maintainability.
• Navigation & Layout:
• The use of “_layout.jsx” files in multiple directories highlights a common pattern for consistent layout and navigation across different sections.
• The focus on mobile UX, routing (tabs and auth flows), and dependency management ensures the design remains scalable.