How sahildevil/horizonwalls works
Overall Project Type and Purpose
• Horizon Walls is a cross-platform wallpaper discovery app built using React Native. Its purpose is to allow users to browse and download high-quality wallpapers.
• In addition to the mobile client, the broader ecosystem includes a backend (built with Node.js, Express, and MongoDB) for data storage and API operations, as well as a Next.js-based admin panel for managing content. External services (Google OAuth for authentication and Google AdMob for monetization) are also integrated.
File Structure
• The mobile app repository (which you’re looking at) contains both native Android code (in the “android” folder) and JavaScript/JSX/TSX files for the React Native application (under “app”, “components”, “providers”, “services”, etc.).
• The “app” folder shows multiple subdirectories, including tabs (for different sections like Categories, Favs, etc.), static pages (AboutUs, ContactUs), various screens (like login and search), and a layout file. This indicates a modular, component-driven architecture.
• Directories like “assets” (for fonts and images) and “config” (for theme, fonts, mobile ads, etc.) reflect the app’s focus on UI and external service configuration.
• Supporting folders such as “providers” and “services” indicate context management (e.g., authentication and theme contexts) and API integrations, respectively.
Information from the README
• The README details the tech stack: a React Native frontend, native mobile code for Android (within the repository) plus a separate backend and admin panel hosted on different repositories.
• It specifies key features (Google OAuth 2.0 for authentication, a NextAuth-secured admin panel, and Google AdMob monetization) and even provides separate setup and install instructions for each component, which suggests distinct subsystems interacting with each other.
Components
a. Main Mobile Client (React Native App):
• React Native application, which includes:
• User Interface layer based on screens (e.g., Categories, Favs, Login, Search, AboutUs, ContactUs) found in the “app” folder.
• Reusable components (e.g., category cards, headers, image cards) from the “components” directory.
• Context management providers (authentication, theme, scroll context) from the “providers” folder.
• Utility modules and services (API integrations, helper functions) that connect to external data.
• Native integration details (Android code under “android”) which may include platform-specific implementations.
b. Backend Server (External Repository):
• Even though not in the file tree here, indicate that this mobile client communicates with a backend built on Node.js/Express, which handles:
• API endpoints for retrieving wallpaper data.
• User authentication (potentially integrating with Google OAuth).
• Database operations using MongoDB.
c. Admin Panel (Separate Repository):
• Admin panel built with Next.js and styled with Tailwind CSS. It uses NextAuth for protected access and is used for content management.
d. External Services:
• Google OAuth 2.0 for authentication.
• Google AdMob for monetization.
• Possibly other services, such as Appwrite (as seen in the “services/appwrite.js”) if used for additional backend functionality or synchronization.
Relationships and Data Flow
• The React Native front-end (mobile client) interacts with the backend via RESTful API calls (and possibly GraphQL if used).
• The mobile client uses external OAuth for authentication and then communicates user credentials to the backend.
• The mobile client receives configuration details (like mobile ads) via the “config” and “providers” modules.
• The admin panel interacts with the backend to manage and update wallpaper content.
• External monetization (Google AdMob) injects ads into the mobile client’s UI.
Architectural Patterns and Design Principles
• Componentization: separate modules for UI (screens, components) and logic (providers, services, utils).
• A clear separation between the mobile app’s presentation layer and the backend data/API layer.
• Use of cross-platform development (React Native) combined with native code (Android folder) to leverage platform-specific functionalities.
• Integration pattern with external authentication and monetization services.
Final Steps
• Subdivide the mobile client block to show internal modules such as views (tabs, screens), components, providers, and configuration.