Installation
Installation Guide
Follow these steps to set up the Online Voting System on your local machine.
Prerequisites
Ensure you have the following software installed:
- Java 21: Required for the backend.
- Node.js (v18+): Required for the frontend.
- MySQL: Required for the database.
- Git: To clone the repository.
1. Database Setup
- Open your MySQL client (e.g., MySQL Workbench, command line).
-
Create a new database named
devovs:CREATE DATABASE devovs; -
Configure Credentials: The backend connects to the database using the credentials defined in
backend/onlinevotingsystem/src/main/resources/application.properties.- Default Username:
root - Default Password:
password
If your local MySQL password differs, open
backend/onlinevotingsystem/src/main/resources/application.propertiesand update thespring.datasource.passwordfield. - Default Username:
2. Backend Setup
- Navigate to the backend directory:
cd backend/onlinevotingsystem - Run the application using the Maven wrapper:
- Linux/Mac:
./mvnw spring-boot:run - Windows:
mvnw spring-boot:run
The backend server will start on port
8080. - Linux/Mac:
3. Frontend Setup
- Open a new terminal window.
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install - Start the development server:
npm run devThe frontend will be accessible at
http://localhost:5173.
Troubleshooting
- Port Conflicts: Ensure ports
8080(Backend) and5173(Frontend) are free. - Database Connection: If the backend fails to start, double-check your MySQL username and password in
application.propertiesand ensure thedevovsdatabase exists. - Permission Denied (Linux/Mac): If
./mvnwis not executable, runchmod +x mvnw.