• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
Bernard_Lori

Bernard_Lori

Lori_Voting_system

Public
Like
Lori_Voting_system
Home
Code
4
README.md
E
backend.ts
index.html
script.js
Branches
2
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
Code
/
Search
README.md

Lori End-of Year Employee Recognition System 😊

A comprehensive, professional employee recognition voting system with logistics theming, bidirectional navigation, regional winner displays, PIN-protected resets, multi-user data aggregation, and Excel export functionality across 9 award categories.

🎨 System Theme & Branding

Sky-Blue Logistics Theme

  • Professional sky-blue gradient background with highway atmosphere
  • Animated truck in motion watermark - semi-transparent truck continuously driving across screen
  • Highway elements: Road lines, guardrails, and cloud formations
  • System name in blue: "Lori End-of Year Employee Recognition 😊"
  • Truck-themed visualizations throughout the interface

🏠 Sequential Navigation System

Enforced Category-by-Category Flow

  • Vote-to-Proceed: Must vote in current category before advancing to next
  • Sequential Navigation: Cannot skip categories - ensures complete participation
  • Previous Category: Move back freely to review earlier categories
  • Smart Button States: Next button disabled until vote is cast
  • Progress Tracking: Visual progress bar showing current category (X of 9)
  • Final Results Page: Special page after completing all 9 categories

🗳 Advanced Multi-User Voting System

Enhanced Voting Logic & Display

  • Single vote per category per user: Strict one-vote rule enforcement
  • Multi-user data aggregation: All votes from all users are combined in real-time
  • Server-side data storage: Uses SQLite database for persistent, shared data
  • Regional organization: Nominees organized by East Africa 🇰🇪, West Africa 🇳🇬, and Global/Tech 🌐
  • Cascading dropdowns: Region selection updates nominee options
  • Immediate results: Votes become visible instantly after casting
  • Regional results display: Top 3 results shown per region with clear regional winners

Regional Winner Display

  • Top 3 per region: Each region shows its top 3 performers with medals (🥇🥈🥉)
  • Clear regional winners: Prominent winner display for each region
  • Regional icons: Flag emojis and icons for visual region identification
  • Vote counts: Detailed vote tallies for each nominee
  • Real-time updates: Results update immediately across all users

Truck-Themed Analytics

  • Truck bar charts: Vote bars styled as extending trucks
  • Smooth animations: Truck drive animations when votes are cast
  • Visual hierarchy: Gold highlighting for top performers
  • Vote counts: Clear display of vote totals for each nominee

🌍 Regional Organization

East Africa (🇰🇪)

  • Benedict Kilonzo, Caroline Kyalo, Collins Nyandiga, Edward Mputhia
  • Haron Ruttoh, Hubert Kibet, John Kaluu, Lilian Omore
  • Omollo Oduor, Oscar Achieng

West Africa (🇳🇬)

  • Anthony Benedict, Anthony Victor, Augustine Wonah, Bukola Davies
  • Christian Ifeadi, Cynthia Odufalu, David Onyeche, Edet Isong
  • Ezekiel Kwaji, Fatima Adole, Great Chukwuka, Isaiah Iliya
  • Ismail Babatunde, Joy Ojoko, Justina Satumari, Maryam Yusuf
  • Mercy Ugwuozor, Moyosola Ojokuku, Oluwabukunmi Ogunrinde, Oluwaseyi Popoola
  • Omolola Adegbenro, Samuel Agbo, Sarah Morakinyo, Shafiu Ibrahim
  • Shaibu Abdulbasir, Stella Ndubueze, Amarachi Echibe, Anike Yetunde Paul
  • Olisekeni Lucky Godspower, Nelson Ndimele, Ejugbo Anthony, Jamilu Dan
  • Olayiwola Ridwan, Iyede Philip, Mebude Adebayo, Elugba Francis
  • Ogunwolu Oluwasegun, James Mmerife, Ademola Olalekan, Omojola Adewale
  • Ofishe Franklin, Oyekola Jamal, Akinola Yusuf, Umar Dauda
  • Gift Okon, Peter Edu, Adam Jubril

Global / Tech (🌐)

  • Alan Elliott, Arthur Olowo, Bernard Njehia, Edwin John Obino
  • Fondo Harrison, Ghola Kioko, Leslie Burugu, Oliver Munala
  • Pedro Faria, Tomilade Arowosegbe, William Mule, Zhena Carmela

🏆 9 Award Categories

1. The Team Player of the Year Category

"Awarded to the colleague who is always supportive, collaborative, and dependable — the glue that keeps the team functioning effortlessly."

2. The Innovation Catalyst Award Category

"Celebrates the person who introduced fresh ideas, creative solutions, or improvements that moved the company forward."

3. The Customer Hero Award Category

"Recognizes the employee who consistently delivers outstanding service to clients or internal stakeholders."

4. The Rising Star Award Category

"Given to the employee who has shown rapid growth, potential, and significant improvement over the year."

5. The Problem Solver Award Category

"Honors the person who can untangle complex issues, provide clarity during challenges, and deliver reliable solutions."

6. The Culture Champion Award Category

"For the colleague who actively nurtures a positive, inclusive, engaging, and high-energy workplace culture."

7. The Leadership in Action Award Category

"Awarded to someone who stepped up as a leader—formally or informally—by inspiring others, taking ownership, and driving results."

8. The Office Energizer Award Category

"For the colleague who keeps energy, morale, and team vibes high through humor, positivity, personality, or motivation."

9. The Smooth Operator Award Category

"For the person who stays calm under pressure, handles chaos with grace, and gets things done with effortless style."

🔐 Enhanced Security & Data Management

Final Results & System Management

  • Final Results Page: Comprehensive summary after completing all categories
  • PIN-Protected Full Reset: Reset all data with PIN 2682 from final page
  • System Statistics: Total votes, unique participants, active regions
  • Complete Data Reset: Clear all votes and start fresh (irreversible)

Multi-User Data Architecture

  • Server-side SQLite Database: Persistent storage for all votes and user data
  • Real-time Data Aggregation: All user votes are combined instantly
  • Unique User Tracking: Each browser session gets a unique identifier
  • Cross-session Persistence: Data persists across browser sessions and devices
  • Concurrent User Support: Multiple users can vote simultaneously

Export Capabilities

  • Simple Winners CSV: Clean table format with categories as rows, regions as columns
  • Winner-Only Data: Focused export showing just the winners per category per region
  • Professional Format: Ready for business reporting and presentations

📊 User Experience Features

Voting Flow

  1. Region Selection: Choose from East Africa, West Africa, or Global/Tech
  2. Nominee Selection: Dropdown updates based on selected region
  3. Vote Casting: Single click to cast vote (one per category per user)
  4. Immediate Feedback: Results update instantly with animations
  5. Vote Confirmation: Clear indication of completed votes

Visual Feedback

  • Progress Tracking: Category progress bar (X of 9)
  • Vote Status: "Voted" badges for completed categories
  • Toast Notifications: Success/warning messages for all actions
  • Truck Animations: Drive effects when votes are cast
  • Medal System: 🥇🥈🥉 for top three performers

Results Display

  • Top 3 Focus: Only show top three vote getters per region
  • Winner Highlight: Clear winner display with vote count
  • Empty State: Encouraging message when no votes exist
  • Real-time Updates: Results appear immediately after first vote across all users

🚛 Technical Implementation

Backend Architecture

  • Hono Framework: Fast, lightweight web framework
  • SQLite Database: Persistent server-side storage
  • RESTful API: Clean API endpoints for all operations
  • Error Handling: Comprehensive error handling and logging

Database Schema

-- Votes table: Stores aggregated vote counts CREATE TABLE lori_employee_votes_v1 ( id INTEGER PRIMARY KEY AUTOINCREMENT, category_id INTEGER NOT NULL, nominee TEXT NOT NULL, votes INTEGER DEFAULT 0, UNIQUE(category_id, nominee) ); -- User votes table: Tracks individual user votes CREATE TABLE lori_user_votes_v1 ( id INTEGER PRIMARY KEY AUTOINCREMENT, user_id TEXT NOT NULL, category_id INTEGER NOT NULL, nominee TEXT NOT NULL, voted_at DATETIME DEFAULT CURRENT_TIMESTAMP, UNIQUE(user_id, category_id) );

API Endpoints

  • GET /api/votes - Retrieve all vote counts
  • GET /api/user-votes/:userId - Get user's voting history
  • POST /api/vote - Cast a vote
  • POST /api/reset-all - Reset all data (PIN protected)
  • GET /api/stats - Get system statistics

Frontend Architecture

  • Vanilla JavaScript: Clean, dependency-free implementation
  • TailwindCSS: Professional styling with sky-blue theme
  • Font Awesome: Comprehensive icon system
  • CSS Animations: Smooth truck driving and vote animations
  • Async/Await: Modern JavaScript for API communication

