TheSyn AI
Academic Research Engine — Index Page, Mode Catalogue and Credit System Reference.
Contents
- 1System overview
- 1.1The three pieces
- 1.2Why the architecture is asynchronous
- 2Anatomy of the index page
- 2.1Left sidebar
- 2.2Header
- 2.3Main column
- 2.4Element and group names
- 3The dropdown system
- 3.1The chain
- 3.2How each dropdown is configured
- 3.3Attributes carried by every mode
- 4Categories and subcategories
- 4.1The five categories
- 4.2Subcategories
- 5Mode catalogue and credit costs
- 5.1Single sections and chapters
- 5.2Proposals
- 5.3Full articles
- 5.4Humanised articles
- 5.5Data-analysis articles
- 5.6Full thesis
- 5.7Humanisation tools
- 6How the credit system works
- 6.1Where the balance lives
- 6.2The full lifecycle
- 6.3Spending credits
- 6.4Credit packages
- 6.5Displaying costs without maintenance
- 7Conditional input fields
- 8The generation flow, step by step
- 9The output surface
- 10Open items
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
| Layer | Technology | Responsibility |
|---|---|---|
| Front end | Bubble.io | Pages, dropdowns, conditional fields, workflows, user accounts, credit balance, chat history |
| Proxy | Node.js on Render | Prompt library, Claude API calls, Python statistical analysis, Ryne humanisation, Word document assembly |
| Model | Anthropic Claude API | All 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.
error and the deduction step is skipped. The user is never charged for output they did not receive.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
| Element | Behaviour |
|---|---|
| + New Chat | Gold button. Clears current_chat and resets the composer to its empty state. |
| Recent Chats | Repeating 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 card | Pinned 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.
| Name | What it is |
|---|---|
| Group chat-main | The whole main column. Background must be cream #F6F5EF. |
| Group chat-toolbar | Hero band row — icon, titles, logo, Support. |
| Group chat-thread-section | Wrapper for the generated output. Visible when current_chat is not empty. |
| Group chat-composer-section | Outer composer container. Max width 1150, centred. |
| Group chat-composer-wrap | Intermediate wrapper. |
| Group chat-composer | The white composer card itself. |
| Group composer-mode-row | Column holding the three step blocks and the cost row. |
| Group composer-cost-wrap | The cream cost row. Row layout, space-between. |
| Dropdown composer-category | Step 1. |
| Dropdown composer-subcategory | Step 2. |
| Dropdown composer-mode | Step 3. |
| Button composer-submit | Generate. |
| Button composer-clear | Clear. |
| Button download-word | Download as Word. |
| Text index's current_chat | The generated document text. |
The dropdown system
Three dependent dropdowns narrow forty-plus modes down to one. Each reads from the same WritingMode option set; what differs is the filter applied.
3.1The chain
Step 1 Category → Article Generation
Step 2 Article type → Quantitative
Step 3 Mode → Full Article (Quantitative) — 15 credits
Cost → 15 credits
Conditional fields appear3.2How each dropdown is configured
| Dropdown | Source | Filter |
|---|---|---|
| Step 1 | Category option set | None — shows all five categories |
| Step 2 | Subcategory option set | Constrained to the selected category |
| Step 3 | All WritingMode | category = Step 1 value AND subcategory = Step 2 value |
subcategory attribute against the subcategory dropdown's value — not against the category dropdown's value. When those are crossed, the mode list either empties or shows the wrong set. The fix is to remove the constraint from the base data source and express subcategory filtering as conditions on Dropdown composer-mode instead.3.3Attributes carried by every mode
These live on the WritingMode option set and drive everything downstream.
| Attribute | Type | Purpose |
|---|---|---|
| Display | text | What the user reads in the dropdown, including the credit cost in the label |
| node_key | text | The exact string sent to the proxy. The proxy switches on this. Must match the proxy's case block character for character. |
| credits_cost | number | Drives the cost badge, the credit gate, and the deduction. Single source of truth for pricing. |
| category | text | Step 1 filter value. Spelling must match the category option exactly. |
| subcategory | text | Step 2 filter value. |
| max_tokens | number | Per-mode output ceiling passed to the API call. |
| sample_url | text | Link to the watermarked preview PDF shown by the sample popup. |
| sample_blurb | text | Short description shown alongside the sample. |
| system_prompt | text | Mostly unused — prompts live in the proxy's PROMPTS object. |
Categories and subcategories
4.1The five categories
| Category | Contains | Typical user |
|---|---|---|
| Article Generation | Quantitative, qualitative, mixed-methods and journal-formatted articles, reviewer responses, data-analysis variants | Researcher preparing a manuscript |
| Article Generation (Humanized) | The six humanised article modes, routed through Ryne after writing | Researcher concerned about AI detection |
| Thesis BSc | Bachelor's chapters, bachelor proposals, and the full BSc thesis | Undergraduate nursing student |
| Thesis Postgraduate | MSc and PhD chapters and proposals | Postgraduate student |
| Academic Humanization Tools | Standalone humaniser and AI detection report | Anyone 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.
Mode catalogue and credit costs
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
| Mode | node_key | Credits |
|---|---|---|
| Introduction (Bachelor's) | intro_bachelor | 7 cr |
| Introduction (Postgraduate) | intro_postgrad | 7 cr |
| Literature Review (Bachelor's) | lit_bachelor | 10 cr |
| Literature Review (Postgraduate) | lit_postgrad | 10 cr |
| Methods (Bachelor's) | methods_bachelor | 10 cr |
| Methods (Postgraduate) | methods_postgrad | 10 cr |
| Results (Bachelor's) | results_bachelor | 10 cr |
| Results (Postgraduate) | results_postgrad | 10 cr |
| Discussion (Bachelor's) | discussion_bachelor | 10 cr |
| Discussion (Postgraduate) | discussion_postgrad | 10 cr |
5.2Proposals
| Mode | node_key | Credits |
|---|---|---|
| Proposal (Bachelor's) | proposal_bachelor | 15 cr |
| Proposal (PhD / Masters) | proposal_phd | 15 cr |
| Advanced Proposal (Bachelor's) | advanced_proposal_bachelor | 20 cr |
| Advanced Proposal (PhD / MSc) | advanced_proposal_phd | 20 cr |
5.3Full articles
| Mode | node_key | Credits |
|---|---|---|
| Full Article (Quantitative) | full_article_quant | 15 cr |
| Full Article (Qualitative) | full_article_qual | 15 cr |
| Full Article (Mixed Methods) | full_article_mixed | 15 cr |
| Full Article (Mixed) — journal formatted | full_article_mixed_journal | 20 cr |
| Reviewer Response | reviewer_response | 8 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.
| Mode | node_key | Credits |
|---|---|---|
| Full Article (Quantitative) — Humanized | full_article_quant_humanized | 20 cr |
| Full Article (Qualitative) — Humanized | full_article_qual_humanized | 20 cr |
| Full Article (Mixed) — Humanized | full_article_mixed_humanized | 20 cr |
| Introduction — Humanized | intro_humanized | 12 cr |
| Literature Review — Humanized | lit_humanized | 15 cr |
| Discussion — Humanized | discussion_humanized | 15 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 family | node_key pattern | Credits |
|---|---|---|
| Quantitative — analyse my data | *_analyze_quant | 30 cr |
| Qualitative — analyse my data | *_analyze_qual | 30 cr |
| Mixed methods — analyse my data | *_analyze_mixed | 30 cr |
| Postgraduate data analysis (20+ tables) | data_analysis_postgrad | 30 cr |
5.6Full thesis
| Mode | node_key | Credits |
|---|---|---|
| Full Thesis (Bachelor's) — humanised | thesis_bsc_full_humanized | 75 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
| Mode | node_key | Credits |
|---|---|---|
| Academic Humanizer (up to 250 words) | humanize_text | 1 cr |
| AI Detection Report (up to 1,000 words) | ai_detect | 1 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.
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
/create-payment endpoint with user_id and package.pending and returns a NASS gateway URL.receive_payment backend workflow.order_id matches AND status = pending. The pending constraint is the double-credit protection — a repeated callback finds nothing and does nothing.credits_amount to the buyer's credit_balance, but only when payment_status is success.6.3Spending credits
Two separate mechanisms, and they must agree with each other.
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.
Callback subtracts
The receive_generation backend workflow subtracts the writing mode's credits_cost from the user's balance, conditional on status being done.
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
| Package | Credits | Price (IQD) | Per credit |
|---|---|---|---|
| Starter | 25 cr | 44,000 | 1,760 |
| Standard | 70 cr | 90,000 | 1,286 |
| Premium | 130 cr | 151,000 | 1,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.
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.
| Field | Type | Used by |
|---|---|---|
| Title of the study | text | Every mode except the humanisation tools |
| Method details | long text | Methods, results, discussion, full articles, thesis |
| Supervisor name | text | Proposals and thesis |
| Student name(s) | text | Proposals and thesis |
| Department | text | Proposals and thesis |
| University name | text | Proposals and thesis |
| Year of study | text | Full thesis |
| Place of data collection | text | Proposals, results, thesis |
| Author details | long text | Article modes |
| Journal guidelines | paste box | Journal-formatted article modes |
| Additional info / scoring | long text | Data-analysis modes |
| Upload — university logo | file | Full thesis |
| Upload — university guidelines | file | Advanced proposals, thesis |
| Upload — questionnaire | file | Data-analysis modes |
| Upload — data file (CSV / Excel) | file | All data-analysis modes |
| Source text paste box | long text | Humanizer and AI detection only |
The generation flow, step by step
8.1Submit — Button composer-submit is clicked
| Step | Action | Condition |
|---|---|---|
| 1 | Show Group chat-error-msg | Mode empty, or title empty, or source text empty |
| 2 | Terminate this workflow | Same condition as step 1 |
| 3 | Show Group chat-low-credits | Balance below threshold — see defect in 6.3 |
| 4 | Terminate this workflow | Same condition as step 3 |
| 5 | Set state is_generating on index | Always |
| 6 | Create a new Chat, status "generating" | Always |
| 7 | AI Detection Report branch | node_key is ai_detect |
| 8 | Humanized Text branch | node_key is humanize_text |
| 9 | TheSyn Proxy — Generate via Proxy | Always |
| 10 | Set state current_chat on index | Always |
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_keyto a prompt in thePROMPTSobject - 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
.docxthroughgenerateWordDocand 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 status | Page state |
|---|---|
generating | Loading text visible; composer still usable |
error | Error text visible; no credits deducted |
done | Document surface, toolbar and Download as Word all appear |
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
| Control | Effect |
|---|---|
| Copy | Copies the full plain text to the clipboard |
| Opens the print dialogue; the toolbar and buttons are hidden in print | |
| Type | Serif, sans, display or monospace |
| Size | Twelve to twenty-six pixels, with a live percentage |
| Align | Justified with hyphenation, or ranged left |
| Spacing | Tight, normal or loose line height |
| Width | Narrow, normal or wide measure |
| Paper | White, sepia or night |
| Statistics | Live word count, character count and estimated page count |
.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.Open items
| # | Item | Severity | Area |
|---|---|---|---|
| 1 | Credit gate compares against fixed value 7 instead of the selected mode's credits_cost | critical | Workflow steps 3–4 |
| 2 | Verify every credits_cost in the option set against this document and the credits page | high | Option set |
| 3 | Run one full paid generation end to end on the deployed branch | high | Testing |
| 4 | Check the composer and output on a phone — advertising traffic is mostly mobile | high | Responsive |
| 5 | discussion_bachelor prompt runs short of its word target | medium | Proxy prompt |
| 6 | Full thesis mode still hidden pending the discussion fix | medium | Option set |
| 7 | Several sample PDFs are stale and need regenerating | medium | Samples |
| 8 | DASS-21 / PPDS-21 label typo in the synthetic study file | low | Samples |
| 9 | ORCID still a placeholder | low | Content |
| 10 | Credits page cost table should be a Repeating Group, not hard-coded rows | low | Credits page |
TheSyn AIInternal reference — verify all pricing against the WritingMode option set before publication.
← Back to landing page