How gaonuk/nopti works
Project type and purpose
• This is a cross-platform mobile (iOS, Android) and web application built with Expo and React Native, using the Expo Router’s file-based routing.
• It includes a client UI layer, local assets, shared components/hooks, API endpoints under api/, and backend business logic implemented as serverless functions in functions/.
• The app’s primary feature set appears to center on conversational or content services (chat, media, ranking, JSON updates).
File structure
Top-level directories and meaning:
• app/ – Frontend screens and routing (tabs like conversation, explore, media).
• components/ – Reusable UI building blocks (ThemedText/View, ParallaxScrollView).
• hooks/ – Custom React hooks encapsulating data-fetching and theming logic (useChatService, useUserContent).
• api/ – File-based API route(s) (contentService.tsx) exposed by Expo Router.
• functions/ – Independent serverless functions (generateResponse.ts, rankContent.ts, updateJson.ts) that power core backend operations.
• assets/ – Static resources (fonts, images, binary tokenizer model).
• ios/, babel.config.js, metro.config.js, eas.json – Build and deployment configuration for Expo/EAS and the Metro bundler.
README for additional insights
• No mention of a separate database—likely JSON files or external LLM APIs invoked by serverless functions.
a. Main components:
1. Client (Mobile & Web):
– Expo App & Expo Go / Standalone build
– UI Screens & Navigation (app/(tabs)/…)
– Shared Components & Hooks
– Local Asset Store (fonts, images, tokenizer.bin)
2. API Layer:
– Expo Router API Endpoint (api/contentService.tsx)
3. Backend Functions:
– Serverless Functions (functions/generateResponse, rankContent, updateJson)
4. External Services / Data Stores:
– Optional JSON store (if updateJson writes to a file or cloud storage)
– External LLM or ranking API (e.g. OpenAI, custom ML)
b. Relationships & interactions:
1. User interacts with the UI (e.g. submits a chat prompt).
2. UI hook (useChatService) sends HTTP request to API Layer (/api/contentService).
3. API layer orchestrates calls to serverless functions in sequence:
• generateResponse → calls external LLM service
• rankContent → orders or filters responses
• updateJson → persists conversation updates
4. API returns enriched content back to the client.
5. Client updates its state and renders the result.
c. Architectural patterns & principles:
• File-based routing (Expo Router) for both views and API endpoints.
• Separation of concerns: UI layer vs data layer vs business logic.
• Serverless microservices for on-demand scalability.
• React hooks to encapsulate data-fetching and theming.
• Asset bundling via Metro and Expo’s asset pipeline.
d. Key technologies & libraries:
• Expo & React Native for cross-platform UI
• Expo Router for file-based routing (screens & API)
• Serverless functions (Node/TypeScript)
• Custom hooks (useChatService, useUserContent)
• Metro bundler & EAS for building and deployment