Skip to content

subashsriniwas/A-Simple-LLD-of-Voting-System-using-SpringBoot-and-MySQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Simple LLD Voting System

This project is a simple Voting System implemented using Spring Boot. The application allows users to save persons, check their voting eligibility, display all persons, vote, delete persons, and exit the system.

Features

  1. Save Person
  2. Check Voting Eligibility
  3. Display All Persons
  4. Vote
  5. Delete Person
  6. Exit

Getting Started

Prerequisites

  • Java 11 or higher
  • Maven
  • A database (e.g., H2, MySQL, PostgreSQL)

Installing

  1. Clone the repository:

    git clone https://github.com/yourusername/simple-voting-system.git
    cd simple-voting-system
  2. Configure the database:

    Update the application.properties file with your database configurations.

    spring.datasource.url=jdbc:h2:mem:testdb
    spring.datasource.driverClassName=org.h2.Driver
    spring.datasource.username=sa
    spring.datasource.password=password
    spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
    spring.h2.console.enabled=true
  3. Build the project:

    mvn clean install
  4. Run the application:

    mvn spring-boot:run

Usage

Once the application is running, you can interact with it using the console. The following options are available:

[1] for save person
[2] for checking eligibility
[3] for display
[4] for Voting
[5] to delete
[6] for exit

Save Person

Save a new person to the system.

Check Voting Eligibility

Check if a person is eligible to vote.

Display All Persons

Display all persons in the system.

Vote

Vote for a party.

Delete Person

Delete a person from the system.

Exit

Exit the application.

Example

Here's an example interaction with the system:

[1] for save person 
[2] for checking eligibility 
[3] for display 
[4] for Voting 
[5] to delete 
[6] for exit

Choose an option: 1

  • Enter person details: Name: John Doe, Age: 25, Voting Eligible: true

Choose an option: 2

  • Enter person ID to check eligibility: 1
  • Output: Person is eligible to vote.

Choose an option: 3

  • Output: Displaying all persons...

Choose an option: 4

  • Enter person ID and party to vote: 1, Party: A
  • Output: Vote recorded successfully.

Choose an option: 5

  • Enter person ID to delete: 1
  • Output: Person deleted successfully.

Choose an option: 6

  • Output: Exiting...

Built With

  • Spring Boot - Framework for building Java applications
  • Maven - Dependency Management

Authors

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages