diff --git a/README.md b/DESIGN.md similarity index 100% rename from README.md rename to DESIGN.md diff --git a/REAME.md b/REAME.md new file mode 100644 index 0000000..f755c27 --- /dev/null +++ b/REAME.md @@ -0,0 +1,163 @@ +
+ +

LivePoll - Live Polling Platform

+
+ +LivePoll is an interactive web application designed to simplify the process of creating, participating in, and managing polls. It combines user-friendly features with real-time updates to deliver a seamless polling experience📊. + +## Features + +- User can signup and login using his credentials, used cookie based authentication with jwt. +- User can browse all the Polls created by other users in a pagination format and click on view to view the poll. +- In poll view page user can vote on the poll and see the result of the poll live with chart using sockt.io. +- User can bookmark the poll and see the bookmarked poll in bookmark page. +- In user dashboard user can see the their details and manage their poll. +- By clicking on the create poll button user can create a new poll and add options to the poll. +- Used react-toastify for showing the error and success message. +- Used chart.js and scocket.io-client for showing the poll result live in chart in poll view page. +- Used daisyui and tailwind for styling the UI of the application for responsive design. + +## Links + +- [Live Website](https://livepoll.vercel.app/) +- [Backend Routes Doc]() + +## Preview Images + +### Home Page + + + +### Polls Page + + + +### Login Page + + + +### Signup Page + + + +### Poll Votting Page + + + +### Dashboard Page + + + +### Create Poll Page + + + +### Bookmarks Page + + + +## Tech Stack + +### Frontend + +Framework & Routing: `ReactJS`, `React Router` +State Management: `Zustand`, `React Query` +Real-Time & Charts: `Socket.io-client`, `react-chartjs-2` +Styling: `TailwindCSS`, `DaisyUI` +Notifications & Icons: `React-Toastify`, `React Icons` + +### Backend + +Framework & Authentication: `Node.js`, `Express.js`, `JWT`, `bcrypt` +Validation & Documentation: `Zod`, `Swagger-jsdoc` +Real-Time Communication: `Socket.io` +Database & ORM: `Mongoose` + +### Others + +API Communication: `Axios` + +## Installation and Setup + +### Prerequisites + +- Node.js and npm/yarn installed. +- MongoDB database set up locally or on a cloud provider. + +### Steps + +1. Clone the Repository + + ```bash + git clone https://github.com/ManikMaity/LivePoll.git + cd LivePoll + ``` + +2. Backend Setup + + - Navigate to the backend directory: + ```bash + cd backend + ``` + - Install dependencies: + ```bash + npm install + ``` + - Create a `.env` file and add the following: + `env + PORT=3000 + DB_CONNECTION="your mongodb url" + SALT_ROUNDS=6 + JWT_PRIVATE="your jwt private key" + CLIENT_URL="your client url" + ` + - Start the server: + ```bash + npm run dev + ``` + +3. Frontend Setup + + - Navigate to the frontend directory: + ```bash + cd frontend + ``` + - Install dependencies: + ```bash + npm install + ``` + - Update `.env` file with the backend URL (e.g., `http://localhost:3000`). + - Start the development server: + ```bash + npm start + ``` + +4. Access the Application + - Open a browser and go to `http://localhost:5173`. + +--- + +### To Switch Between Local and Deployed Environments + +- Update backend `.env` with: + ```env + BACKEND_URL=http://localhost:3000 + ``` +- Update frontend Axios base URL to: + ```javascript + axios.defaults.baseURL = "http://localhost:3000/api/v1"; + ``` +- Update the Socket.io URL in the voting page: + ```javascript + const socket = io("http://localhost:3000"); + ``` + +--- + +## Usage + +- Navigate to the `frontend` directory and run `npm run dev` to start the development server. +- Navigate to the `backend` directory and run `npm run dev` to start the server. +- Open a browser and go to `http://localhost:5173` to access the application. + +## Future Improvements \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index 424d38a..b4a0ce6 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,7 +2,7 @@ - + LivePoll diff --git a/frontend/public/favicon-livepoll.ico b/frontend/public/favicon-livepoll.ico new file mode 100644 index 0000000..bb0358e Binary files /dev/null and b/frontend/public/favicon-livepoll.ico differ diff --git a/frontend/public/vite.svg b/frontend/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/frontend/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/src/assets/react.svg b/frontend/src/assets/react.svg deleted file mode 100644 index 6c87de9..0000000 --- a/frontend/src/assets/react.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/images/Home.png b/images/Home.png new file mode 100644 index 0000000..ea0ee8c Binary files /dev/null and b/images/Home.png differ diff --git a/images/Screenshot 2024-11-14 101710.png b/images/Screenshot 2024-11-14 101710.png new file mode 100644 index 0000000..793cbf9 Binary files /dev/null and b/images/Screenshot 2024-11-14 101710.png differ diff --git a/images/bookmark.png b/images/bookmark.png new file mode 100644 index 0000000..8ae3f9b Binary files /dev/null and b/images/bookmark.png differ diff --git a/images/createPollPage.png b/images/createPollPage.png new file mode 100644 index 0000000..79e8588 Binary files /dev/null and b/images/createPollPage.png differ diff --git a/images/dashboard.png b/images/dashboard.png new file mode 100644 index 0000000..023c37f Binary files /dev/null and b/images/dashboard.png differ diff --git a/images/imageGIF.gif b/images/imageGIF.gif new file mode 100644 index 0000000..d05b610 Binary files /dev/null and b/images/imageGIF.gif differ diff --git a/images/pollsPage.png b/images/pollsPage.png new file mode 100644 index 0000000..31e9cf7 Binary files /dev/null and b/images/pollsPage.png differ diff --git a/images/signup.png b/images/signup.png new file mode 100644 index 0000000..3f30f7d Binary files /dev/null and b/images/signup.png differ diff --git a/images/votingPage.png b/images/votingPage.png new file mode 100644 index 0000000..ffcdd01 Binary files /dev/null and b/images/votingPage.png differ