perashanid/survease_v2
소개
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
웹 및 앱 개발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)
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalSurvEase
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 registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current userPOST /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 slugPUT /api/surveys/:id- Update survey (authenticated)PUT /api/surveys/:id/visibility- Toggle survey visibility (authenticated)GET /api/surveys/public- Get all public surveysGET /api/surveys/public/importable- Get importable surveys (authenticated)POST /api/surveys/:id/import- Import survey (authenticated)
Responses:
POST /api/surveys/:slug/responses- Submit survey responseGET /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 analyticsGET /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 CSVGET /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
- Clone the repository
git clone https://github.com/yourusername/survease.git
cd survease_v2
- Install dependencies
npm run install:all
- 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
- 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:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
- Health Check: http://localhost:3000/health
Production Build
npm run build
npm start
Usage
Creating a Survey
- Navigate to Dashboard and click "Create New Survey"
- Add survey title and description
- Add questions by clicking "Add Question"
- Select question type and configure options
- Mark required questions
- Configure settings (public/private, anonymous responses, email collection, response limits)
- Save survey and share the generated URL
Analyzing Survey Results
- Go to Dashboard and click "View Analytics" on a survey
- Choose analytics level (Basic, Enhanced, Advanced, Comprehensive, or Attention)
- Review charts, metrics, and insights
- Export data in JSON, CSV, or PDF format as needed
Importing a Survey
- Browse Public Surveys page
- Find a survey marked as importable
- Click "Import" to copy it to your dashboard
- Customize the imported survey as needed
관련 프로젝트 살펴보기
불러오는 중…