React Native Mobile App Plan
May 14, 2026 ยท View on GitHub
This document outlines the architecture and implementation strategy for the MLM Mobile Application using the Genelet-powered backend.
1. Technical Stack
- Framework: React Native (Expo)
- Navigation: React Navigation 6.x
- Networking: Axios with
withCredentials: true(for cookie persistence) - State Management: Zustand (lightweight auth and global state)
- UI Components: React Native Paper (Material Design)
2. API Integration
The app communicates with the backend using the structure:
https://{domain}/cgi-bin/goto/{ROLE}/json/{COMPONENT}?action={ACTION}
Authenticated JSON responses include a CSRF token at relationships.csrf. Store the latest token for each signed-in role and include it as a csrf form field on mutating POST requests such as buying, changing profile defaults, changing passwords, replying to tickets, and admin compensation runs.
Authentication Flow
- Login:
POST /m/json/member- Body:
login,passwd - Strategy: Server returns a
Set-Cookieheader with thecmsession token.
- Body:
- Logout:
GET /m/json/logout- Clears session and redirects to landing.
3. Screen Roadmap
Public Flow (Role: p)
- Landing Page:
- Endpoint:
GET /p/json/member?action=startnew - Purpose: Display welcome message and introductory package data.
- Endpoint:
- Sign Up:
- Endpoint:
POST /p/json/signup?action=insert - Fields:
sidlogin,login,passwd,email,firstname,lastname,packageid.
- Endpoint:
- Sign In:
- Standard login form targeting the Member role issuer.
Member Flow (Role: m)
- Category Browser:
- Endpoint:
GET /m/json/category?action=topics - Displays list of product categories available for the member.
- Endpoint:
- Product Gallery:
- Endpoint:
GET /m/json/gallery?action=topics&categoryid={id} - Fetches products specific to the selected category.
- Endpoint:
- Dashboard:
- Endpoint:
GET /m/json/member?action=dashboard - Displays user profile and business statistics.
- Endpoint:
- Basket Checkout:
- Endpoint:
POST /m/json/sale?action=buy - Requires the latest member CSRF token.
- Endpoint:
4. Implementation Steps
- Scaffold: Initialize Expo project and install dependencies.
- Auth Provider: Create a secure wrapper to handle session cookies and persistence using
expo-secure-store. - Navigation: Setup
Switchnavigation betweenAuthStack(Public) andAppStack(Member). - Data Fetching: Implement custom hooks for
useCategoriesanduseProducts. - Polishing: Add pull-to-refresh and loading skeletons.