diff --git a/backend/.gitignore b/backend/.gitignore new file mode 100644 index 0000000..a020ab3 --- /dev/null +++ b/backend/.gitignore @@ -0,0 +1,9 @@ +/target/ +/.settings/ +/.classpath +/.project +/.metadata/ +/bin/ +*.class +.factorypath +.springBeans diff --git a/backend/.vscode/settings.json b/backend/.vscode/settings.json new file mode 100644 index 0000000..7b016a8 --- /dev/null +++ b/backend/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.compile.nullAnalysis.mode": "automatic" +} \ No newline at end of file diff --git a/backend/src/main/java/com/rit/portal/config/DataInitializer.java b/backend/src/main/java/com/rit/portal/config/DataInitializer.java new file mode 100644 index 0000000..844a3f0 --- /dev/null +++ b/backend/src/main/java/com/rit/portal/config/DataInitializer.java @@ -0,0 +1,113 @@ +package com.rit.portal.config; + +import com.rit.portal.entity.NotePyq; +import com.rit.portal.repository.NotePyqRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.stereotype.Component; +import java.time.LocalDateTime; +import java.util.Arrays; + +@Component +public class DataInitializer implements CommandLineRunner { + + @Autowired + private NotePyqRepository noteRepository; + + @Override + public void run(String... args) throws Exception { + if (noteRepository.count() == 0) { + noteRepository.saveAll(Arrays.asList( + NotePyq.builder() + .title("Engineering Mathematics – Unit 1-5") + .subject("Mathematics") + .department("Computer Science & Engineering") + .semester(1) + .fileType("notes") + .downloadUrl("#") + .fileSize("4.2 MB") + .downloadsCount(348) + .uploadedAt(LocalDateTime.now()) + .build(), + NotePyq.builder() + .title("Physics PYQ 2020-2024") + .subject("Physics") + .department("Computer Science & Engineering") + .semester(1) + .fileType("pyq") + .downloadUrl("#") + .fileSize("8.1 MB") + .downloadsCount(512) + .uploadedAt(LocalDateTime.now()) + .build(), + NotePyq.builder() + .title("C Programming Complete Notes") + .subject("Programming") + .department("Computer Science & Engineering") + .semester(1) + .fileType("notes") + .downloadUrl("#") + .fileSize("6.3 MB") + .downloadsCount(734) + .uploadedAt(LocalDateTime.now()) + .build(), + NotePyq.builder() + .title("Data Structures PYQ 2019-2024") + .subject("Data Structures") + .department("Computer Science & Engineering") + .semester(3) + .fileType("pyq") + .downloadUrl("#") + .fileSize("10.2 MB") + .downloadsCount(621) + .uploadedAt(LocalDateTime.now()) + .build(), + NotePyq.builder() + .title("Circuit Theory Full Notes") + .subject("Circuit Theory") + .department("Electronics & Communication") + .semester(2) + .fileType("notes") + .downloadUrl("#") + .fileSize("5.7 MB") + .downloadsCount(289) + .uploadedAt(LocalDateTime.now()) + .build(), + NotePyq.builder() + .title("Anna University Syllabus 2021") + .subject("Syllabus") + .department("All Departments") + .semester(1) + .fileType("syllabus") + .downloadUrl("#") + .fileSize("2.1 MB") + .downloadsCount(890) + .uploadedAt(LocalDateTime.now()) + .build(), + NotePyq.builder() + .title("Thermodynamics Notes") + .subject("Thermodynamics") + .department("Mechanical Engineering") + .semester(3) + .fileType("notes") + .downloadUrl("#") + .fileSize("3.9 MB") + .downloadsCount(201) + .uploadedAt(LocalDateTime.now()) + .build(), + NotePyq.builder() + .title("Digital Electronics PYQ") + .subject("Digital Electronics") + .department("Electronics & Communication") + .semester(4) + .fileType("pyq") + .downloadUrl("#") + .fileSize("7.3 MB") + .downloadsCount(445) + .uploadedAt(LocalDateTime.now()) + .build() + )); + System.out.println("🌱 Database successfully seeded with Notes & PYQs test data!"); + } + } +} diff --git a/backend/src/main/java/com/rit/portal/controller/NotePyqController.java b/backend/src/main/java/com/rit/portal/controller/NotePyqController.java new file mode 100644 index 0000000..ebdad65 --- /dev/null +++ b/backend/src/main/java/com/rit/portal/controller/NotePyqController.java @@ -0,0 +1,52 @@ +package com.rit.portal.controller; + +import com.rit.portal.entity.NotePyq; +import com.rit.portal.repository.NotePyqRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import java.util.List; + +@RestController +@RequestMapping("/api/notes") +@CrossOrigin(origins = "*") // CrossOrigin configured globally, but added here for safety +public class NotePyqController { + + @Autowired + private NotePyqRepository noteRepository; + + // Get all notes + @GetMapping + public List getAllNotes() { + return noteRepository.findAll(); + } + + // Get notes by semester + @GetMapping("/semester/{semester}") + public List getNotesBySemester(@PathVariable Integer semester) { + return noteRepository.findBySemester(semester); + } + + // Get notes by department + @GetMapping("/department") + public List getNotesByDepartment(@RequestParam String dept) { + return noteRepository.findByDepartment(dept); + } + + // Add a new note metadata + @PostMapping + public NotePyq createNote(@RequestBody NotePyq note) { + return noteRepository.save(note); + } + + // Increment downloads count + @PostMapping("/{id}/download") + public ResponseEntity incrementDownloads(@PathVariable Long id) { + return noteRepository.findById(id).map(note -> { + note.setDownloadsCount(note.getDownloadsCount() + 1); + note.setFileType(note.getFileType()); // Keep dirty check + noteRepository.save(note); + return ResponseEntity.ok().build(); + }).orElse(ResponseEntity.notFound().build()); + } +} diff --git a/backend/src/main/java/com/rit/portal/entity/NotePyq.java b/backend/src/main/java/com/rit/portal/entity/NotePyq.java new file mode 100644 index 0000000..d71892b --- /dev/null +++ b/backend/src/main/java/com/rit/portal/entity/NotePyq.java @@ -0,0 +1,46 @@ +package com.rit.portal.entity; + +import jakarta.persistence.*; +import lombok.*; +import java.time.LocalDateTime; + +@Entity +@Table(name = "notes_pyqs") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class NotePyq { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(nullable = false) + private String title; + + @Column(nullable = false) + private String subject; + + @Column(nullable = false) + private String department; + + @Column(nullable = false) + private Integer semester; + + @Column(name = "file_type", nullable = false) + private String fileType; // 'notes', 'pyq', 'syllabus', 'assignment' + + @Column(name = "download_url", nullable = false) + private String downloadUrl; + + @Column(name = "file_size", nullable = false) + private String fileSize; + + @Column(name = "downloads_count") + private Integer downloadsCount = 0; + + @Column(name = "uploaded_at") + private LocalDateTime uploadedAt = LocalDateTime.now(); +} diff --git a/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java b/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java new file mode 100644 index 0000000..6a9fd1d --- /dev/null +++ b/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java @@ -0,0 +1,13 @@ +package com.rit.portal.repository; + +import com.rit.portal.entity.NotePyq; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import java.util.List; + +@Repository +public interface NotePyqRepository extends JpaRepository { + List findBySemester(Integer semester); + List findByDepartment(String department); + List findByFileType(String fileType); +} diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 2599148..c24917f 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,7 +1,7 @@ # ─── DATABASE CONNECTION CONFIGURATION ─── spring.datasource.url=jdbc:postgresql://localhost:5432/rit_freshers_hub?sslmode=disable spring.datasource.username=postgres -spring.datasource.password=your_local_postgres_password_here +spring.datasource.password=Amudiesh22@. # ─── JPA / HIBERNATE SETTINGS ─── spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect diff --git a/public/images.jpg b/public/images.jpg new file mode 100644 index 0000000..59cf058 Binary files /dev/null and b/public/images.jpg differ diff --git a/src/constants/index.ts b/src/constants/index.ts index b032620..07d88c0 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -12,11 +12,11 @@ export const NAV_LINKS = [ // ─── Stats ──────────────────────────────────────────────────────────────────── export const STATS: Stat[] = [ - { value: 150, suffix: '+', label: 'PYQs', icon: 'FileText' }, - { value: 40, suffix: '+', label: 'Faculty', icon: 'Users' }, - { value: 25, suffix: '+', label: 'Clubs', icon: 'Star' }, + { value: 20, suffix: '+', label: 'Sports', icon: 'Trophy' }, + { value: 100, suffix: '+', label: 'Faculty', icon: 'Users' }, + { value: 18, suffix: '', label: 'Clubs', icon: 'Star' }, { value: 24, suffix: '/7', label: 'AI Assistant', icon: 'Bot' }, - { value: 1000, suffix: '+', label: 'Students', icon: 'GraduationCap' }, + { value: 5000, suffix: '+', label: 'Students', icon: 'GraduationCap' }, ]; // ─── Features ──────────────────────────────────────────────────────────────── diff --git a/src/pages/Home/Home.tsx b/src/pages/Home/Home.tsx index 0270995..edb4ecd 100644 --- a/src/pages/Home/Home.tsx +++ b/src/pages/Home/Home.tsx @@ -39,154 +39,35 @@ export default function Home() { transition={{ duration: 0.7 }} className="relative w-full max-w-lg" > - {/* Main campus image/graphic card */} + {/* Main campus image/graphic card with soft blurry drop shadow */}
- {/* Inline Premium Vector SVG Illustration of RIT Campus Building & Canopy */} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {/* Sky */} - - - {/* Glowing Sun */} - - - {/* Distant Hills / Tree Line */} - - - - {/* Academic Building Facade (Modern RIT Blocks) */} - - {/* Windows Grid */} - - {/* Row 1 */} - - - - - {/* Row 2 */} - - - - - {/* Row 3 */} - - - - - - - {/* Main Entrance Pillars & Arch (RIT Architecture) */} - - - - {/* Premium Canopy Truss Structure (RIT Event Canopy Representation) */} - - - - - - - - - - {/* Cross trusses */} - - - - - - - - {/* Columns supporting Canopy */} - - - - - - {/* Campus Pathway leading to building */} - - - - - {/* Trees & Foliage in Foreground */} - - - - - - - - - - - - {/* Subtle dark gradient overlay to ensure text contrast */} -
+ Rajalakshmi Institute of Technology Campus - {/* Text on top of the image (RIT Events Hub Style) */} -
-

- Rajalakshmi Institute -

-

- of Technology, Chennai -

-
- - Est. 2008 • NBA & NAAC A+ + {/* Subtle dark gradient overlay to ensure text contrast */} +
+ + {/* Text on top of the image (RIT Events Hub Style) */} +
+

+ Rajalakshmi Institute +

+

+ of Technology, Chennai +

+
+ + Est. 2008 • NBA & NAAC A+ +
-
- - {/* Overlapping Dark Card (Innovation Card - Exact Match with Reference Image) */} - - - INNOVATION - -

- Where engineering meets guidance. Fueling the academic journey of our freshers. -

-
{/* Right – Text Content */} @@ -231,7 +112,7 @@ export default function Home() { transition={{ duration: 0.6, delay: 0.3 }} className="flex flex-wrap gap-4 mb-8" > - + - + {/* ─── Features Section ─────────────────────────────────────────────────── */} -
+