Skip to main content

Campus Event Management System in JAVA

 Campus Event Management System

#java #event #fyp #project #source #code #learn #free

1. Introduction

  • Problem Statement: Managing campus events manually can be chaotic and time-consuming. The need for a streamlined digital platform is essential for enhancing user experience and improving event management efficiency.
  • Objective: To create a Java-based Campus Event Management System that allows users to create, manage, and register for campus events seamlessly.
  • Scope: The system will have modules for user registration, event creation, event registration, notifications, and administrative management.

2. Features

  • User Management: Registration, login, and profile management for students and organizers.
  • Event Management: Create, update, delete, and view events.
  • Registration System: Students can register for events, view the status of their registration, and receive notifications.
  • Notification System: Send email or SMS notifications for event updates, cancellations, and reminders.
  • Feedback System: Post-event feedback collection and analysis.

3. System Requirements

  • Software Requirements:
    • JDK 8 or later
    • IDE: Eclipse/IntelliJ IDEA
    • Database: MySQL or PostgreSQL
    • Apache Tomcat for web-based deployment
  • Hardware Requirements:
    • RAM: 4GB minimum
    • Processor: Dual Core Processor or higher
    • Disk Space: 200MB for software and dependencies

4. System Design

  • Architecture: MVC (Model-View-Controller) architecture will be used for the web-based version of the application.
  • UML Diagrams:
    • Use Case Diagram: Illustrates the interaction between users (students, organizers, and admin) and the system.
    • Class Diagram: Shows the classes involved and their relationships.
    • Sequence Diagram: Represents the flow of actions for key functionalities like event registration and notification.
  • Database Design:
    • Tables for Users, Events, Registrations, Notifications, and Feedback.


Project Structure:

  1. Backend (Spring Boot Application)

    • Models
    • Repositories
    • Services
    • Controllers
    • Configuration
  2. Frontend (JavaFX Application)

    • UI Layouts
    • Controllers
    • Utils

1. Backend: Spring Boot Application

Step 1: Create a Spring Boot Project

Use Spring Initializr to generate a new Spring Boot project with the following dependencies:

  • Spring Web
  • Spring Data JPA
  • MySQL Driver
  • Lombok

Step 2: Create Models


user.java


package com.campus.eventmanagement.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String username;
    private String password;
    private String email;
    private String role;  // "STUDENT", "ORGANIZER", "ADMIN"
}


event.java


package com.campus.eventmanagement.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Date;

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Event {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long eventId;

    private String eventName;
    private String location;

    @Temporal(TemporalType.DATE)
    private Date eventDate;

    private String organizer;
    private String description;
}


UserRepository.java


package com.campus.eventmanagement.repository;

import com.campus.eventmanagement.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {
    User findByUsername(String username);
}



EventRepository.java


package com.campus.eventmanagement.repository;

import com.campus.eventmanagement.model.Event;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface EventRepository extends JpaRepository<Event, Long> {
    // Custom query methods (if needed)
}


UserService.java


package com.campus.eventmanagement.service;

import com.campus.eventmanagement.model.User;
import com.campus.eventmanagement.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserRepository userRepository;

    public User registerUser(User user) {
        return userRepository.save(user);
    }

    public User getUserByUsername(String username) {
        return userRepository.findByUsername(username);
    }

    public List<User> getAllUsers() {
        return userRepository.findAll();
    }
}


EventService.java


package com.campus.eventmanagement.service;

import com.campus.eventmanagement.model.Event;
import com.campus.eventmanagement.repository.EventRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EventService {
    @Autowired
    private EventRepository eventRepository;

    public Event createEvent(Event event) {
        return eventRepository.save(event);
    }

    public List<Event> getAllEvents() {
        return eventRepository.findAll();
    }

    public void deleteEvent(Long eventId) {
        eventRepository.deleteById(eventId);
    }
}


UserController.java

package com.campus.eventmanagement.controller;

import com.campus.eventmanagement.model.User;
import com.campus.eventmanagement.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/users")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/register")
    public User registerUser(@RequestBody User user) {
        return userService.registerUser(user);
    }

    @GetMapping("/{username}")
    public User getUserByUsername(@PathVariable String username) {
        return userService.getUserByUsername(username);
    }

    @GetMapping("/all")
    public List<User> getAllUsers() {
        return userService.getAllUsers();
    }
}


EventController.java


package com.campus.eventmanagement.controller;

import com.campus.eventmanagement.model.Event;
import com.campus.eventmanagement.service.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/events")
public class EventController {
    @Autowired
    private EventService eventService;

    @PostMapping("/create")
    public Event createEvent(@RequestBody Event event) {
        return eventService.createEvent(event);
    }

    @GetMapping("/all")
    public List<Event> getAllEvents() {
        return eventService.getAllEvents();
    }

    @DeleteMapping("/{eventId}")
    public void deleteEvent(@PathVariable Long eventId) {
        eventService.deleteEvent(eventId);
    }
}


Database Configuration


