Skip to content

abriveraaa/examguard-backend

Repository files navigation

ExamGuard Backend (Spring Boot)

Backend server for ExamGuard, a secure examination and monitoring system responsible for authentication, exam management, monitoring, analytics, reporting, and registrar integration.


Overview

This repository contains the Spring Boot backend application for ExamGuard. It provides REST APIs used by the frontend application and manages all business logic, database operations, reporting, caching, and system integrations.


Technology Stack

  • Java 21
  • Spring Boot
  • PostgreSQL
  • Redis
  • Maven Wrapper (Included)
  • Docker Desktop

Prerequisites

Before running the project, ensure the following software is installed:

Required

  • Java JDK 21+
  • Docker Desktop
  • Git

Recommended

  • IntelliJ IDEA

Not Required

Maven installation is not required if the repository includes Maven Wrapper (mvnw and mvnw.cmd).


Verifying Java Installation

Open a terminal and run:

java -version

Expected output:

java version "21.x.x"

Verifying Docker Installation

docker --version

Expected output:

Docker version xx.x.x

Cloning the Repository

git clone <backend-repository-url>
cd examguard-backend

Starting Required Services

PostgreSQL Database

Start the database container:

docker compose up -d

Verify the container is running:

docker ps

Redis Cache

If Redis is included in your Docker Compose configuration:

docker compose up -d

Otherwise, start Redis separately according to your local setup.


Configuration

Review the following files before running the application:

src/main/resources/application.properties
src/main/resources/application-dev.properties
src/main/resources/application-prod.properties

Common configurations include:

spring.datasource.url=
spring.datasource.username=
spring.datasource.password=

spring.data.redis.host=
spring.data.redis.port=

registrar.api.base-url=

Running the Application

IntelliJ IDEA (Recommended)

Run:

ExamguardBackendApplication.java

Command Line

Windows

mvnw.cmd spring-boot:run

macOS / Linux

./mvnw spring-boot:run

Building the Application

Windows

mvnw.cmd clean package

macOS / Linux

./mvnw clean package

Generated JAR files will be available in:

target/

Default Local Environment

Backend API

http://localhost:8080

PostgreSQL

localhost:5432

Redis

localhost:6379

Database Setup

Example Docker configuration:

services:
  postgres:
    image: postgres:16
    container_name: examguard-postgres

    environment:
      POSTGRES_DB: examguard
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password

    ports:
      - "5432:5432"

    volumes:
      - examguard_postgres_data:/var/lib/postgresql/data

volumes:
  examguard_postgres_data:

Troubleshooting

Java Not Found

java -version

If not recognized:

  • Reinstall JDK 21
  • Configure JAVA_HOME
  • Restart terminal or IDE

Docker Not Running

Verify Docker Desktop is started before executing:

docker compose up -d

Port 8080 Already In Use

Find and stop the application currently using port 8080 or update:

server.port=8081

Database Connection Failed

Verify:

  • PostgreSQL container is running
  • Database credentials are correct
  • Port 5432 is available
  • Application properties are configured correctly

Redis Connection Failed

Verify:

  • Redis service is running
  • Redis host and port configuration are correct

Development Notes

Current development configuration uses:

spring.jpa.hibernate.ddl-auto=update

This automatically creates and updates database tables based on entity definitions during development.

For production deployments, database migrations should be managed separately.

About

Backend of ExamGuard | COMP 009: Object-Oriented Programming Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages