A real-time polling system built with Spring Boot (backend) and React (frontend). This application allows users to create polls, vote on options, and view real-time updates using WebSocket communication. It also includes features like rate limiting and Docker deployment for production readiness.
-
Backend:
- REST API for creating polls and voting.
- Real-time updates using WebSocket.
- Rate limiting with Resilience4j (3 votes per minute per user).
- PostgreSQL for production and H2 for development.
-
Frontend:
- Create polls with dynamic options.
- Vote on polls and view real-time results.
- Visualize poll results using charts (react-chartjs-2).
-
Deployment:
- Dockerized backend and frontend.
- Docker Compose for easy setup with PostgreSQL.
-
Backend:
- Spring Boot
- Spring WebSocket
- Spring Data JPA
- Resilience4j
- H2 Database (development)
- PostgreSQL (production)
-
Frontend:
- React (TypeScript)
- Axios (HTTP requests)
- react-chartjs-2 (charts)
- @stomp/stompjs (WebSocket client)
-
Deployment:
- Docker
- Docker Compose
- Java 17
- Node.js 16+
- Docker and Docker Compose
- PostgreSQL (for production)
git clone https://github.com/your-username/polling-system.git
cd polling-system
- Navigate to the backend directory:
cd backend
- Build the Spring Boot application:
mvn clean install
3.Build the Docker image:
docker build -t polling-backend .
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
3.Build the Docker image:
docker build -t polling-frontend .
Start the application:
docker-compose up
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
For a step-by-step guide on how to build and deploy this project, check out my blog post:
👉 Real-Time Polling System: Step-by-Step Guide