spring.datasource.url=jdbc:mysql://localhost:3306/event_management_db
spring.datasource.username=root
spring.datasource.password=yourpassword
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect



2. Frontend: JavaFX Application

Step 1: Create the JavaFX Project Structure

Use an IDE like IntelliJ IDEA or Eclipse with JavaFX support.

Step 2: Design UI using FXML

Create a basic UI for the JavaFX application using FXML files. For simplicity, we'll focus on the main screens.


Main.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<AnchorPane xmlns:fx="http://javafx.com/fxml" fx:controller="com.campus.eventmanagement.controller.MainController">
    <children>
        <VBox spacing="10">
            <Label text="Campus Event Management System" style="-fx-font-size: 20px;"/>
            <Button text="Register for Event" onAction="#handleRegisterForEvent"/>
            <Button text="View Events" onAction="#handleViewEvents"/>
            <Button text="Create Event" onAction="#handleCreateEvent"/>
        </VBox>
    </children>
</AnchorPane>


MainController.java

package com.campus.eventmanagement.controller;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;

public class MainController {

    @FXML
    private void handleRegisterForEvent(ActionEvent event) {
        // Implementation of registering for an event
        showInfoAlert("Feature Coming Soon!");
    }

    @FXML
    private void handleViewEvents(ActionEvent event) {
        // Implementation of viewing events
        showInfoAlert("Feature Coming Soon!");
    }

    @FXML
    private void handleCreateEvent(ActionEvent event) {
        // Implementation of creating an event
        showInfoAlert("Feature Coming Soon!");
    }

    private void showInfoAlert(String message) {
        Alert alert = new Alert(Alert.AlertType.INFORMATION);
        alert.setTitle("Information");
        alert.setHeaderText(null);
        alert.setContentText(message);
        alert.showAndWait();
    }
}

MainApp.java
package com.campus.eventmanagement;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class MainApp extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getResource("/Main.fxml"));
        primaryStage.setTitle("Campus Event Management System");
        primaryStage.setScene(new Scene(root));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

Step 5: Build and Run

  • Make sure your JavaFX libraries are properly set up in your IDE.
  • Run the Spring Boot backend by executing MainApp.java to start the JavaFX UI.

Summary

This code provides a comprehensive backend using Spring Boot and a basic frontend using JavaFX. The backend includes CRUD operations for users and events, while the frontend includes basic JavaFX layout and event handlers. 

Comments

Popular posts from this blog

Prepare Data for Exploration: Weekly challenge 4

Prepare Data for Exploration: Weekly challenge 4 1 . Question 1 A data analytics team labels its files to indicate their content, creation date, and version number. The team is using what data organization tool? 1 / 1  point File-naming verifications File-naming references File-naming conventions File-naming attributes Correct 2 . Question 2 Your boss assigns you a new multi-phase project and you create a naming convention for all of your files. With this project lasting years and incorporating multiple analysts it’s crucial that you create data explaining how your naming conventions are structured. What is this data called? 0 / 1  point Descriptive data Named convention Metadata Labeled data Incorrect Please review the video on naming conventions . 3 . Question 3 A grocery store is collecting inventory data from their produce section. What is an appropriate naming convention for this file? 0 / 1  point Todays_Produce Produce_Inventory_2022-09-15_V01 Todays Produce 2022-15-09 Inventory

Weekly challenge 3 data analyst google professional certificate

1 . Question 1 The manage stage of the data life cycle is when a business decides what kind of data it needs, how the data will be handled, and who will be responsible for it. 1 / 1  point True False Correct During planning, a business decides what kind of data it needs, how it will be managed throughout its life cycle, who will be responsible for it, and the optimal outcomes. 2 . Question 2 A data analyst is working at a small tech startup. They’ve just completed an analysis project, which involved private company information about a new product launch. In order to keep the information safe, the analyst uses secure data-erasure software for the digital files and a shredder for the paper files. Which stage of the data life cycle does this describe? 1 / 1  point Archive Plan Manage Destroy Correct This describes the destroy phase, during which data analysts use secure data-erasure software and shred paper files to protect private information. 3 . Question 3 In the analyze phase of the d

Prepare Data for Exploration : weekly challenge 1

Prepare Data for Exploration : weekly challenge 1 #coursera #exploration #weekly #challenge 1 #cybersecurity #coursera #quiz #solution #network Are you prepared to increase your data exploration abilities? The goal of Coursera's Week 1 challenge, "Prepare Data for Exploration," is to provide you the skills and resources you need to turn unprocessed data into insightful information. With the knowledge you'll gain from this course, you can ensure that your data is organised, clean, and ready for analysis. Data preparation is one of the most important processes in any data analysis effort. Inaccurate results and flawed conclusions might emerge from poorly prepared data. You may prepare your data for exploration with Coursera's Weekly Challenge 1. You'll discover industry best practises and insider advice. #answers #questions #flashcard 1 . Question 1 What is the most likely reason that a data analyst would use historical data instead of gathering new data? 1 / 1