Internal technical documentation

TheSyn AITheSyn AI

Academic Research Engine — Index Page, Mode Catalogue and Credit System Reference.

Bubble app
malikk1200k-77275
Proxy
thesyn-proxy.onrender.com
Document type
Index Page
Last updated
19 July 2026
§ 0

Contents

  1. 1System overview
  2. 1.1The three pieces
  3. 1.2Why the architecture is asynchronous
  4. 2Anatomy of the index page
  5. 2.1Left sidebar
  6. 2.2Header
  7. 2.3Main column
  8. 2.4Element and group names
  9. 3The dropdown system
  10. 3.1The chain
  11. 3.2How each dropdown is configured
  12. 3.3Attributes carried by every mode
  13. 4Categories and subcategories
  14. 4.1The five categories
  15. 4.2Subcategories
  16. 5Mode catalogue and credit costs
  17. 5.1Single sections and chapters
  18. 5.2Proposals
  19. 5.3Full articles
  20. 5.4Humanised articles
  21. 5.5Data-analysis articles
  22. 5.6Full thesis
  23. 5.7Humanisation tools
  24. 6How the credit system works
  25. 6.1Where the balance lives
  26. 6.2The full lifecycle
  27. 6.3Spending credits
  28. 6.4Credit packages
  29. 6.5Displaying costs without maintenance
  30. 7Conditional input fields
  31. 8The generation flow, step by step
  32. 9The output surface
  33. 10Open items
§ 1

System overview

TheSyn AI is an academic writing platform for nursing, medical and health-science students and researchers. The index page is the workspace: the single screen where a user selects what they want written, supplies the inputs it needs, spends credits, and receives a finished Word document.

1.1The three pieces

LayerTechnologyResponsibility
Front endBubble.ioPages, dropdowns, conditional fields, workflows, user accounts, credit balance, chat history
ProxyNode.js on RenderPrompt library, Claude API calls, Python statistical analysis, Ryne humanisation, Word document assembly
ModelAnthropic Claude APIAll text generation and reference research

Nothing about the writing lives in Bubble. Bubble collects inputs and sends a mode key; the proxy holds every prompt and decides what to do with that key. This separation is why a new mode can be added to Bubble in two minutes but still needs a proxy edit before it will actually generate anything.

1.2Why the architecture is asynchronous

A full article takes several minutes. A full BSc thesis makes seventeen sequential API calls. Bubble's API Connector times out long before either finishes, so the system never waits for a result.

Instead the submit workflow fires the request and returns immediately. The proxy works in the background and, when finished, calls back into a Bubble backend workflow with the finished text. The page watches the chat record's status field and updates itself. The user can close the tab and come back.

The single most important consequence
Credits are deducted by the callback, not by the submit button. If a generation fails, the callback arrives with status error and the deduction step is skipped. The user is never charged for output they did not receive.
§ 2

Anatomy of the index page

The page divides into three zones: a fixed navy sidebar, a header bar, and the main working column.

2.1Left sidebar

ElementBehaviour
+ New ChatGold button. Clears current_chat and resets the composer to its empty state.
Recent ChatsRepeating Group, type Chat. Data source: Search for Chats where Created By = Current User, sorted by Created Date descending. Each cell shows the chat title and reopens that generation on click.
Credits cardPinned to the bottom. Shows Current User's credit_balance live, an Active badge, and a Buy More Credits button linking to the credits page.

2.2Header

A reusable element, so it appears identically on every page. Navy background, two-pixel gold bottom border, cream text. Contains the wordmark, a Credits link, and Log Out. The Credits link matters on mobile, where the sidebar is hidden and it becomes the only route to buying credits.

2.3Main column

Cream canvas. From top to bottom:

  • Hero band — icon, heading "Transform ideas into publication-ready research", gold rule, subtitle, Support button
  • Document surface — appears only when a generation exists; carries the reading toolbar and the Download as Word button
  • Composer card — the form, always present
  • Status elements — loading text, error text, low-credit warning; each shown by condition

2.4Element and group names

Useful when writing conditions or briefing the Bubble AI Agent.

NameWhat it is
Group chat-mainThe whole main column. Background must be cream #F6F5EF.
Group chat-toolbarHero band row — icon, titles, logo, Support.
Group chat-thread-sectionWrapper for the generated output. Visible when current_chat is not empty.
Group chat-composer-sectionOuter composer container. Max width 1150, centred.
Group chat-composer-wrapIntermediate wrapper.
Group chat-composerThe white composer card itself.
Group composer-mode-rowColumn holding the three step blocks and the cost row.
Group composer-cost-wrapThe cream cost row. Row layout, space-between.
Dropdown composer-categoryStep 1.
Dropdown composer-subcategoryStep 2.
Dropdown composer-modeStep 3.
Button composer-submitGenerate.
Button composer-clearClear.
Button download-wordDownload as Word.
Text index's current_chatThe generated document text.
§ 4

Categories and subcategories

4.1The five categories

CategoryContainsTypical user
Article GenerationQuantitative, qualitative, mixed-methods and journal-formatted articles, reviewer responses, data-analysis variantsResearcher preparing a manuscript
Article Generation (Humanized)The six humanised article modes, routed through Ryne after writingResearcher concerned about AI detection
Thesis BScBachelor's chapters, bachelor proposals, and the full BSc thesisUndergraduate nursing student
Thesis PostgraduateMSc and PhD chapters and proposalsPostgraduate student
Academic Humanization ToolsStandalone humaniser and AI detection reportAnyone with existing text

4.2Subcategories

Subcategories exist mainly inside Article Generation, where the mode count is highest. They split the list by study design before the user ever sees mode names.

  • Quantitative
  • Qualitative
  • Mixed methods
  • Review articles
  • Reviewer response

Thesis categories are split by chapter rather than design, and the two humanisation tools sit in a category with no meaningful subcategory division.

§ 5

Mode catalogue and credit costs

Verify before publishing
Pricing on this platform has been revised several times — an early flat rate of 15 credits, then per-mode pricing, then premium tiers for humanised and data-analysis modes. The figures below reflect the values recorded across build sessions, but the WritingMode option set in Bubble is the only authoritative source. Open Data → Option sets → WritingMode and confirm each credits_cost before quoting these numbers publicly. Any mismatch between this table, the landing page, the credits page and the option set means a user is quoted one price and charged another.

5.1Single sections and chapters

