Code Monkey home page Code Monkey logo

jaweki / online-students-voting-system Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.89 MB

This project solution is an Online voters system purposely created to be used by university students. The project was built using (React)Next.js template, Next Auth, Cloudinary and MongoDB integration, and Typescript. The system allows users to login or register (as either students, professor, or Admin). Login process is quite simple and intuitive.

Home Page: https://online-students-voting-system.vercel.app

CSS 0.63% TypeScript 98.98% JavaScript 0.40%
fullstack-development mongodb mongoose nextauth nextjs nextjs14 onlinevotingsystem open-source react responsive-web-design webdevelopment

online-students-voting-system's Introduction

Online Voters System - Next.js App

This project solution is an Online voters system purposely created to be used by university students. The project was built using (React)Next.js template, Next Auth, Cloudinary and MongoDB integration, and Typescript. The system allows users to login or register (as either students, professor, or Admin). Login process is quite simple and intuitive, with auto role detection, for viewing intended users voters page. Read more to understand the solution at my GitHub repository: https://github.com/Jaweki/online-students-voting-system

Table of contents

Overview

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

To see specific project dependancies, take a look at the package.json file in the root folder.

Open http://localhost:3000 with your browser to see the result. This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Screenshots

landing page register first page register second page login page logged in admins landing page available ballots candiate type ballot binary type ballot

Links

My process

Built with

What I learned

While this project was a great opportunity to sharpen my web development skills, the following skills were newly learnt:

  • intergration of the web app to cloudinary. So, when a new user is registering in to the system, they upload their profile avatar(image). The image, is stored on cloudinary, and so the app had to intergrate with the api. Check out the code snipet below:
const uploadImage = async () => {
  if (file) {
    try {
      const formData = new FormData();
      formData.append("file", file);
      formData.append("upload_preset", "upload_folder");

      const response = await fetch(
        "https://api.cloudinary.com/v1_1/cloud-name/image/upload",
        {
          method: "POST",
          body: formData,
        }
      );

      const data = await response.json();

      return data.secure_url;
    } catch (error) {
      console.error("Error uploading image: ", error);
      alert("Error Uploading image!");
    }
  }
};
  • handling a Drag and drop on a html div element, which receives the image. view code

  • Above all, the most interesting part of the project was designing and implementing the users config file document that is saved in the db. This was key especially when it comes to keeping track of votes a user paticipated in. view mongoose schemas.

Continued development

This project is still under scheduled development. The following details will be implemented:

  1. The admin will have a grant to edit and/or delete old or unnecessary ballots,
  2. Implementation of Ballot analytics. For each ballot we need to know out of all users how many users have voted, probably view in a graph.
  3. For all users, Old and currently active ballots should be separated in the view.
  4. Implement search functionality for our web app.

Stay tunned for this updates soon.

Useful reasources

  • Next.js dev Docs - To know more about functionalities like routing, implementing loaders, or utilities like the Image element lazy loading
  • Next Auth Custom credentials provider - To Learn more about how to intergrate an email custom credentials provider, or be able to keep track of user session as used in this web app, read the next auth docs.
  • Cloudinary - Familiarlize your self with this cloud storage solution, popular for its utility in multimedia storage.
  • MongoDB - Learn more about document oriented, easy to implement and extend database.
  • vercel - For react and next.js project, vercel a aids in deployment of live site web apps. visit their site to learn more.

Author

Acknowledgements

To begin with, am proud to have been able to complete and delive the mvp of this web app project. The University lecturers at Zetec university appreciated my solution, and recommended i develop it fully for it to be used by students.

More to that, great thanks to AbdiRhamman Khalif Mohamed a student at Zetec university, who reach out to ask for a prototype of the initial designed system. With his co-operation we choose the right theme for the web app, user interactivity and responsiveness and people loved it.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out the Next.js deployment documentation for more details.

online-students-voting-system's People

Contributors

jaweki avatar

Stargazers

Areeba shahid avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.