========================================
I ask you to analyze the requirements brief and pay
attention to the points indicated in section 10:
Approximate questions for the contractor's assessment
========================================
1. General Information
Goal: A mobile application for deep communication with ChatGPT (OpenAI) focusing on the development of "non-linear thinking" (cognitive trainer).
If the described information seems unclear, in the first iteration the target is the AppStore.
Main Features
No own backend: using Firebase Functions as an intermediary server for creating and processing prompts to the OpenAI API, storing the key, controlling token limits, creating context from previous messages) Also controlling subscriptions.
Data storage: Firebase (Authentication, Firestore/Realtime DB).
Authorization: Firebase Auth (Google/Apple).
Subscription: via RevenueCat (monthly/yearly).
2. Technology Stack
Framework: Flutter (Dart) or React Native (TypeScript/JavaScript).
Firebase:
Auth (Google, Apple, Email)
Firestore / Realtime DB (storing chat history, profiles)
Firebase Functions (proxy to OpenAI, subscription/limit checking logic)
Firebase Remote Config (if needed - dynamic settings)
OpenAI API: GPT-3.5-Turbo / GPT-4 (requests via Functions).
RevenueCat: subscription management (App Store).
Platform: iOS 13+ (initially).
3. Core Functionality
3.1 Onboarding and Demo Mode
Animated Logo (Animation will be created and provided separately)
Welcome screen, 3-5 "intro" slides describing the benefits.
Onboarding with interest selection (5-6 screens, checkboxes). Data is stored locally or in Firebase (for anonymous users). Onboarding triggers a Firebase Function to start a Demo chat based on the data obtained during onboarding.
Demo chat (up to 10 free messages): ChatGPT sends the first message, in response a limited number can be sent (up to 8-10 messages).
Paywall after the demo limit is exhausted: an offer to subscribe.
Registration after subscribing.
3.2 Chat (ChatGPT analog)
Dialogue feed (user/assistant).
Chat history in a list (ability to create new and delete).
Message limits (daily limit) in the paid subscription up to 300 per day.
System prompt (set on the Functions side) for "non-linear" response style.
The context of the last N messages is also sent to OpenAI, either up to 15 messages or up to the token limit, 4000 for GPT 3.5 turbo seems
3.3 User Profile
View/edit email and onboarding data (interests).
Information about the current subscription (RevenueCat).
Log out of the account, delete data (GDPR).
3.4 Additional Screens
Feedback / Rating: a short questionnaire about impressions.
FAQ / Support: answers to frequently asked questions.
About us / Policies: legal documents (privacy, agreement).
Social media: links to social media (if available).
4. Subscription and Monetization
RevenueCat:
Limit logic:
Store counter in Firebase (dailyMessageCount).
In Functions, check subscription status and limits before each request. (Or a more optimal way, if you know)
5. Data Architecture (Firestore)
/users/{userId}
email, subscriptionStatus, onboardingInterests, dailyMessageCount, lastMessageDate, etc.
/users/{userId}/conversations/{conversationId}
/users/{userId}/conversations/{conversationId}/messages/{messageId}
Chat history is stored in subcollections Messages. For demo mode, it can be stored locally or in an anonymous account.
6. Firebase Functions (proxy logic to OpenAI)
Receiving requests from the client (message text, chat identifier).
Authorization check (Firebase Auth) and subscription status (RevenueCat).
System prompt (set on the Functions side) for "non-linear" response style.
Forming context for OpenAI:
System prompt + last N messages from Firestore.
User interests/settings from onboarding.
Token limit control to stay within the limits allowed by the OpenAI model
Calling OpenAI (GPT-3.5 / GPT-4), receiving a response.
Saving the response (assistant) in Firestore.
Limit accounting: daily counter, updated by UTC, token count, etc.
The OpenAI key is stored in the Firebase Functions environment or Remote Config, not passed to the client.
7. Approximate Development Stages (MVP approach)
Stage 1. Project Setup
Initialization of Flutter / React Native.
Setting up Firebase (Auth, Firestore, Functions).
Basic navigation, “skeleton” of the application.
Stage 2. Onboarding and Authorization
Screens with info slides, checkboxes.
Anonymous or regular login (Google/Apple).
Saving onboarding data in Firestore.
Stage 3. Chat and Integration with OpenAI
Implementation of chat interface: chat list, message feed.
Firebase Functions proxy to OpenAI.
Storing history in Firestore, real-time updates (if needed).
Stage 4. Subscription (RevenueCat), Paywall, Limits
Setting up products (monthly / yearly).
Logic “demo chat then paywall to buy premium” (number of messages, status check).
Paywall screen and subscription upgrade scenario.
Stage 5. Profile, Settings, GDPR
View/edit profile, “Log out” button.
Account deletion (from Firebase Auth and Firestore).
“Feedback”, “FAQ” screen, etc.
Stage 6. Testing and Release
Checking scenarios (login, chat, subscription, deletion).
Publishing in the App Store.
(If needed — Stage 7: Additional thinking modes, “insight journal”, localization, etc.)
[Screen recordings as they are ready - recordings.]
8. Approximate Acceptance Criteria (MVP)
Onboarding:
a) Logo
b) Info slider
c) Onboarding survey (collect data -> sent to Function to launch demo chat)
d) demo mode logic works (up to 8 chat responses and 8 messages from chat) + Paywall after limit.
Chat: sending and receiving responses from GPT; history is stored in Firebase.
Subscription accounting: when paying through RevenueCat, “premium” is displayed in Firebase, limits are removed.
Profile: editing data, viewing subscription status, account deletion.
Security: no “leakage” of the OpenAI key, everything works through Functions.
Stability: offline mode shows old messages, no app crashes.
9. Design and UI/UX
Basic layout for iPhone SE (750×1334), iPhone 12–15 (1170×2532), iPhone 15 Pro Max (1290×2796).
Style: minimalist, with animations for loading GPT responses.
Figma/Prototype: Figma mockups are provided in their own style using the Cupertino UI kit. There will be an opportunity to communicate with the UI/UX designer if there is a need to change, correct, etc.
10. Approximate Questions for the Contractor's Assessment
Duration of MVP implementation (including Firebase setup, RevenueCat, basic chat, deploy to AppStore).
The most accurate price possible, for which the contractor is ready to develop the described application. Should include QA, i.e., bringing it to a working state, code and certificate transfer, publication on the AppStore.
Has there been experience with OpenAI API, Firebase Functions, RevenueCat, to consider Potential risks: OpenAI limits, App Store rules, GDPR.
Further support: update conditions, bug fixes, and scaling.