Before running the application, ensure the following software is installed:
DockerDocker needs to be running at the local computer
Pull the backend docker image:
docker pull kristofferwagen/poll-app-container:backend
Run the container:
docker run -d -p 3000:3000 kristofferwagen/poll-app-container:backend
Pull the frontend docker image:
docker pull kristofferwagen/poll-app-container:frontend
Run the container:
docker run -d -p 5173:80 kristofferwagen/poll-app-container:frontend
NOTE you should run the backend container before running the frontend container.
After doing this, the application will be available at http://localhost:5173/
If you want to take a closer look to how and where the images are hosted, you can check them out here:
https://hub.docker.com/repository/docker/kristofferwagen/poll-app-container/general
The backend server runs on http://localhost:3000 and provides the following functionalities:
- Creating polls
- Fetching polls and their vote options
- Updating vote counts
- Clearing the database
The frontend runs on http://localhost:5173 and enables users to:
- Create polls with multiple vote options
- Vote on poll options
- View all polls and their respective vote counts
- Clear the database from the interface
The Postgre database is dynamically created with the required user and privileges when running the containers. When the backend starts the tables in the database will be generated automatically and all data will be stored in MongoDB and persistently in PostgreSQL.
- Make sure you have the latest version of the backend image. You can double check by pulling once more, see
How to run backend
- Make sure you have the latest version of the frontend image. You can double check by pulling once more, see
How to run frontend
- Make sure that the ports
3000for the backend,5672for RabbitMQ,5173for frontend and5432for PostgreSQL are not blocked by the firewall. - Make sure that all the listed ports are free and are not being used by any other processes.