ssscQuiz
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v29View latest version
A comprehensive personality quiz application built with Val Town that helps users discover their social archetype through interactive questions. The application has been fully refactored following Val Town best practices with a modern, scalable architecture.
- Email Collection: Users must provide email to begin quiz
- Interactive Quiz: 15 carefully crafted questions with smooth animations
- Personality Analysis: Advanced algorithm determining primary social archetype
- Email Delivery: Automated email with detailed results and insights
- Data Persistence: All submissions stored in SQLite database
- Real-time Progress Tracking: Visual progress bar and question counter
- Completion Time Analysis: Tracks and analyzes user completion patterns
- Personality Insights: Deep analysis of user's social tendencies
- Ideal Events Matching: Personalized event and community recommendations
- Social Sharing: Built-in sharing capabilities for social media
- Results Download: Export results as JSON file
- Admin Analytics: Backend analytics for archetype distribution
- Responsive Design: Works seamlessly on desktop and mobile
- Smooth Animations: Fade-in/out transitions and progress animations
- Modern UI: Clean, professional design with CSS variables
- Accessibility: WCAG compliant with proper contrast and keyboard navigation
ssscQuiz/
โโโ index.http.ts # ๐ Main HTTP Val - Primary quiz application
โโโ admin.http.ts # ๐ Admin HTTP Val - Dashboard for data analytics
โโโ config.ts # โ๏ธ Configuration file for email and app settings
โโโ frontend/
โ โโโ components/
โ โ โโโ EmailScreen.tsx # Email collection component
โ โ โโโ IntroScreen.tsx # Welcome and instructions
โ โ โโโ CountdownScreen.tsx # Pre-quiz countdown
โ โ โโโ PersonalityQuiz.tsx # Main quiz interface
โ โ โโโ QuizResultsComponent.tsx # Results display with tabs
โ โโโ index.html # Main HTML template
โ โโโ index.tsx # React app entry point
โ โโโ style.css # Comprehensive CSS styles with mobile responsiveness
โโโ shared/
โ โโโ types.ts # TypeScript interfaces and types
โ โโโ quizData.ts # Quiz questions and archetype information
โ โโโ utils.ts # Shared utility functions
โโโ main.tsx # Legacy entry point (redirects to index.http.ts)
โโโ deno.json # Deno configuration
โโโ README.md # This file
- Backend: Hono web framework on Deno
- Frontend: React 18 with TypeScript
- Database: Val Town SQLite
- Email: Val Town email service
- Styling: CSS with custom properties and responsive design
- Build Tool: Native Deno/ES modules
The quiz identifies six primary social archetypes:
- The Visionary ๐ฎ - Forward-thinking innovators
- The Nurturer ๐ค - Community builders and carers
- The Sage ๐ - Knowledge seekers and wisdom sharers
- The Artisan ๐จ - Creative expressers and makers
- The Catalyst โก - Change-makers and motivators
- The Connector ๐ - Natural networkers and community builders
Each archetype includes:
- Detailed personality description
- Key traits and characteristics
- Famous examples
- Ideal events and communities
- Personalized insights
- Primary HTTP val that users visit
- Hono web server with comprehensive error handling
- SQLite database with optimized schema and indexing
- Enhanced email system with HTML/text templates
- API endpoints for quiz submission and analytics
- Static file serving for all frontend assets
- Mobile-responsive design
- Separate HTTP val for administrative functions
- Real-time analytics and data visualization
- Responsive table displaying all quiz submissions
- Pagination for large datasets
- CSV export functionality for data analysis
- Mobile-optimized admin interface
- RESTful API with proper error handling
- SQLite database with structured schema and indexes
- Email automation with professional HTML templates
- Admin analytics with real-time data
- Static file serving for frontend assets
- IP hashing for privacy compliance
- Component-based architecture
- State management with React hooks
- Type-safe interfaces throughout
- Smooth animations and transitions
- Progressive enhancement
CREATE TABLE sssc_quiz_submissions ( id INTEGER PRIMARY KEY AUTOINCREMENT, email TEXT NOT NULL, primary_archetype TEXT NOT NULL, breakdown TEXT NOT NULL, -- JSON of archetype percentages answers TEXT NOT NULL, -- JSON of user answers timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, completion_time INTEGER, -- Milliseconds insights TEXT -- JSON of generated insights );
- Completion Time Analysis: Fast/moderate/thoughtful pacing
- Archetype Strength: Dominance vs balanced personality
- Personality Complexity: Focused/balanced/complex profiles
- Archetype distribution across all users
- Average completion times by archetype
- Total submission tracking
- Performance metrics
- Email Collection: User enters email address with validation
- Introduction: Welcome screen with instructions and tips
- Countdown: 3-second countdown to build anticipation
- Quiz Questions: 15 questions with progress tracking
- Results Processing: Calculation of archetype and insights
- Results Display: Comprehensive results with multiple tabs
- Email Delivery: Automated email with detailed results
- Primary: #4361ee (Vibrant Blue)
- Secondary: #3a86ff (Sky Blue)
- Tertiary: #4cc9f0 (Cyan)
- Accent: #f72585 (Pink)
- Success: #4bc06c (Green)
- Warning: #ff9f1c (Orange)
- Headers: Playfair Display (Serif)
- Body: Poppins (Sans-serif)
- Consistent spacing and hierarchy
- Desktop: 768px+
- Tablet: 481px - 767px
- Mobile: 480px and below
- Email Validation: Client and server-side validation
- Data Sanitization: All inputs sanitized before database storage
- Privacy Focused: No tracking beyond essential quiz functionality
- Secure Storage: Encrypted database storage through Val Town
The application follows Val Town best practices with HTTP val naming:
- Main Application:
index.http.ts
- Primary entry point users visit - Admin Dashboard:
admin.http.ts
- Analytics and data management - Database: Automatic SQLite initialization with proper indexing
- Email: Enhanced email service with HTML templates following Val Town standards
- Frontend: Served as static files with mobile-responsive design
Update config.ts
with your settings:
adminEmail
: Your email for admin notificationssiteUrl
: Your Val Town URLhashSalt
: Unique salt for privacy protection
VAL_TOWN_API_KEY
: Automatically provided by Val Town- Optional:
ADMIN_EMAIL
,SITE_URL
,HASH_SALT
for production overrides
- Lazy Loading: Components loaded as needed
- Efficient Rendering: Optimized React components
- CSS Optimization: Custom properties and efficient selectors
- Database Queries: Indexed and optimized queries
- Manual testing across all user flows
- Cross-browser compatibility testing
- Mobile responsiveness testing
- Email delivery testing
- A/B Testing: Different quiz variations
- Advanced Analytics: User behavior tracking
- Social Features: Community building around archetypes
- API Integration: Connect with event platforms
- Caching: Redis integration for performance
- CDN: Static asset optimization
- Advanced Security: Rate limiting and CSRF protection
- Monitoring: Performance and error tracking