How 3obhan/mantec works
Mantec is a bilingual logical-fallacy analyzer. Users choose a language, submit text for analysis, review and export findings, and revisit saved analyses; the UI also exposes spiritual feedback and financial-support pages. Analysis has an online Gemini path and an offline heuristic fallback, while the repository includes a separate payment API for paid reports. The shown excerpts establish the server’s Gemini and offline calls, but do not expose the frontend’s analysis or checkout request wiring, so those links are marked unverified or omitted.
Main entry points: App.tsx App Router · Analyze.tsx Analyze & Export · store.tsx App State · _lib.js Payment Helpers
Components 22
Application UI
- App Router
src/App.tsx - Language Choice
src/components/LanguageSelect.tsx - Home
src/components/Home.tsx - Analyze & Export
src/components/Analyze.tsx - History & Handbook
src/components/History.tsx - Spiritual Feedback
src/components/Spiritual.tsx - Exam Paper
src/components/ExamPaper.tsx - Translations
src/i18n.ts
Analysis Runtime
- Analysis Server
server.ts - Offline Heuristics
src/offlineAnalyzer.ts - Analysis Cache
analysis_cache.json
Report Payments
- Create Payment
functions/api/payment/create.js - Payment Status
functions/api/payment/status.js - Report Access
functions/api/payment/report.js - Stripe Webhook
functions/api/payment/stripe-webhook.js - Zibal Callback
functions/api/payment/zibal-callback.js - Payment Helpers
functions/api/payment/_lib.js - Payments Database
functions/schema.sql
Local State
- App State
src/store.tsx - Browser Storage
Other components
- User
- Google Gemini
Connections 29
- User → App Router: opens
- App Router → App State: provides state
src/App.tsx - App Router → Language Choice: routes to
src/App.tsx - App Router → Home: routes to
src/App.tsx - App Router → Analyze & Export: routes to
src/App.tsx - App Router → History & Handbook: routes to
src/App.tsx - App Router → Spiritual Feedback: routes to
src/App.tsx - Language Choice → App State: sets language
src/components/LanguageSelect.tsx - Home → App State: reads state
src/components/Home.tsx - Analyze & Export → App State: reads and updates
src/components/Analyze.tsx - History & Handbook → App State: manages history
src/components/History.tsx - Spiritual Feedback → App State: reads state
src/components/Spiritual.tsx - App State → Browser Storage: persists
src/store.tsx - Analyze & Export → Translations: uses labels
src/components/Analyze.tsx - Home → Translations: uses labels
src/components/Home.tsx - History & Handbook → Translations: uses labels
src/components/History.tsx - Analysis Server → Google Gemini: queries
server.ts - Analysis Server → Offline Heuristics: falls back to
server.ts - Analyze & Export → Offline Heuristics: runs locally
src/components/Analyze.tsx - Analysis Server → Analysis Cache: reads and writes
server.ts - Analyze & Export → Analysis Server: submits analysis
- Create Payment → Payment Helpers: uses helpers
functions/api/payment/create.js - Payment Status → Payment Helpers: uses helpers
functions/api/payment/status.js - Report Access → Payment Helpers: uses helpers
functions/api/payment/report.js - Stripe Webhook → Payment Helpers: verifies signature
functions/api/payment/stripe-webhook.js - Zibal Callback → Payment Helpers: uses helpers
functions/api/payment/zibal-callback.js - Stripe Webhook → Payments Database: updates payment
functions/api/payment/stripe-webhook.js - Analyze & Export → Create Payment: starts checkout
- Analyze & Export → Exam Paper: exports report