Voty is a simple voting application that simulates a basic voting system. It's inspired by a tweet from Zan. The application is designed with performance in mind, leveraging modern Rust frameworks and tools to deliver a robust and efficient system.
I developed an API using Actix Web, a powerful Rust web framework. The API features a single endpoint where users can submit their votes. To ensure optimal performance, the votes are sent to CrabMQ for processing and storage.
I implemented a Vote Processor using Tokio, a runtime for writing reliable, asynchronous applications in Rust. The processor retrieves votes from the queue and stores them in a PostgreSQL database.
- 🛠 API to Receive Votes
An endpoint to submit votes. - 🔐 One Vote per User
Ensures that each user can only vote once. - 📨 Queue Service
Integrates with CrabMQ to queue votes for processing. - ⚙️ Connection Handler
Manages connections to the queue. - 📨 Message Handler
Processes messages retrieved from the queue. - 🗃 Vote Processor
Subscribes to the queue and processes incoming votes. - 🗄 Store Votes in Database
Uses PostgreSQL for storing votes. - 🧪 Load Test
Includes a basic load test, which can be further improved. - 🐳 Dockerized Application
The entire application is containerized using Docker for easy deployment.