A modern React application for the BITS Pilani unified voting platform featuring elections, course ratings, and department/club voting.
- Node.js 16+
- npm or yarn
- Clone and navigate to frontend
cd pollz-frontend/
- Install dependencies
npm install
- Setup environment variables
cp .env.example .env
# Edit .env with your API endpoints
- Run development server
npm start
Application will open at http://localhost:3000
npm start
- Run development servernpm run build
- Build for productionnpm test
- Run tests
REACT_APP_API_URL
- Backend API URL (default: http://localhost:6969/api)REACT_APP_WS_URL
- WebSocket URL (default: ws://localhost:1401)
src/
├── components/ # Reusable UI components
│ ├── Navbar.js # Navigation bar with auth
│ └── GoogleAuthButton.js # Google login component
├── pages/ # Main page components
│ ├── LandingPage.js # Home page with timeline
│ ├── SUElection.js # Student Union elections
│ ├── HuelVoting.js # Course rating system
│ └── DepartmentClubs.js # Department/club voting
├── context/ # React Context providers
│ └── AuthContext.js # Authentication state
├── App.js # Main app component
├── index.js # App entry point
└── index.css # Global styles and Tailwind
- Hero section with BITS Pilani campus image
- Interactive election timeline (2024/2025)
- Shows previous election results with candidate photos
- Features overview cards
- Candidate profiles with manifestos
- Real-time vote counts and percentages
- Position-based voting (President, General Secretary)
- Voting statistics dashboard
- Course rating system with multiple parameters:
- Grading (fairness and transparency)
- Toughness (difficulty level)
- Overall (average rating)
- Search and filter by department
- Anonymous comments and reviews
- Upvote/downvote system
- Ranked voting for departments and clubs
- Real-time leaderboards
- Achievement highlights
- Community comments
- Separate tabs for departments vs clubs
- Google OAuth integration for secure login
- User profile display in navbar
- Protected voting actions (login required)
- Anonymous comments for privacy
Create a .env
file:
REACT_APP_GOOGLE_CLIENT_ID=your-google-client-id
REACT_APP_API_BASE_URL=http://localhost:8000/api
REACT_APP_WEBSOCKET_URL=ws://localhost:1401/ws/chat/live
- BITS Pilani Brand Colors:
- Primary Blue:
#003d7a
- Gold:
#ffc107
- Primary Blue:
- Custom Animations:
- Fade-in effects
- Slide-up transitions
- Hover animations
- Responsive Design:
- Mobile-first approach
- Tablet and desktop optimized
- Flexible grid layouts
- Responsive navigation with mobile menu
- Google authentication integration
- Active route highlighting
- User profile display
- Year selector (2024/2025)
- Animated vote percentage bars
- Candidate photo display
- Results visualization
- Interactive vote buttons
- Real-time vote counts
- Progress bars and percentages
- Comment systems
- All voting actions require authentication
- Comments are anonymous for honest feedback
- Vote counts are simulated (connect to backend API)
- Images should be placed in
public/images/
directory - Responsive breakpoints: sm (640px), md (768px), lg (1024px)
# Build production bundle
npm run build
# Deploy build/ directory to your hosting platform
- Follow React best practices
- Use Tailwind CSS for styling
- Implement responsive design
- Add error handling for API calls
- Test on multiple screen sizes
Built for BITS Pilani students, by students 🎓