diff --git a/BACKEND AND FRONTEND/BACKEND/.idea/dataSources.local.xml b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources.local.xml new file mode 100644 index 0000000..04f1818 --- /dev/null +++ b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources.local.xml @@ -0,0 +1,22 @@ + + + + + + #@ + ` + + + master_key + root + + + + + + + + + + + \ No newline at end of file diff --git a/BACKEND AND FRONTEND/BACKEND/.idea/dataSources.xml b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources.xml new file mode 100644 index 0000000..02c6f7c --- /dev/null +++ b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources.xml @@ -0,0 +1,17 @@ + + + + + mysql.8 + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://localhost:3306 + + + + + + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/BACKEND AND FRONTEND/BACKEND/.idea/dataSources/b4a4a322-93ed-4bbf-9cd7-2ca12d13325e.xml b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources/b4a4a322-93ed-4bbf-9cd7-2ca12d13325e.xml new file mode 100644 index 0000000..3f9477c --- /dev/null +++ b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources/b4a4a322-93ed-4bbf-9cd7-2ca12d13325e.xml @@ -0,0 +1,1390 @@ + + + + + lower/lower + InnoDB + InnoDB + |root||root|localhost|ALLOW_NONEXISTENT_DEFINER|G +|root||root|localhost|ALTER|G +|root||root|localhost|ALTER ROUTINE|G +|root||root|localhost|APPLICATION_PASSWORD_ADMIN|G +|root||mysql.infoschema|localhost|AUDIT_ABORT_EXEMPT|G +|root||mysql.session|localhost|AUDIT_ABORT_EXEMPT|G +|root||mysql.sys|localhost|AUDIT_ABORT_EXEMPT|G +|root||root|localhost|AUDIT_ABORT_EXEMPT|G +|root||root|localhost|AUDIT_ADMIN|G +|root||mysql.session|localhost|AUTHENTICATION_POLICY_ADMIN|G +|root||root|localhost|AUTHENTICATION_POLICY_ADMIN|G +|root||mysql.session|localhost|BACKUP_ADMIN|G +|root||root|localhost|BACKUP_ADMIN|G +|root||root|localhost|BINLOG_ADMIN|G +|root||root|localhost|BINLOG_ENCRYPTION_ADMIN|G +|root||mysql.session|localhost|CLONE_ADMIN|G +|root||root|localhost|CLONE_ADMIN|G +|root||mysql.session|localhost|CONNECTION_ADMIN|G +|root||root|localhost|CONNECTION_ADMIN|G +|root||root|localhost|CREATE|G +|root||root|localhost|CREATE ROLE|G +|root||root|localhost|CREATE ROUTINE|G +|root||root|localhost|CREATE TABLESPACE|G +|root||root|localhost|CREATE TEMPORARY TABLES|G +|root||root|localhost|CREATE USER|G +|root||root|localhost|CREATE VIEW|G +|root||root|localhost|DELETE|G +|root||root|localhost|DROP|G +|root||root|localhost|DROP ROLE|G +|root||root|localhost|ENCRYPTION_KEY_ADMIN|G +|root||root|localhost|EVENT|G +|root||root|localhost|EXECUTE|G +|root||root|localhost|FILE|G +|root||mysql.infoschema|localhost|FIREWALL_EXEMPT|G +|root||mysql.session|localhost|FIREWALL_EXEMPT|G +|root||mysql.sys|localhost|FIREWALL_EXEMPT|G +|root||root|localhost|FIREWALL_EXEMPT|G +|root||root|localhost|FLUSH_OPTIMIZER_COSTS|G +|root||root|localhost|FLUSH_PRIVILEGES|G +|root||root|localhost|FLUSH_STATUS|G +|root||root|localhost|FLUSH_TABLES|G +|root||root|localhost|FLUSH_USER_RESOURCES|G +|root||root|localhost|GROUP_REPLICATION_ADMIN|G +|root||root|localhost|GROUP_REPLICATION_STREAM|G +|root||root|localhost|INDEX|G +|root||root|localhost|INNODB_REDO_LOG_ARCHIVE|G +|root||root|localhost|INNODB_REDO_LOG_ENABLE|G +|root||root|localhost|INSERT|G +|root||root|localhost|LOCK TABLES|G +|root||root|localhost|OPTIMIZE_LOCAL_TABLE|G +|root||root|localhost|PASSWORDLESS_USER_ADMIN|G +|root||mysql.session|localhost|PERSIST_RO_VARIABLES_ADMIN|G +|root||root|localhost|PERSIST_RO_VARIABLES_ADMIN|G +|root||root|localhost|PROCESS|G +|root||root|localhost|REFERENCES|G +|root||root|localhost|RELOAD|G +|root||root|localhost|REPLICATION CLIENT|G +|root||root|localhost|REPLICATION SLAVE|G +|root||root|localhost|REPLICATION_APPLIER|G +|root||root|localhost|REPLICATION_SLAVE_ADMIN|G +|root||root|localhost|RESOURCE_GROUP_ADMIN|G +|root||root|localhost|RESOURCE_GROUP_USER|G +|root||root|localhost|ROLE_ADMIN|G +|root||mysql.infoschema|localhost|SELECT|G +|root||root|localhost|SELECT|G +|root||root|localhost|SENSITIVE_VARIABLES_OBSERVER|G +|root||root|localhost|SERVICE_CONNECTION_ADMIN|G +|root||mysql.session|localhost|SESSION_VARIABLES_ADMIN|G +|root||root|localhost|SESSION_VARIABLES_ADMIN|G +|root||root|localhost|SET_ANY_DEFINER|G +|root||root|localhost|SHOW DATABASES|G +|root||root|localhost|SHOW VIEW|G +|root||root|localhost|SHOW_ROUTINE|G +|root||mysql.session|localhost|SHUTDOWN|G +|root||root|localhost|SHUTDOWN|G +|root||mysql.session|localhost|SUPER|G +|root||root|localhost|SUPER|G +|root||mysql.infoschema|localhost|SYSTEM_USER|G +|root||mysql.session|localhost|SYSTEM_USER|G +|root||mysql.sys|localhost|SYSTEM_USER|G +|root||root|localhost|SYSTEM_USER|G +|root||mysql.session|localhost|SYSTEM_VARIABLES_ADMIN|G +|root||root|localhost|SYSTEM_VARIABLES_ADMIN|G +|root||root|localhost|TABLE_ENCRYPTION_ADMIN|G +|root||root|localhost|TELEMETRY_LOG_ADMIN|G +|root||root|localhost|TRANSACTION_GTID_TAG|G +|root||root|localhost|TRIGGER|G +|root||root|localhost|UPDATE|G +|root||root|localhost|XA_RECOVER_ADMIN|G +|root||root|localhost|grant option|G +performance_schema|schema||mysql.session|localhost|SELECT|G +sys|schema||mysql.sys|localhost|TRIGGER|G + 9.1.0 + + + armscii8 + + + armscii8 + 1 + + + ascii + + + ascii + 1 + + + big5 + + + big5 + 1 + + + binary + 1 + + + cp1250 + + + cp1250 + + + cp1250 + + + cp1250 + 1 + + + cp1250 + + + cp1251 + + + cp1251 + + + cp1251 + 1 + + + cp1251 + + + cp1251 + + + cp1256 + + + cp1256 + 1 + + + cp1257 + + + cp1257 + 1 + + + cp1257 + + + cp850 + + + cp850 + 1 + + + cp852 + + + cp852 + 1 + + + cp866 + + + cp866 + 1 + + + cp932 + + + cp932 + 1 + + + dec8 + + + dec8 + 1 + + + eucjpms + + + eucjpms + 1 + + + euckr + + + euckr + 1 + + + gb18030 + + + gb18030 + 1 + + + gb18030 + + + gb2312 + + + gb2312 + 1 + + + gbk + + + gbk + 1 + + + geostd8 + + + geostd8 + 1 + + + greek + + + greek + 1 + + + hebrew + + + hebrew + 1 + + + hp8 + + + hp8 + 1 + + + keybcs2 + + + keybcs2 + 1 + + + koi8r + + + koi8r + 1 + + + koi8u + + + koi8u + 1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + 1 + + + latin2 + + + latin2 + + + latin2 + + + latin2 + 1 + + + latin2 + + + latin5 + + + latin5 + 1 + + + latin7 + + + latin7 + + + latin7 + 1 + + + latin7 + + + macce + + + macce + 1 + + + macroman + + + macroman + 1 + + + sjis + + + sjis + 1 + + + swe7 + + + swe7 + 1 + + + tis620 + + + tis620 + 1 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + 1 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ujis + + + ujis + 1 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + 1 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16le + + + utf16le + 1 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + 1 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + 1 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb3 + + + utf8mb4 + 1 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4_0900_ai_ci + + + utf8mb3_general_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + 2024-12-26.14:42:24 + utf8mb4_0900_ai_ci + + + 2024-12-26.14:41:25 + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + 0 + localhost + caching_sha2_password + + + 0 + localhost + caching_sha2_password + + + 0 + localhost + caching_sha2_password + + + localhost + caching_sha2_password + + + InnoDB + utf8mb4_0900_ai_ci +
+ + InnoDB + utf8mb4_0900_ai_ci +
+ + InnoDB + utf8mb4_0900_ai_ci +
+ + InnoDB + utf8mb4_0900_ai_ci +
+ + InnoDB + utf8mb4_0900_ai_ci +
+ + InnoDB + utf8mb4_0900_ai_ci +
+ + InnoDB + utf8mb4_0900_ai_ci +
+ + 25 + 1 + 1 + int|0s + + + 1 + 2 + varchar(255)|0s + + + 1 + 3 + varchar(255)|0s + + + 1 + 4 + varchar(255)|0s + + + customerid + btree + 1 + + + customer_email + btree + 1 + + + 1 + 1 + PRIMARY + + + UKqy5hqprdvx8o3dcidcfmf17x4 + + + 8 + 1 + 1 + bigint|0s + + + 1 + 2 + varchar(255)|0s + + + 1 + 3 + varchar(255)|0s + + + 1 + 4 + varchar(255)|0s + + + 1 + 5 + varchar(255)|0s + + + event_id + btree + 1 + + + 1 + 1 + PRIMARY + + + 1 + 1 + bigint|0s + + + 1 + 2 + bigint|0s + + + event_id + event_id + event + + + venue_id + vendor_id + venue + + + event_id +venue_id + btree + 1 + + + venue_id + btree + + + 1 + 1 + PRIMARY + + + 1 + 1 + 1 + bigint|0s + + + 1 + 2 + int|0s + + + 1 + 3 + varchar(255)|0s + + + seat_id + btree + 1 + + + 1 + 1 + PRIMARY + + + 1 + 1 + 1 + bigint|0s + + + 1 + 2 + varchar(255)|0s + + + 1 + 3 + int|0s + + + 1 + 4 + double|0s + + + 1 + 5 + varchar(255)|0s + + + 1 + 6 + varchar(255)|0s + + + ticket_id + btree + 1 + + + 1 + 1 + PRIMARY + + + 4 + 1 + 1 + int|0s + + + 1 + 2 + varchar(255)|0s + + + 1 + 3 + varchar(255)|0s + + + 1 + 4 + varchar(255)|0s + + + vendor_id + btree + 1 + + + vendor_email + btree + 1 + + + 1 + 1 + PRIMARY + + + UKgp5lakbnvncc9y491wpa3nmqe + + + 11 + 1 + 1 + bigint|0s + + + 1 + 2 + varchar(255)|0s + + + 1 + 3 + varchar(255)|0s + + + 1 + 4 + int|0s + + + 1 + 5 + varchar(255)|0s + + + vendor_id + btree + 1 + + + 1 + 1 + PRIMARY + +
+
\ No newline at end of file diff --git a/BACKEND AND FRONTEND/BACKEND/.idea/dataSources/b4a4a322-93ed-4bbf-9cd7-2ca12d13325e/storage_v2/_src_/schema/real_time_ticket_booking_system__customer_.a3R1xA.meta b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources/b4a4a322-93ed-4bbf-9cd7-2ca12d13325e/storage_v2/_src_/schema/real_time_ticket_booking_system__customer_.a3R1xA.meta new file mode 100644 index 0000000..5247776 --- /dev/null +++ b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources/b4a4a322-93ed-4bbf-9cd7-2ca12d13325e/storage_v2/_src_/schema/real_time_ticket_booking_system__customer_.a3R1xA.meta @@ -0,0 +1,2 @@ +#n:real_time_ticket_booking_system_(customer) +! [0, 0, null, null, -2147483648, -2147483648] diff --git a/BACKEND AND FRONTEND/BACKEND/.idea/dataSources/b4a4a322-93ed-4bbf-9cd7-2ca12d13325e/storage_v2/_src_/schema/real_time_ticket_booking_system_db_.eqD9iA.meta b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources/b4a4a322-93ed-4bbf-9cd7-2ca12d13325e/storage_v2/_src_/schema/real_time_ticket_booking_system_db_.eqD9iA.meta new file mode 100644 index 0000000..7a9b742 --- /dev/null +++ b/BACKEND AND FRONTEND/BACKEND/.idea/dataSources/b4a4a322-93ed-4bbf-9cd7-2ca12d13325e/storage_v2/_src_/schema/real_time_ticket_booking_system_db_.eqD9iA.meta @@ -0,0 +1,2 @@ +#n:real_time_ticket_booking_system(db) +! [0, 0, null, null, -2147483648, -2147483648] diff --git a/BACKEND AND FRONTEND/BACKEND/.idea/modules.xml b/BACKEND AND FRONTEND/BACKEND/.idea/modules.xml index ee4f57e..6a7617c 100644 --- a/BACKEND AND FRONTEND/BACKEND/.idea/modules.xml +++ b/BACKEND AND FRONTEND/BACKEND/.idea/modules.xml @@ -3,6 +3,7 @@ + \ No newline at end of file diff --git a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/pom.xml b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/pom.xml index 17dd093..3f8f0e1 100644 --- a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/pom.xml +++ b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/pom.xml @@ -71,10 +71,19 @@ mysql-connector-j runtime + + org.springframework.boot + spring-boot-starter-mail + + + com.google.code.gson + gson + 2.11.0 + - - - + + + diff --git a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Controller/AuthController.java b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Controller/AuthController.java new file mode 100644 index 0000000..5ce9397 --- /dev/null +++ b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Controller/AuthController.java @@ -0,0 +1,101 @@ +package com.Ticketing.System.Controller; + +import com.Ticketing.System.Service.EmailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +@RestController +@RequestMapping("/api/auth") +public class AuthController { + + @Autowired + private EmailService emailService; + + // Store OTPs temporarily (in-memory storage for demo purposes) + private final Map otpStorage = new HashMap<>(); + + // Endpoint to send OTP + @PostMapping("/sendOtp") + public String sendOtp(@RequestBody EmailRequest emailRequest) { + String email = emailRequest.getEmail(); + if (email == null || email.isEmpty()) { + return "Email is required."; + } + + // Generate OTP + String otp = generateOtp(); + + // Store OTP associated with the email + otpStorage.put(email, otp); + + // Send OTP email + emailService.sendOtpEmail(email, otp); + + return "OTP sent successfully to " + email; + } + + // Endpoint to verify OTP + @PostMapping("/verifyOtp") + public String verifyOtp(@RequestBody OtpRequest otpRequest) { + String email = otpRequest.getEmail(); + String providedOtp = otpRequest.getOtp(); + + if (email == null || providedOtp == null) { + return "Email and OTP are required."; + } + + // Check if the OTP matches + String storedOtp = otpStorage.get(email); + if (storedOtp != null && storedOtp.equals(providedOtp)) { + otpStorage.remove(email); // Clear OTP after successful verification + return "OTP verified successfully!"; + } + return "Invalid OTP."; + } + + // Generate a 6-digit random OTP + private String generateOtp() { + Random rand = new Random(); + int otp = 100000 + rand.nextInt(900000); + return String.valueOf(otp); + } +} + +class EmailRequest { + private String email; + + // Getters and Setters + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} + +class OtpRequest { + private String email; + private String otp; + + // Getters and Setters + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getOtp() { + return otp; + } + + public void setOtp(String otp) { + this.otp = otp; + } +} diff --git a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/DataTransferObject/EventDTO.java b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/DataTransferObject/EventDTO.java index f12eedf..290ec79 100644 --- a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/DataTransferObject/EventDTO.java +++ b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/DataTransferObject/EventDTO.java @@ -15,6 +15,7 @@ public class EventDTO { private String eventType; private String eventName; private String eventDescription; + private String eventLearnMore; private String eventTimeDuration; private List venues; diff --git a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/EmailTestApplication.java b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/EmailTestApplication.java new file mode 100644 index 0000000..a2e10c8 --- /dev/null +++ b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/EmailTestApplication.java @@ -0,0 +1,26 @@ +package com.Ticketing.System; + + +import com.Ticketing.System.Service.EmailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.event.EventListener; + +//@SpringBootApplication +//public class EmailTestApplication { +// +// @Autowired +// private EmailService emailService; +// +// public static void main(String[] args) { +// SpringApplication.run(EmailTestApplication.class, args); +// } +// +// @EventListener(ApplicationReadyEvent.class) +// public void sendTestEmail() { +// emailService.sendOtpEmail("test@example.com", "123456"); +// System.out.println("Test email sent!"); +// } +//} diff --git a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Model/Event.java b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Model/Event.java index 128722d..a02bfd0 100644 --- a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Model/Event.java +++ b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Model/Event.java @@ -23,7 +23,9 @@ public class Event { private String eventName; @Column(name = "event_description", nullable = false) private String eventDescription; - @Column(name = "event_time_duration", nullable = false) + @Column(name = "event_learn_more",nullable = false) + private String eventLearnMore; + @Column(name = "event_time_duration",nullable = false) private String eventTimeDuration; @ManyToMany(fetch = FetchType.EAGER) @@ -35,9 +37,9 @@ public class Event { private Set venues;// = new HashSet<>(); - public Set getVenues() { - return venues; - } +// public Set getVenues() { +// return venues; +// } public void setVenues(Set venues) { this.venues = venues; diff --git a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Service/EmailService.java b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Service/EmailService.java new file mode 100644 index 0000000..be75a8f --- /dev/null +++ b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/java/com/Ticketing/System/Service/EmailService.java @@ -0,0 +1,26 @@ +package com.Ticketing.System.Service; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mail.SimpleMailMessage; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.stereotype.Service; + +@Service +public class EmailService { + + @Autowired + private JavaMailSender javaMailSender; + + public void sendOtpEmail(String toEmail, String otp) { + try { + SimpleMailMessage message = new SimpleMailMessage(); + message.setTo(toEmail); + message.setSubject("Your OTP Code"); + message.setText("Your OTP code is: " + otp); + javaMailSender.send(message); + } catch (Exception e) { + System.err.println("Error while sending email: " + e.getMessage()); + throw new RuntimeException("Failed to send email", e); + } + } +} diff --git a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/resources/application.properties b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/resources/application.properties index 582c4ce..4f74b0c 100644 --- a/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/resources/application.properties +++ b/BACKEND AND FRONTEND/BACKEND/Booking System - Copy/System/src/main/resources/application.properties @@ -5,4 +5,13 @@ spring.datasource.username=root spring.datasource.password=Ayna80738264@# spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.show-sql=true -server.port=8090 \ No newline at end of file +server.port=8090 + +# Mail Server Configuration +spring.mail.host=smtp.gmail.com +spring.mail.port=587 +spring.mail.username=yasirunadeesha80738264@gmail.com +spring.mail.password=Ayna80738264@# +spring.mail.properties.mail.smtp.auth=true +spring.mail.properties.mail.smtp.starttls.enable=true +spring.mail.properties.mail.debug=true diff --git a/BACKEND AND FRONTEND/BACKEND/application.log.1 b/BACKEND AND FRONTEND/BACKEND/application.log.1 new file mode 100644 index 0000000..e69de29 diff --git a/BACKEND AND FRONTEND/BACKEND/application.log.lck b/BACKEND AND FRONTEND/BACKEND/application.log.lck new file mode 100644 index 0000000..e69de29 diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/index.html b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/index.html index 0c589ec..7c8255f 100644 --- a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/index.html +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/index.html @@ -4,7 +4,7 @@ - Vite + React + Ticket Booking System
diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/package-lock.json b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/package-lock.json index 3140408..b365819 100644 --- a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/package-lock.json +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/package-lock.json @@ -8,6 +8,7 @@ "name": "ticket-booking-system-frontend-", "version": "0.0.0", "dependencies": { + "@react-oauth/google": "^0.12.1", "@stomp/stompjs": "^7.0.0", "axios": "^1.7.9", "bootstrap": "^5.3.3", @@ -1003,6 +1004,16 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@react-oauth/google": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@react-oauth/google/-/google-0.12.1.tgz", + "integrity": "sha512-qagsy22t+7UdkYAiT5ZhfM4StXi9PPNvw0zuwNmabrWyMKddczMtBIOARflbaIj+wHiQjnMAsZmzsUYuXeyoSg==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.28.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.28.0.tgz", diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/package.json b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/package.json index f5c2818..60ccea9 100644 --- a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/package.json +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@react-oauth/google": "^0.12.1", "@stomp/stompjs": "^7.0.0", "axios": "^1.7.9", "bootstrap": "^5.3.3", diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/AddEvent.css b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/AddEvent.css new file mode 100644 index 0000000..f7e78b2 --- /dev/null +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/AddEvent.css @@ -0,0 +1,111 @@ +/* Global styles */ +body { + font-family: 'Arial', sans-serif; + height: 100vh; + display: flex; + justify-content: center; + + } + + /* Glass card styles */ + .glass-card { + width: 100%; + max-width: 600px; + padding: 40px 40px; + margin-left: auto; + margin-right: auto; + margin-top: 70px; + background: rgba(255, 255, 255, 0.2); /* Semi-transparent background */ + border-radius: 15px; + box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); /* Soft shadow */ + backdrop-filter: blur(10px); /* Glassmorphism effect */ + -webkit-backdrop-filter: blur(10px); /* Safari compatibility */ + border: 1px solid rgba(255, 255, 255, 0.3); /* Border for the frosted glass look */ + color: #fff; /* White text color for contrast */ + box-sizing: border-box; + align-items: center; + + + } + + /* Heading styles */ + .text-center { + text-align: center; + font-size: 1.8rem; + font-weight: bold; + margin-bottom: 20px; + color: #fcfafa; + text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); /* Subtle text shadow */ + } + + /* Form group */ + .form-group { + margin-bottom: 20px; + } + + .form-group label { + display: block; + font-size: 1rem; + font-weight: 600; + margin-bottom: 8px; + color: #ffffff; + } + + .form-group input, + .form-group textarea { + width: 100%; + padding: 10px 15px; + border: 1px solid rgba(255, 255, 255, 0.5); + border-radius: 8px; + background: rgba(255, 255, 255, 0.1); /* Semi-transparent input background */ + color: #fff; + font-size: 1rem; + outline: none; + transition: border-color 0.3s ease; + } + + .form-group input:focus, + .form-group textarea:focus { + border-color: rgba(255, 255, 255, 0.8); + } + + /* Button styles */ + .addeventbtn { + display: block; + width: 100%; + padding: 10px 20px; + font-size: 1rem; + font-weight: bold; + color: #ffffff; + background-color: #126681; + border: none; + border-radius: 8px; + cursor: pointer; + text-align: center; + transition: background-color 0.3s ease, transform 0.2s ease; + } + + .addeventbtn:hover { + background-color: #1297b8; + transform: scale(1.05); + } + + .btn-primary { + background-color: #0c5c77; + } + + /* Responsive Design */ + @media (max-width: 768px) { + .glass-card { + padding: 15px; + } + + .text-center { + font-size: 1.5rem; + } + + .addeventbtn { + font-size: 0.9rem; + } + } + \ No newline at end of file diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/App.css b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/App.css index d74f597..344a4bc 100644 --- a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/App.css +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/App.css @@ -7,7 +7,7 @@ margin: auto; height: 150px; margin-top: 110px; - background-color: #0f7886; + background-color: #0d717e; } .footer-section { @@ -80,8 +80,10 @@ text-align: center; margin-top: 0px; font-size: 14px; - border-top: 2px solid #111010; - padding-top: 15px; + border-top: 2px ; + padding-top: px; + color: #0e0d0d; + background-color: #b3c4c5; } @media (max-width: 768px) { .footer-content { @@ -270,6 +272,7 @@ button:hover { border-radius: 5px; font-size: 20px; + } /* General table styling */ .table { @@ -285,6 +288,7 @@ button:hover { .table thead { background-color: #415972; color: white; + } .table th { @@ -301,6 +305,7 @@ button:hover { .table tbody tr:nth-of-type(even) { background-color: #f9f9f9; + } .table tbody tr:nth-of-type(odd) { diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/App.jsx b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/App.jsx index bf615c4..97685e0 100644 --- a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/App.jsx +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/App.jsx @@ -3,6 +3,7 @@ import './App.css' import './Login.css' import './Home.css' import './ControlPanelComponent.css'; +import './AddEvent.css' import FooterComponent from './components/FooterComponent' //import FooterComponent from './components/FooterComponent' import HeaderComponent from './components/HeaderComponent' @@ -14,6 +15,7 @@ import ControlPanalComponent from './components/ControlPanalComponent' import VendorListComponent from './components/VendorListComponent'; import EventListComponent from './components/EventListComponent'; import VenueListComponent from './components/VenueListComponent'; +import AddEventComponent from './components/AddEventComponent'; function App() { @@ -50,6 +52,9 @@ function App() { //http://localhost:4000/controlpanel }> + //http://localhost:4000/addevent + }> + diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Home.css b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Home.css index 7a6ec1b..39577c1 100644 --- a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Home.css +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Home.css @@ -41,8 +41,9 @@ body{ border-radius: 10px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - width: calc(20% - 20px); /* Adjust card width */ - min-width: 250px; + /*width: calc(20% - 20px); /* Adjust card width */ + width: 450px; + min-width: 300px; overflow: hidden; text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; @@ -51,11 +52,14 @@ body{ .card:hover { transform: translateY(-10px); + /* transform: translateX(-10px); + transform: translateZ(-10px); */ box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); + background-color: #0bfade; } .card-image { background: url('') center/cover no-repeat; - height: 170px; + height: 200px; border-top-left-radius: 10px; border-top-right-radius: 10px; box-shadow: 0px 10px 10px black; @@ -68,6 +72,20 @@ body{ font-weight:600; font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; } +.card-name { + font-size: 1.5rem; + color: #333; + padding-top: 0px; + font-weight:600; + font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; +} +.card-duration { + font-size: 1rem; + font-weight: bold; + color: #555; + margin-bottom: 10px; /* Space between duration and button */ +} + .card-dis { font-size: 1rem; color: #666; @@ -79,7 +97,7 @@ body{ display: inline-block; margin: 15px auto ; padding: 10px 20px; - background-color: #596160; /* Primary button color */ + background-color: #1f7067; /* Primary button color */ color: #ffffff; /* Text color */ border: none; border-radius: 5px; @@ -116,3 +134,51 @@ body{ width: 100%; } } +.card-links a { + color: #007bff; + text-decoration: none; + margin-right: 10px; + font-size: 0.9rem; +} +.card-links a:hover { + text-decoration: underline; +} +.card-price { + font-size: 1rem; + color: #e63946; + font-weight: bold; + margin-bottom: 10px; +} +.card-tags { + display: flex; + gap: 5px; + margin-bottom: 10px; +} + +.tag { + background-color: #eee; + color: #333; + padding: 5px 10px; + border-radius: 20px; + font-size: 0.8rem; +} +.card-cast { + font-size: 0.9rem; + color: #555; + margin-bottom: 10px; +} +.card-release { + font-size: 0.9rem; + color: #888; + margin-bottom: 10px; +} +.card-genre { + font-size: 0.9rem; + color: #777; + margin-bottom: 10px; +} +.card-rating { + font-size: 1rem; + color: #ffcc00; /* Star color */ + margin-bottom: 10px; +} diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Login.css b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Login.css index 6202674..6f139dc 100644 --- a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Login.css +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Login.css @@ -27,15 +27,54 @@ .log-container { background-color: #74c5c0; padding: 20px 30px; - border-radius: 8px; + border-radius: 10px; box-shadow: 0 5px 6px rgba(0, 0, 0, 0.1); - width: 100%; + /* width: 100%; */ max-width: 400px; margin:auto; margin-top: 80px; font-family: 'Times New Roman', Times, serif; font-weight: bold; + position: relative; + + } + /*---------------------------------------animation----------------------------------------------------------------*/ + @property --angle{ + syntax:""; + initial-value: 0deg; + inherits: false; + } + .log-container::after,.log-container::before{ + + content:'' ; + position:absolute ; + height: 400px; + width: 425px; + background-image:conic-gradient(from var(--angle),transparent 0% ,rgb(184, 47, 47), rgb(51, 51, 175),green,rgb(210, 54, 224),rgb(6, 173, 240)); + /*background-image:conic-gradient(from var(--angle),transparent 0% , rgb(22, 212, 171));*/ + top: 50%; + left: 50%; + translate : -50% -50%; + z-index: -1; + padding: 5px; + border-radius: 10px; + animation: 3s spin linear infinite; + + } + .log-container::before{ + + filter: blur(2.5rem); + opacity: 0.5; + } + @keyframes spin { + from{ + --angle :0deg; + } + to{ + --angle :360deg; + } } + /*-------------------------------------------------------------------------------------------------------------------*/ h2 { text-align: center; @@ -116,25 +155,42 @@ font-size: 14px; } } + .user-type-selection { text-align: center; padding: 20px; + /* margin-top: 200px; + margin-bottom: 200px; + background: rgba(255, 255, 255, 0.1); */ + border-radius: 10px; + padding: 30px; + width: 100%; + max-width: 400px; + /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); */ + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(1px); + + } + .log-container{ + margin-top: 100px; + margin-bottom: 120px; } - .role-btn { display: inline-block; - margin: 10px 5px; + margin: 20px 5px; padding: 10px 20px; background-color: #245f5f; - color: #fff; + color: #faf6f6; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; - transition: background-color 0.3s ease, transform 0.2s ease; + transition: background-color 1s ease, transform 0.2s ease; + + } .role-btn:hover { - background-color: #35c488; + background-color: #33423c; transform: scale(1.05); - } \ No newline at end of file + } diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Services/Service.jsx b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Services/Service.jsx index b1b0e09..774178f 100644 --- a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Services/Service.jsx +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/Services/Service.jsx @@ -13,4 +13,8 @@ export const listvenues =()=>axios.get(REST_API_BASEURL3); const REST_API_BASEURL4 ='http://localhost:8090/api/vendor/getvendor' -export const listvendors =()=>axios.get(REST_API_BASEURL4); \ No newline at end of file +export const listvendors =()=>axios.get(REST_API_BASEURL4); + +// const REST_API_BASEURL5 ='http://localhost:8090/api/event/addevent' + +// export const addevent =()=>axios.post(REST_API_BASEURL5); \ No newline at end of file diff --git a/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/components/AddEventComponent.jsx b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/components/AddEventComponent.jsx new file mode 100644 index 0000000..4cc08b5 --- /dev/null +++ b/BACKEND AND FRONTEND/FRONT END/TICKET_BOOKING_SYSTEM(frontend)/src/components/AddEventComponent.jsx @@ -0,0 +1,106 @@ + +import React, { useState } from 'react'; +import { useNavigate } from 'react-router-dom'; +import axios from 'axios'; + +const AddEventComponent = () => { + const [event, setEvent] = useState({ + eventType: '', + eventName: '', + eventDescription: '', + eventLearnMore:'', + eventTimeDuration: '' + + }); + const [error, setError] = useState(''); + const navigate = useNavigate(); + + const handleChange = (e) => { + const { name, value } = e.target; + setEvent({ ...event, [name]: value }); + }; + + const handleSubmit = async (e) => { + e.preventDefault(); + try { + const response = await axios.post('http://localhost:8090/api/event/addevent', event); + if (response.status === 200) { + alert('Event added successfully!'); + navigate('/events'); // Redirect to the event list page + } + } catch (err) { + console.error(err); + setError('Failed to add the event. Please try again.'); + } + }; + + return ( +
+

Add New Event

+ {error &&

{error}

} +
+
+ + +
+ +
+ + +
+ +
+ +