Skip to content
Proyectos

Acerca de

A Survey platform for all types of surveys with reciprocal self sustaining economy to serve researchers , students , business owners and analysts to gather reliable data

Desarrollo web y de aplicaciones

Cómo se miden estas cifras

What you can do

  • JWT-based authentication with secure token storage
  • Password hashing with bcrypt (10 rounds)
  • Protected routes with middleware
  • Configurable rate limiting (default: 1000 requests/minute in development)

Crecimiento de estrellas medido

in 24h
0
in 7 days
Recopilando historial
in 15 days
Recopilando historial
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

SurvEase

A full-stack survey creation and analytics platform built with React, TypeScript, Node.js, Express, and MongoDB. Create, share, and analyze surveys with real-time analytics and AI-powered insights.

Features

Survey Creation and Management

  • Drag-and-drop survey builder with multiple question types (text, textarea, multiple choice, checkbox, dropdown, rating, date, email, number)
  • Flexible privacy settings (public/private surveys with customizable access controls)
  • Survey import and export functionality
  • Unique shareable URLs with custom slugs
  • Response controls (anonymous responses, email collection, one-response-per-user limits)

Response Collection

  • Support for both authenticated and anonymous responses
  • Mobile-responsive design
  • Real-time validation with instant feedback
  • Progress tracking and completion time monitoring
  • Device detection (type, OS, browser)
  • IP-based duplicate prevention

Analytics and Insights

Multi-tier analytics dashboards:

  • Basic Analytics: Response counts, completion rates, question-level breakdowns
  • Enhanced Analytics: Time-series trends, demographic analysis, device analytics
  • Advanced Analytics: Statistical analysis, correlation matrices, sentiment analysis
  • Comprehensive Analytics: Combined features with export capabilities
  • Attention Analytics: Response quality detection, completion time analysis, engagement metrics

AI-powered features:

  • Gemini AI integration for automated insights
  • AI-generated executive summaries
  • Sentiment analysis for text responses
  • Pattern detection and correlations
  • Automatic low-quality response detection

Data visualization:

  • Interactive charts using Recharts and Chart.js
  • Response timeline tracking
  • Question-specific analytics
  • Export options (JSON, CSV, PDF)

Quality Control

  • Automatic response quality detection
  • Completion time analysis
  • Manual override system for flagged responses
  • Quality audit logs

User Experience

  • Dark and light theme support
  • Error boundaries with graceful error handling
  • Toast notifications for user actions
  • Loading states and skeleton screens
  • Real-time WebSocket connection monitoring

Admin System

  • Hidden admin portal at /x-admin-portal
  • Survey management (feature/unfeature, toggle visibility, delete)
  • Platform statistics dashboard
  • User management capabilities
  • Role-based access with JWT validation

Architecture

Technology Stack

Frontend:

  • React 18 with TypeScript
  • React Router v6 (HashRouter)
  • Context API for state management (AuthContext, ThemeContext)
  • CSS Modules with custom properties
  • Framer Motion for animations
  • Recharts and Chart.js for data visualization
  • React Icons (Feather Icons)
  • Vite build tool
  • Axios for HTTP requests

Backend:

  • Node.js with TypeScript
  • Express.js framework
  • MongoDB with Mongoose ODM
  • JWT authentication with bcrypt
  • Helmet and CORS for security
  • express-rate-limit for rate limiting
  • Google Generative AI (Gemini) integration
  • Nodemailer for email notifications
  • PDFKit for PDF generation
  • Joi for validation
  • WebSockets (ws library)

Project Structure

survey-platform/
├── frontend/
│   ├── src/
│   │   ├── components/
│   │   │   ├── analytics/
│   │   │   └── shared/
│   │   ├── contexts/
│   │   ├── pages/
│   │   ├── services/
│   │   ├── utils/
│   │   ├── styles/
│   │   ├── App.tsx
│   │   └── main.tsx
│   ├── public/
│   ├── .env.example
│   ├── package.json
│   ├── tsconfig.json
│   └── vite.config.ts
│
├── backend/
│   ├── src/
│   │   ├── config/
│   │   ├── middleware/
│   │   ├── models/
│   │   ├── routes/
│   │   ├── services/
│   │   ├── utils/
│   │   ├── validation/
│   │   ├── scripts/
│   │   └── app.ts
│   ├── dist/
│   ├── .env.example
│   ├── package.json
│   └── tsconfig.json
│
├── package.json
└── README.md

Database Schema

Users Collection:

{
  _id: ObjectId,
  email: string (unique, indexed),
  password: string (hashed),
  first_name: string,
  last_name: string,
  created_at: Date,
  updated_at: Date
}

Surveys Collection:

{
  _id: ObjectId,
  user_id: ObjectId (ref: User, indexed),
  title: string,
  description: string,
  slug: string (unique, indexed),
  configuration: {
    questions: [{
      id: string,
      type: enum,
      question: string,
      required: boolean,
      options: string[],
      min_rating: number,
      max_rating: number
    }],
    settings: {
      is_public: boolean,
      allow_anonymous: boolean,
      collect_email: boolean,
      one_response_per_user: boolean,
      show_results: boolean,
      close_date: Date
    }
  },
  is_public: boolean (indexed),
  is_active: boolean (indexed),
  allow_import: boolean,
  import_count: number,
  original_survey_id: ObjectId (ref: Survey),
  created_at: Date (indexed),
  updated_at: Date
}

