A real-time voting application built with Node.js and WebSockets.
Caption: create or enter voting screen
- Create voting rooms
- Real-time voting with instant results
- Host controls for starting and ending votes
- Responsive design for desktop and mobile devices
- Node.js
- Express.js
- WebSocket (ws)
- SQLite3
- JWT
- Sequelize
- UUID
- Node.js (v12 or higher)
- npm (Node Package Manager)
-
Clone the repository:
git clone https://github.com/yourusername/simple-vote-app.git
-
Navigate to the project directory:
cd simple-vote-app
-
Install dependencies:
npm install
-
Start the server:
node server.js
-
Open your browser and visit
http://localhost:3000
(or the port you've configured).
- Create a new room by clicking "Create Room" on the homepage.
- Share the room link with participants.
- As the host, start the voting when ready.
- Participants can cast their votes in real-time.
- View live results as votes are submitted.
- End the voting session to finalize results.
This project can be run using Docker. Follow these steps to build and run the Docker container:
-
Build the Docker image:
docker build -t simple-vote-app .
-
Run the Docker container:
docker run -p 3000:3000 -v $(pwd)/data:/app/data simple-vote-app
Your application will be accessible at http://localhost:3000
.
Alternatively, you can use Docker Compose to run the application:
-
Make sure you have Docker Compose installed.
-
Run the following command in the project root:
docker-compose up -d
This will build the image if it doesn't exist and start the container in detached mode.
The SQLite database file is stored in the /app/data
directory inside the container. This directory is mapped to the ./data
directory in your project root on the host machine. This ensures that your database data persists even when the container is stopped or removed.
If your application uses environment variables, create a .env
file in the project root and add the following line to the docker-compose.yml
file under the app
service:
env_file:
- .env
Then run the container with:
docker-compose up -d
Contributions are welcome! Please feel free to submit a Pull Request.
- Thanks to all contributors who have helped with this project.
- Inspired by the need for simple, real-time voting solutions.
This project can be run using Docker. Follow these steps to build and run the Docker container:
-
Build the Docker image:
docker build -t ai-chat-app .
-
Run the Docker container:
docker run -p 3000:3000 ai-chat-app
Your application will be accessible at http://localhost:3000
.
Alternatively, you can use Docker Compose to run the application:
- Make sure you have Docker Compose installed.
- Run the following command in the project root:
docker-compose up
This will build the image if it doesn't exist and start the container.
If your application uses environment variables, create a .env
file in the project root and run the container with: