This is the frontend application for the "Would You Rather" polling app. The frontend is built using React, TypeScript, and Vite, and it communicates with the backend API to create, vote on, and display poll results in real-time.
- User interface for creating and participating in polls.
- Real-time updates using WebSockets.
- Responsive design with Radix UI components.
- API integration with Axios.
- State management and routing with React and React Router.
Clone this repository to your local machine:
git clone https://github.com/luisggf/polls-front
cd <repository-directory>The package.json file is already configured with all the necessary dependencies. To install them, simply run:
npm installThe following scripts are available in the package.json file:
-
Start the development server:
This command will start the Vite development server, enabling hot module replacement (HMR) and fast feedback during development.
npm run dev
- React: Core library for building user interfaces.
- React DOM: The entry point for React into the DOM.
- React Router DOM: For handling routing in the application.
- TypeScript: For static typing in JavaScript.
- Vite: For fast and optimized development and build processes.
- Radix UI: For accessible and customizable UI components.
- Tailwind CSS: For utility-first CSS styling.
- Axios: For making HTTP requests to the backend API.
- Socket.io Client: For real-time communication with the backend.
The project is structured as follows:
src/
├── assets/ # SVG and Images used for styling
├── components/ # Reusable UI Components
├── App.tsx # Main application component
├── main.tsx # Application entry point
└── index.html # Main HTML file
Tailwind CSS is used for styling the application. If you need to customize the default styles, you can modify the Tailwind configuration file (tailwind.config.js) in the project.
To run the application in development mode:
npm run devEnsure that the backend API is running and accessible.