Responses Collection:

{
  _id: ObjectId,
  survey_id: ObjectId (ref: Survey, indexed),
  user_id: ObjectId (ref: User, optional),
  respondent_email: string,
  response_data: Mixed (question_id: answer),
  is_anonymous: boolean (indexed),
  ip_address: string,
  submitted_at: Date (indexed),
  completion_time: number (seconds),
  started_at: Date,
  device_info: {
    type: enum ['mobile', 'desktop', 'tablet'],
    os: string,
    browser: string,
    browserVersion: string
  },
  quality_status: enum ['quality', 'low_quality', 'manually_overridden'],
  quality_flags: [{
    flag_type: enum,
    flagged_at: Date,
    threshold_value: number
  }],
  manual_override: {
    overridden_by: ObjectId,
    overridden_at: Date,
    reason: string
  }
}

API Endpoints

Authentication:

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/me - Get current user
  • POST /api/auth/logout - User logout

Surveys:

  • POST /api/surveys - Create survey (authenticated)
  • GET /api/surveys - Get user's surveys (authenticated)
  • GET /api/surveys/:slug - Get survey by slug
  • PUT /api/surveys/:id - Update survey (authenticated)
  • PUT /api/surveys/:id/visibility - Toggle survey visibility (authenticated)
  • GET /api/surveys/public - Get all public surveys
  • GET /api/surveys/public/importable - Get importable surveys (authenticated)
  • POST /api/surveys/:id/import - Import survey (authenticated)

Responses:

  • POST /api/surveys/:slug/responses - Submit survey response
  • GET /api/surveys/:id/responses - Get survey responses (authenticated)

Analytics:

  • GET /api/surveys/:id/analytics - Get survey analytics (authenticated)
  • GET /api/public/surveys/:id/analytics - Get public survey analytics
  • GET /api/analytics/data - Get user analytics dashboard (authenticated)
  • GET /api/attention/:surveyId - Get attention analytics (authenticated)

Quality Control:

  • GET /api/surveys/:surveyId/quality - Get quality metrics (authenticated)
  • POST /api/surveys/:surveyId/responses/:responseId/override - Override quality status (authenticated)

AI Insights:

  • POST /api/surveys/:surveyId/ai/insights - Generate AI insights (authenticated)
  • GET /api/surveys/:surveyId/ai/insights - Get cached insights (authenticated)

Export:

  • GET /api/surveys/:id/export?format=json|csv - Export survey data (authenticated)
  • GET /api/public/surveys/:id/export/csv - Export public survey CSV
  • GET /api/public/surveys/:id/export/json - Export public survey JSON

Platform Stats:

  • GET /api/stats/platform - Get platform statistics

Security Features

  • JWT-based authentication with secure token storage
  • Password hashing with bcrypt (10 rounds)
  • Protected routes with middleware
  • Configurable rate limiting (default: 1000 requests/minute in development)
  • Joi schema validation for all inputs
  • XSS and SQL injection prevention
  • Helmet.js security headers
  • CORS configuration
  • Anonymous response support with optional IP hashing
  • GDPR-compliant data handling

Installation

Prerequisites

  • Node.js v18 or higher
  • npm or yarn
  • MongoDB (local installation or MongoDB Atlas account)
  • Git

Setup Steps

  1. Clone the repository
git clone https://github.com/yourusername/survease.git
cd survease_v2
  1. Install dependencies
npm run install:all
  1. Configure environment variables

Create backend/.env based on backend/.env.example:

PORT=3000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/survey_platform
JWT_SECRET=generate-a-secure-random-string-here
JWT_EXPIRES_IN=7d
CORS_ORIGIN=http://localhost:5173
FRONTEND_URL=http://localhost:5173
BACKEND_URL=http://localhost:3000
GEMINI_API_KEY=get-from-google-ai-studio
ENABLE_AI_FEATURES=true

Create frontend/.env based on frontend/.env.example:

VITE_API_BASE_URL=http://localhost:3000/api
VITE_ENV=development
  1. Start MongoDB

Local MongoDB:

# macOS
brew services start mongodb-community

# Linux
sudo systemctl start mongod

# Windows
net start MongoDB

For MongoDB Atlas, update the connection string in backend/.env.

Running the Application

Development Mode

Run both frontend and backend:

npm run dev

Or run separately:

# Backend (port 3000)
npm run dev:backend

# Frontend (port 5173)
npm run dev:frontend

Application URLs:

Production Build

npm run build
npm start

Usage

Creating a Survey

  1. Navigate to Dashboard and click "Create New Survey"
  2. Add survey title and description
  3. Add questions by clicking "Add Question"
  4. Select question type and configure options
  5. Mark required questions
  6. Configure settings (public/private, anonymous responses, email collection, response limits)
  7. Save survey and share the generated URL

Analyzing Survey Results

  1. Go to Dashboard and click "View Analytics" on a survey
  2. Choose analytics level (Basic, Enhanced, Advanced, Comprehensive, or Attention)
  3. Review charts, metrics, and insights
  4. Export data in JSON, CSV, or PDF format as needed

Importing a Survey

  1. Browse Public Surveys page
  2. Find a survey marked as importable
  3. Click "Import" to copy it to your dashboard
  4. Customize the imported survey as needed

Explorar proyectos relacionados

Cargando…