Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

منصّة الاستبيانات — Arabic‑first Survey Platform

License: MIT Node.js >= 18">https://img.shields.io/badge/Node.js-%E2%89%A5%2018-339933?logo=node.js&logoColor=white"> PostgreSQL Arabic-first Self-hosted PRs Welcome

English below · العربية أدناه — اقفز إلى القسم العربي


English

The first Arabic‑first, self‑hosted survey platform. Build surveys in Arabic (RTL end‑to‑end — questions, respondent UI, admin dashboard, and exports), share each survey through its own public link, collect anonymous responses with visual face/star ratings, and analyze everything in a built‑in Grafana‑style dark analytics dashboard — no external BI tool required.

It is deliberately small: one Node.js + Express + PostgreSQL service. No Docker required, no Mongo, no framework monolith — only three npm dependencies (express, pg, exceljs). It runs comfortably on a 1‑core container with 1 GB of RAM.

Why this and not X?

Plenty of good open‑source survey tools exist (LimeSurvey, Formbricks, HeyForm, …), and some — like Formbricks — now support RTL for respondents. What this project offers is a different trade‑off:

This platform
Arabic‑first, end‑to‑end Not "RTL supported" — Arabic is the native language of the whole product: builder, respondent flow, analytics dashboard, and Excel/PDF exports. English works too (bilingual UI).
Built‑in analytics A Grafana‑style dark dashboard ships inside the app: SVG donuts, bars, and gauges per question, plus word‑frequency bars for free‑text answers. No Grafana, Metabase, or SQL needed.
Radical simplicity One process, one database, three dependencies. git clonenpm install → running. Easy to audit, easy to keep alive for years.
Anonymous by design No respondent accounts. Soft duplicate prevention per device. Optional gender gate per survey.

Features

  • Multi‑survey platform — create, edit, activate/deactivate, and delete surveys from the admin area. Surveys start locked until an admin activates them.
  • A public link per survey — every survey gets its own slug and shareable URL (/s.html?slug=<slug>).
  • Visual ratings — face scales and star ratings, mobile‑first, designed for quick anonymous participation.
  • Conditional sections and an optional gender gate, per survey.
  • Anonymous responses with soft duplicate prevention (no accounts, no personal data collected).
  • Built‑in dark analytics dashboard (Grafana‑style): SVG donuts / bar charts / gauges per question, word‑frequency view for open answers, filters, and live counters.
  • Excel export (via exceljs) and print/PDF‑friendly reporting.
  • Users & rolesadmin (full control, incl. user management) and editor (create/edit surveys). Passwords hashed with scrypt (Node stdlib), HMAC‑signed session tokens, 12‑hour sessions.
  • Offline‑friendly password reset — no email server needed: an admin issues a one‑time token/link, or recovers via a CLI on the box (node src/reset.js).
  • Self‑contained — static frontend served by the same Express process; no CDN or external assets, so it works on air‑gapped LANs.

Quick start

Requirements: Node.js ≥ 18 and PostgreSQL ≥ 13 (tested on Node 20 / PostgreSQL 15).

git clone <this-repo> && cd <repo>

# 1) Database
createdb survey                # or any name — match DB_NAME in .env

# 2) Configuration
cp .env.example .env           # fill in DB_* and secrets (see below)

# 3) Install & initialize schema
npm install
npm run initdb                 # node src/db.js --init

# 4) Run
node src/server.js             # or: npm start

Open http://localhost:<PORT>:

  • /admin.html — admin area (surveys list, builder, users)
  • /dashboard.html — analytics dashboard
  • /s.html?slug=<slug> — public respondent page for a survey

A sample survey is seeded on first boot so you can try the whole flow immediately.

Configuration (.env)

Variable Purpose
PORT HTTP port the service listens on
DB_HOST / DB_PORT / DB_USER / DB_PASS / DB_NAME PostgreSQL connection
ADMIN_USER / ADMIN_PASS Bootstrap admin credentials
APP_SECRET Random hex string — signs session and reset tokens

Note: the default admin login is admin / admin — change it before any real deployment, and set a strong random APP_SECRET (e.g. openssl rand -hex 32). See .env.example.

Production notes

  • Run it as a systemd service (or any supervisor) behind your reverse proxy / tunnel of choice. A 1‑core, 1 GB container is enough.
  • All aggregation happens in PostgreSQL, so the dashboard stays fast as responses grow.
  • Nothing phones home; there are no external runtime dependencies.

Roadmap

  • More interface languages beyond Arabic/English (UI strings are already centralized in public/i18n.js).
  • More question types and richer branching logic.
  • CSV export alongside Excel.
  • Optional response webhooks.

Contributions are welcome — see CONTRIBUTING.md.

License

MIT © 2026 the Survey Platform authors.


العربية

أول منصّة استبيانات عربية المنشأ ومستضافة ذاتياً. ابنِ استبياناتك بالعربية (يمين‑إلى‑يسار من أول الشاشة إلى آخر تقرير: الأسئلة، وواجهة المشارك، ولوحة التحكم، والتصدير)، وشارك كل استبيان برابط عام خاص به، واجمع ردوداً مجهولة بتقييمات مرئية (وجوه ونجوم)، وحلّل النتائج في لوحة تحليلات داكنة مدمجة بأسلوب Grafana — بلا أي أداة تحليل خارجية.

المنصّة صغيرة عن قصد: خدمة واحدة Node.js + Express + PostgreSQL. لا حاجة لـ Docker، ولا Mongo، ولا إطار عمل ضخم — ثلاث اعتماديات npm فقط (express وpg وexceljs)، وتعمل بأريحية على حاوية بنواة معالج واحدة و1 جيجابايت من الذاكرة.

لماذا هذه المنصّة؟

توجد أدوات استبيانات مفتوحة المصدر جيدة (LimeSurvey وFormbricks وHeyForm وغيرها)، وبعضها صار يدعم RTL للمشاركين. ما تقدّمه هذه المنصّة مختلف:

  • عربية من الجذر لا «دعم RTL» — العربية هي اللغة الأم للمنتج كله: البنّاء، ورحلة المشارك، ولوحة التحليلات، وتصدير Excel/PDF. والإنجليزية متاحة أيضاً (واجهة ثنائية اللغة).
  • تحليلات مدمجة — لوحة داكنة بأسلوب Grafana داخل التطبيق نفسه: دوائر وأعمدة وعدّادات SVG لكل سؤال، وأعمدة تكرار الكلمات للإجابات المكتوبة. لا حاجة لـ Grafana أو Metabase أو كتابة SQL.
  • بساطة جذرية — عملية واحدة وقاعدة بيانات واحدة وثلاث اعتماديات. سهلة التدقيق وسهلة الإبقاء حيّة لسنوات.
  • مجهولية بالتصميم — لا حسابات للمشاركين، ومنع تكرار مرن لكل جهاز، وبوابة جنس اختيارية لكل استبيان.

المزايا

  • منصّة متعددة الاستبيانات — إنشاء وتعديل وتفعيل/إيقاف وحذف من لوحة الإدارة، وكل استبيان يبدأ مقفولاً حتى يفعّله المدير.
  • رابط عام لكل استبيان — لكل استبيان مُعرّف (slug) ورابط مشاركة خاص به: ‎/s.html?slug=<slug>.
  • تقييمات مرئية — مقاييس وجوه ونجوم، بتصميم موبايل أولاً.
  • أقسام شرطية وبوابة جنس اختيارية لكل استبيان.
  • ردود مجهولة مع منع تكرار مرن — لا تُجمع أي بيانات شخصية.
  • لوحة تحليلات داكنة مدمجة: رسوم SVG لكل سؤال + تكرار الكلمات + فلاتر وعدّادات حيّة.
  • تصدير Excel وتقارير صالحة للطباعة/PDF.
  • مستخدمون وأدوارadmin (تحكّم كامل وإدارة مستخدمين) وeditor (إنشاء وتعديل الاستبيانات فقط)، مع تجزئة كلمات المرور بـ scrypt وجلسات موقّعة مدتها ١٢ ساعة.
  • استعادة كلمة المرور بلا بريد إلكتروني — المدير يُصدر رابطاً لمرة واحدة، أو استعادة من سطر الأوامر على الخادم نفسه (node src/reset.js).
  • مكتفية بذاتها — الواجهة تُخدَم من نفس العملية بلا CDN ولا أصول خارجية، فتعمل حتى على شبكة محلية معزولة عن الإنترنت.

التشغيل السريع

المتطلبات: Node.js ‏≥ 18 وPostgreSQL ‏≥ 13 (مجرّبة على Node 20 وPostgreSQL 15).

git clone <this-repo> && cd <repo>
createdb survey              # أو أي اسم — طابقه مع DB_NAME في .env
cp .env.example .env         # عبّئ إعدادات قاعدة البيانات والأسرار
npm install
npm run initdb               # إنشاء المخطط (node src/db.js --init)
node src/server.js           # أو npm start

ثم افتح:

  • ‎/admin.html — لوحة الإدارة (الاستبيانات، البنّاء، المستخدمون)
  • ‎/dashboard.html — لوحة التحليلات
  • ‎/s.html?slug=<slug> — صفحة المشارك العامة لأي استبيان

يُبذر استبيان تجريبي عند أول تشغيل لتجربة المسار كاملاً فوراً.

تنبيه: حساب المدير الافتراضي هو admin / admin — غيّره قبل أي نشر حقيقي، وضع قيمة عشوائية قوية في APP_SECRET (مثلاً openssl rand -hex 32). راجع .env.example.

ملاحظات الإنتاج

  • شغّلها كخدمة systemd (أو أي مشرف عمليات) خلف الوكيل العكسي أو النفق الذي تفضّله — حاوية بنواة واحدة تكفي.
  • كل التجميع الإحصائي يجري داخل PostgreSQL، فتبقى اللوحة سريعة مهما كثرت الردود.
  • لا شيء يتصل بالخارج — لا اعتماديات خارجية وقت التشغيل.

خارطة الطريق

  • لغات واجهة إضافية غير العربية والإنجليزية (النصوص مركزية في public/i18n.js).
  • أنواع أسئلة إضافية ومنطق تفريع أغنى.
  • تصدير CSV إلى جانب Excel.
  • Webhooks اختيارية عند وصول الردود.

المساهمات مرحّب بها — راجع CONTRIBUTING.md.

الرخصة

MIT © 2026 مؤلفو منصّة الاستبيانات.

About

The first Arabic-first, self-hosted survey platform: lightweight Node + PostgreSQL, per-survey public links, anonymous visual (faces/stars) responses, roles, and a built-in Grafana-style analytics dashboard with Excel/PDF export. Bilingual AR/EN.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages