Skip to content

A platform where users can create polls and everyone can vote in them. It uses a MongoDB Atlas database to store users and polls.

License

Notifications You must be signed in to change notification settings

SSbit01/voting-app

Repository files navigation

Voting App

This is a Next.js platform created by SSbit01 where users can create polls and everyone can vote in them. It uses a MongoDB Atlas database to store users and polls.


Required environment variables

  • MONGO_URI : MongoDB URI string
  • COOKIE_NAME : e.g. voting-app_cookie
  • COOKIE_PASSWORD : complex password at least 32 characters long

Remember to install local packages, I used pnpm package manager in this project, but of course you can use any other package manager like npm or yarn.


This project works like any other Next.js project. The following scripts can be found in the package.json file and refer to the different development stages.

"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"

To Do

  • GLOBAL
  • /components/Poll.tsx
    • Simplify Structure: use multiple contexts
  • /pages/api/voted.ts
    • Sort the results according to when each vote was added, not by poll id