A modern, responsive polling application built with Frappe Framework and Vue.js
- Create Polls: Easy-to-use interface for creating detailed polls
- Smart Status Management: Automatic handling of Active, Upcoming, and Ended polls
- Real-time Participation: Vote on active polls with instant feedback
- Results Visualization: View poll results with clear data presentation
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- Target Audience: Restrict polls to specific users, Frappe roles, or departments (ERPNext/HRMS)
- Expiry Notifications: Notify poll owners and eligible voters before a poll closes
- Clean Card-based Layout: Professional, easy-to-scan poll cards
- Emoji Icons: Lightweight design without external icon dependencies
- Status Indicators: Color-coded badges for poll status (Active/Upcoming/Ended)
- Loading States: Smooth loading animations and empty state handling
- Hover Effects: Interactive elements with smooth transitions
- Frappe Framework Backend: Robust, scalable backend with DocType management
- Vue.js Frontend: Modern, reactive frontend with Composition API
- Production Ready: CSRF token security for production deployments
- Error Handling: Comprehensive validation and user-friendly error messages
- Tailwind CSS: Utility-first styling for consistent design
- Frappe UI Components: Native integration with Frappe UI library
- Date Management: Smart date formatting and poll scheduling
- Audience Resolution: Efficiently resolves allowed voters by user, role, and department membership
- Scheduled Tasks: Hourly expiry notification job scoped to the target audience
- Frappe Bench installed
- Node.js and Yarn for frontend development
- Python 3.10+ for backend
- ERPNext/HRMS (optional) β required only for department-based audience targeting
- Get the app:
cd $PATH_TO_YOUR_BENCH
bench get-app https://github.com/fawaaaz111/polling.git- Install the app:
bench install-app polling- Start development (optional):
# For backend development
bench start
# For frontend development
cd apps/polling/frontend
yarn dev- Clean, card-based layout showing all available polls
- Status badges indicating poll state
- Interactive voting and results buttons
- Easy poll creation with title, description, and date settings
- Status tracking throughout poll lifecycle
- Responsive design for all devices
polling/
βββ polling/
β βββ doctype/
β β βββ poll/ # Poll DocType β title, dates, status, target audience, options
β β βββ poll_option/ # Child table β vote options with vote counts
β β βββ poll_vote/ # Submittable DocType β records each cast vote
β β βββ poll_target/ # Child table β audience rows (user / role / department)
β β βββ poll_result/ # Virtual DocType β computed results on-the-fly
β βββ tasks.py # Scheduled tasks (hourly expiry notifications)
β βββ permissions.py # Owner-based access control for Poll Vote
β βββ patches/ # Database migration patches
β βββ www/ # Web pages served by Frappe
β βββ public/ # Static assets
frontend/
βββ src/
β βββ pages/
β β βββ Polls.vue # Main polls listing + voting interface
β β βββ PollResults.vue # Results page with vote distribution
β βββ components/ # Reusable Vue components
β βββ data/
β β βββ session.js # Reactive session / auth state
β βββ router.js # Vue Router with auth guards
βββ package.json # Dependencies and scripts
βββ vite.config.js # Build configuration
| DocType | Type | Description |
|---|---|---|
| Poll | Regular | Core document β title, dates, status, options, target audience |
| Poll Option | Child table | Vote options; vote_count increments on submission |
| Poll Vote | Submittable | One record per cast vote; enforces audience, date, and dedup checks |
| Poll Target | Child table | Audience rows: user, role, or department (ERPNext/HRMS) |
| Poll Result | Virtual | Computes vote distribution on-the-fly from Poll + Poll Option data |
When a poll has rows in its target_audience child table, only matching users may vote and receive expiry notifications. A voter is allowed if they match any of the following:
- User β their Frappe user account is listed explicitly
- Role β they hold one of the listed Frappe roles
- Department β they are an active Employee in one of the listed departments (requires ERPNext/HRMS)
Polls with an empty target_audience are open to all users.
- Clone and install:
bench get-app https://github.com/fawaaaz111/polling.git
bench install-app polling- Enable developer mode:
bench set-config developer_mode 1- Start frontend development:
cd apps/polling/frontend
yarn install
yarn dev- Build for production:
cd apps/polling/frontend
yarn build
# or
bench build --app polling- Production deployment:
# After building, restart your server
bench restart
# The app handles CSRF tokens automatically for secure production useThis app uses pre-commit for code formatting and linting:
cd apps/polling
pre-commit installConfigured tools:
- ruff: Python linting and formatting
- biome: JavaScript/Vue.js linting and formatting (
yarn lint) - eslint: JavaScript linting (pre-commit hook)
- prettier: JavaScript/Vue/SCSS formatting (pre-commit hook)
# Run all app tests
bench run-tests --app polling
# Run tests for a specific DocType
bench run-tests --app polling --doctype "Poll Vote"
bench run-tests --app polling --doctype "Poll"- Frappe Framework: Core backend framework
- Python 3.10+: Runtime environment
- Vue.js 3.x: Progressive JavaScript framework
- Tailwind CSS: Utility-first CSS framework
- Frappe UI: Native Frappe component library
- Vite: Fast build tool and dev server
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Install pre-commit:
pre-commit install - Make your changes and ensure they pass all checks
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow the existing code style and patterns
- Write clear commit messages
- Add comments for complex logic
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Frappe Community: Frappe Forum
- Frappe Framework for the robust backend
- Vue.js for the reactive frontend
- Tailwind CSS for the styling system
- Frappe UI for native components