Modenode_keyCredits
Introduction (Bachelor's)intro_bachelor7 cr
Introduction (Postgraduate)intro_postgrad7 cr
Literature Review (Bachelor's)lit_bachelor10 cr
Literature Review (Postgraduate)lit_postgrad10 cr
Methods (Bachelor's)methods_bachelor10 cr
Methods (Postgraduate)methods_postgrad10 cr
Results (Bachelor's)results_bachelor10 cr
Results (Postgraduate)results_postgrad10 cr
Discussion (Bachelor's)discussion_bachelor10 cr
Discussion (Postgraduate)discussion_postgrad10 cr

5.2Proposals

Modenode_keyCredits
Proposal (Bachelor's)proposal_bachelor15 cr
Proposal (PhD / Masters)proposal_phd15 cr
Advanced Proposal (Bachelor's)advanced_proposal_bachelor20 cr
Advanced Proposal (PhD / MSc)advanced_proposal_phd20 cr

5.3Full articles

Modenode_keyCredits
Full Article (Quantitative)full_article_quant15 cr
Full Article (Qualitative)full_article_qual15 cr
Full Article (Mixed Methods)full_article_mixed15 cr
Full Article (Mixed) — journal formattedfull_article_mixed_journal20 cr
Reviewer Responsereviewer_response8 cr

5.4Humanised articles

These run the normal writing pipeline, then pass each section through Ryne for academic humanisation before assembly. The higher price reflects the extra API calls.

Modenode_keyCredits
Full Article (Quantitative) — Humanizedfull_article_quant_humanized20 cr
Full Article (Qualitative) — Humanizedfull_article_qual_humanized20 cr
Full Article (Mixed) — Humanizedfull_article_mixed_humanized20 cr
Introduction — Humanizedintro_humanized12 cr
Literature Review — Humanizedlit_humanized15 cr
Discussion — Humanizeddiscussion_humanized15 cr

5.5Data-analysis articles

Twelve variants. The user uploads a CSV or Excel file; the proxy runs real statistical computation in Python (pandas, scipy, statsmodels) through Anthropic's code execution tool, then writes the article around genuine tables.

Mode familynode_key patternCredits
Quantitative — analyse my data*_analyze_quant30 cr
Qualitative — analyse my data*_analyze_qual30 cr
Mixed methods — analyse my data*_analyze_mixed30 cr
Postgraduate data analysis (20+ tables)data_analysis_postgrad30 cr

5.6Full thesis

Modenode_keyCredits
Full Thesis (Bachelor's) — humanisedthesis_bsc_full_humanized75 cr

Seventeen sequential API calls. Produces title page, Quran verse page, certification, dedication, acknowledgement, abstract, live Word table-of-contents field, abbreviations list, all chapters written then revised then humanised, Python data analysis, and full assembly. Currently hidden in Bubble pending a fix to the Discussion chapter length.

5.7Humanisation tools

Modenode_keyCredits
Academic Humanizer (up to 250 words)humanize_text1 cr
AI Detection Report (up to 1,000 words)ai_detect1 cr

The humaniser is offered free for a limited period as the acquisition hook for the advertising campaign. Registration is still required, which is the point — it captures the account.

§ 6

How the credit system works

6.1Where the balance lives

A single number field, credit_balance, on the Bubble User data type. Every part of the system reads or writes that one field.

6.2The full lifecycle

1User opens the credits page and chooses a package.
2Bubble calls the proxy's /create-payment endpoint with user_id and package.
3The proxy creates a Transaction record with status pending and returns a NASS gateway URL.
4The user pays on the NASS gateway.
5NASS calls back to the proxy, which forwards to Bubble's receive_payment backend workflow.
6Step 1 finds the Transaction where order_id matches AND status = pending. The pending constraint is the double-credit protection — a repeated callback finds nothing and does nothing.
7Step 2 adds credits_amount to the buyer's credit_balance, but only when payment_status is success.
8The user returns to the app with a higher balance.

6.3Spending credits

Two separate mechanisms, and they must agree with each other.

The gate — before generation

Pre-flight check

Steps 3 and 4 of the submit workflow check the balance and, if it is too low, show Group chat-low-credits and terminate before any API call is made.

The deduction — after generation

Callback subtracts

The receive_generation backend workflow subtracts the writing mode's credits_cost from the user's balance, conditional on status being done.

Open defect — check this before launch
The gate in Steps 3 and 4 compares the balance against a fixed value of 7. Modes now cost up to 75. A user holding 20 credits passes the gate, reaches the proxy call, and triggers a generation they cannot pay for. The comparison must be against Dropdown composer-mode's value's credits_cost, not a literal. Until it is, every high-credit mode is a money leak.

6.4Credit packages

PackageCreditsPrice (IQD)Per credit
Starter25 cr44,0001,760
Standard70 cr90,0001,286
Premium130 cr151,0001,162

Converted at roughly 1,520 IQD to the dollar. The real saving of Standard over Starter is about 19 per cent, and Premium about 21 per cent — not the 25 and 33 per cent that appeared on earlier versions of the credits page. Academics do the arithmetic; overstated savings read as dishonest.

6.5Displaying costs without maintenance

The credits page cost table should be a Repeating Group bound to All WritingMode, showing each option's Display and credits_cost. Built that way it can never go stale: adding a mode in Bubble makes it appear on the pricing page automatically. Hard-coded rows guarantee the page will be wrong within a month.

§ 7

Conditional input fields

The composer is adaptive. Once a mode is chosen, only the inputs that mode needs appear. Each field sits inside its own wrapper group with a visibility condition keyed to the selected mode's node_key.

FieldTypeUsed by
Title of the studytextEvery mode except the humanisation tools
Method detailslong textMethods, results, discussion, full articles, thesis
Supervisor nametextProposals and thesis
Student name(s)textProposals and thesis
DepartmenttextProposals and thesis
University nametextProposals and thesis
Year of studytextFull thesis
Place of data collectiontextProposals, results, thesis
Author detailslong textArticle modes
Journal guidelinespaste boxJournal-formatted article modes
Additional info / scoringlong textData-analysis modes
Upload — university logofileFull thesis
Upload — university guidelinesfileAdvanced proposals, thesis
Upload — questionnairefileData-analysis modes
Upload — data file (CSV / Excel)fileAll data-analysis modes
Source text paste boxlong textHumanizer and AI detection only
Two rules that keep this working
First: file uploaders must have "Make this file private" unchecked, or the proxy cannot download the file and silently skips it. Second: every user-supplied text parameter must pass through Bubble's "formatted as JSON-safe" operator in the API call, or a curly quote in a reviewer comment will break the JSON body and return HTTP 400.
§ 8

The generation flow, step by step

8.1Submit — Button composer-submit is clicked

StepActionCondition
1Show Group chat-error-msgMode empty, or title empty, or source text empty
2Terminate this workflowSame condition as step 1
3Show Group chat-low-creditsBalance below threshold — see defect in 6.3
4Terminate this workflowSame condition as step 3
5Set state is_generating on indexAlways
6Create a new Chat, status "generating"Always
7AI Detection Report branchnode_key is ai_detect
8Humanized Text branchnode_key is humanize_text
9TheSyn Proxy — Generate via ProxyAlways
10Set state current_chat on indexAlways

8.2The proxy call

Step 9 sends a POST to the /generate endpoint carrying the mode key, all populated input fields, any file URLs, and the chat_id. Authentication is a shared secret header.

POST  https://thesyn-proxy.onrender.com/generate
Header:  x-thesyn-secret
Body:    mode, title, method, file_url, chat_id, ...

The secret header was added after unauthorised direct hits on the endpoint were discovered consuming API budget. Without it the request is rejected.

8.3Background work in the proxy

  • Resolve the node_key to a prompt in the PROMPTS object
  • For reference modes, run a web-search call first to gather verified sources
  • For data modes, download the file and run Python statistics through the code execution tool
  • Call Claude to write, then for some modes call again to revise
  • For humanised modes, pass each section through Ryne
  • Build the .docx through generateWordDoc and encode it as base64

8.4The callback

The proxy POSTs to Bubble's receive_generation backend workflow with the response text, word_base64, and status. That workflow updates the Chat record and deducts credits when status is done.

8.5What the page does

Chat statusPage state
generatingLoading text visible; composer still usable
errorError text visible; no credits deducted
doneDocument surface, toolbar and Download as Word all appear
§ 9

The output surface

Once a generation completes, the result renders as a document rather than a chat log: a white page on the cream canvas, constrained to a readable measure, with a gold rule across the top edge.

9.1Reading toolbar

ControlEffect
CopyCopies the full plain text to the clipboard
PrintOpens the print dialogue; the toolbar and buttons are hidden in print
TypeSerif, sans, display or monospace
SizeTwelve to twenty-six pixels, with a live percentage
AlignJustified with hyphenation, or ranged left
SpacingTight, normal or loose line height
WidthNarrow, normal or wide measure
PaperWhite, sepia or night
StatisticsLive word count, character count and estimated page count
Screen controls do not reach the Word file
Everything in the toolbar is browser-side presentation. The downloaded .docx is built server-side by generateWordDoc with fixed formatting — Times New Roman, twelve point, justified, one-and-a-half spacing. Changing the screen to monospace at 200 per cent has no effect on the file. Making the Word output configurable would require passing style options through /generate and reading them inside generateWordDoc.
§ 10

Open items

#ItemSeverityArea
1Credit gate compares against fixed value 7 instead of the selected mode's credits_costcriticalWorkflow steps 3–4
2Verify every credits_cost in the option set against this document and the credits pagehighOption set
3Run one full paid generation end to end on the deployed branchhighTesting
4Check the composer and output on a phone — advertising traffic is mostly mobilehighResponsive
5discussion_bachelor prompt runs short of its word targetmediumProxy prompt
6Full thesis mode still hidden pending the discussion fixmediumOption set
7Several sample PDFs are stale and need regeneratingmediumSamples
8DASS-21 / PPDS-21 label typo in the synthetic study filelowSamples
9ORCID still a placeholderlowContent
10Credits page cost table should be a Repeating Group, not hard-coded rowslowCredits page
TheSyn AITheSyn AI

Internal reference — verify all pricing against the WritingMode option set before publication.
← Back to landing page