This is the frontend of a modern polling application, built with React 18, Vite, and Tailwind CSS. It provides a clean, responsive user interface for poll creation, voting, and real-time result visualization.
- Authentication: Only authenticated users can create polls.
- Poll Creation: Authenticated users can create polls with 2-5 options.
- Voting: Any user (including public/unauthenticated) can vote once per poll.
- Live Results: Users see up-to-date poll results immediately after voting.
- Protected Routes: Poll creation is protected; voting and viewing are public.
- Modern UI/UX: Built with Tailwind CSS and Lucide icons for a professional look.
- React 18
- Vite
- React Router v6
- Tailwind CSS
- Axios
src/components/– Reusable UI componentssrc/pages/– Page-level components (Home, Poll, Create, Login)src/contexts/– React Context for authenticationsrc/services/– API abstraction layer
- Node.js (v16 or higher)
- npm
npm installnpm run dev- The app will be available at
http://localhost:5173 - The frontend expects the backend API to be running at
http://localhost:3000
npm run buildnpm run lint- Separation of Concerns: All business logic is abstracted into services and contexts.
- State Management: Authentication state is managed globally via React Context.
- API Integration: All API calls are centralized and automatically include authentication tokens when available.
- User Experience: The interface is responsive, accessible, and provides clear feedback for all actions.