Data Flow

// User votes → API call → Database update → Real-time UI update vote(categoryId, nominee) → POST /api/vote → SQLite → renderCategory() // Multi-user aggregation User A votes → Database updated → User B sees updated results immediately

🎯 Updated Usage Instructions

Sequential Voting Process

  1. Vote in Current Category: Select region → Choose nominee → Cast vote
  2. View Regional Results: See top 3 results per region with clear winners
  3. Advance Sequentially: "Next Category" enabled only after voting
  4. Review Previous: Use "Previous Category" to review earlier categories
  5. Complete All Categories: Must vote in all 9 categories to reach final results

Final Results Management

  1. Access Final Page: After Category 9, click "View Final Results"
  2. Download Winners CSV: Simple table with winners per category per region
  3. Reset All Data: PIN-protected full system reset (PIN: 2682)
  4. View Statistics: See total votes, unique participants, and active regions

Navigation Rules

  • Sequential Progression: Cannot skip categories without voting
  • Free Review: Move back to any previous category anytime
  • Vote Requirement: Must vote in current category to proceed
  • Final Access: Final results page only accessible after completing all categories

CSV Export Format

Category                    | East Africa 🇰🇪 | West Africa 🇳🇬 | Global/Tech 🌐
The Team Player Award       | Winner (X votes) | Winner (X votes) | Winner (X votes)
The Innovation Catalyst     | Winner (X votes) | Winner (X votes) | Winner (X votes)
...                        | ...              | ...              | ...

🚀 Final System Implementation

Core Changes Implemented

✅ Multi-User Data Aggregation: Server-side SQLite database for shared voting data
✅ Real-time Vote Combination: All user votes are instantly aggregated and displayed
✅ Fixed Reset Functionality: PIN-protected reset now works correctly via API
✅ Sequential Navigation: Must vote in each category before proceeding to next
✅ Final Results Page: Comprehensive management page after completing all categories
✅ Simple Winners CSV: Clean table format with categories × regions matrix
✅ Enhanced Statistics: Real-time stats showing total votes and unique participants

Data Architecture

  • Server-side Storage: SQLite database replaces localStorage for multi-user support
  • Unique User Tracking: Each browser session gets a unique identifier
  • Vote Aggregation: All votes from all users are combined in real-time
  • Data Persistence: Votes persist across sessions and devices
  • Concurrent Support: Multiple users can vote simultaneously

Security Features

  • PIN Protection: Reset functionality requires PIN 2682
  • Input Validation: All API inputs are validated
  • Error Handling: Comprehensive error handling with user feedback
  • Data Integrity: Database constraints prevent duplicate votes

Performance Features

  • Efficient Queries: Optimized database queries for fast response times
  • Real-time Updates: Immediate UI updates after vote casting
  • Minimal Data Transfer: Only necessary data is transmitted
  • Caching Strategy: Local state caching with server synchronization

🌟 System Goals Achieved

✅ Multi-user data aggregation with server-side SQLite database
✅ Fixed reset functionality with proper PIN protection via API
✅ Real-time vote combination across all users and sessions
✅ Bidirectional category navigation with Previous/Next controls
✅ Regional winner displays with top 3 per region
✅ Excel export capability for comprehensive results
✅ Engaging logistics-branded experience with truck animations
✅ Regional nominee organization with cascading dropdowns
✅ Professional sky-blue theme with animated watermark
✅ Single vote restriction with clear feedback
✅ Enhanced results display with regional breakdown
✅ Complete employee recognition system ready for deployment

🔧 Issues Resolved

Issue 1: "Reset All Data" Button Failure ✅ FIXED

  • Root Cause: Reset functionality was using localStorage only
  • Solution: Implemented server-side reset API with PIN protection
  • Result: Reset button now properly clears all data from database

Issue 2: Data Isolation/Non-Combination ✅ FIXED

  • Root Cause: localStorage is client-side and isolated per browser
  • Solution: Migrated to server-side SQLite database with real-time aggregation
  • Result: All user votes are now combined and displayed in real-time

The system now delivers a comprehensive, professional employee recognition experience that combines logistics theming with robust multi-user voting functionality, real-time data aggregation, working reset functionality, and professional Excel export capabilities.

Code
README.md
E
backend.ts
index.htmlscript.js
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.