diff --git a/.gitignore b/.gitignore index a547bf3..2791342 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,11 @@ dist-ssr *.njsproj *.sln *.sw? +*.db + +# Environments +.env +.env.local +.env.* +.env.development +.env.production diff --git a/backend/src/main/java/com/rit/portal/config/DataInitializer.java b/backend/src/main/java/com/rit/portal/config/DataInitializer.java index 844a3f0..4a0dd3b 100644 --- a/backend/src/main/java/com/rit/portal/config/DataInitializer.java +++ b/backend/src/main/java/com/rit/portal/config/DataInitializer.java @@ -1,12 +1,21 @@ package com.rit.portal.config; import com.rit.portal.entity.NotePyq; +import com.rit.portal.entity.BusRoute; +import com.rit.portal.entity.BusStop; import com.rit.portal.repository.NotePyqRepository; +import com.rit.portal.repository.BusRouteRepository; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; +import java.io.InputStream; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; +import java.util.Map; @Component public class DataInitializer implements CommandLineRunner { @@ -14,6 +23,9 @@ public class DataInitializer implements CommandLineRunner { @Autowired private NotePyqRepository noteRepository; + @Autowired + private BusRouteRepository busRouteRepository; + @Override public void run(String... args) throws Exception { if (noteRepository.count() == 0) { @@ -109,5 +121,52 @@ public class DataInitializer implements CommandLineRunner { )); System.out.println("🌱 Database successfully seeded with Notes & PYQs test data!"); } + + // Seed Bus Routes + if (busRouteRepository.count() == 0) { + try { + ObjectMapper mapper = new ObjectMapper(); + InputStream is = getClass().getResourceAsStream("/bus_routes.json"); + if (is != null) { + List> routesList = mapper.readValue(is, new TypeReference>>() {}); + List routesToSave = new ArrayList<>(); + + for (Map routeMap : routesList) { + BusRoute br = BusRoute.builder() + .number((String) routeMap.get("number")) + .name((String) routeMap.get("name")) + .from((String) routeMap.get("from")) + .to((String) routeMap.get("to")) + .departureTime((String) routeMap.get("departureTime")) + .arrivalTime((String) routeMap.get("arrivalTime")) + .color((String) routeMap.get("color")) + .build(); + + List> stopsList = (List>) routeMap.get("stops"); + List stops = new ArrayList<>(); + if (stopsList != null) { + for (int i = 0; i < stopsList.size(); i++) { + Map stopMap = stopsList.get(i); + stops.add(BusStop.builder() + .route(br) + .name(stopMap.get("name")) + .time(stopMap.get("time")) + .stopOrder(i + 1) + .build()); + } + } + br.setStops(stops); + routesToSave.add(br); + } + busRouteRepository.saveAll(routesToSave); + System.out.println("🌱 Database successfully seeded with " + routesToSave.size() + " Bus Routes and stops!"); + } else { + System.err.println("⚠️ Could not find bus_routes.json in resources!"); + } + } catch (Exception e) { + System.err.println("❌ Failed to seed bus routes: " + e.getMessage()); + e.printStackTrace(); + } + } } } diff --git a/backend/src/main/java/com/rit/portal/config/WebConfig.java b/backend/src/main/java/com/rit/portal/config/WebConfig.java index 680bdc3..3f5ef5f 100644 --- a/backend/src/main/java/com/rit/portal/config/WebConfig.java +++ b/backend/src/main/java/com/rit/portal/config/WebConfig.java @@ -10,7 +10,7 @@ public class WebConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/api/**") - .allowedOrigins("http://localhost:5173", "http://localhost:3000") + .allowedOriginPatterns("*") .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") .allowedHeaders("*") .allowCredentials(true); diff --git a/backend/src/main/java/com/rit/portal/controller/BusRouteController.java b/backend/src/main/java/com/rit/portal/controller/BusRouteController.java new file mode 100644 index 0000000..da11521 --- /dev/null +++ b/backend/src/main/java/com/rit/portal/controller/BusRouteController.java @@ -0,0 +1,20 @@ +package com.rit.portal.controller; + +import com.rit.portal.entity.BusRoute; +import com.rit.portal.repository.BusRouteRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.List; + +@RestController +@RequestMapping("/api/bus-routes") +public class BusRouteController { + + @Autowired + private BusRouteRepository busRouteRepository; + + @GetMapping + public List getAllBusRoutes() { + return busRouteRepository.findAll(); + } +} diff --git a/backend/src/main/java/com/rit/portal/controller/CommunityQuestionController.java b/backend/src/main/java/com/rit/portal/controller/CommunityQuestionController.java new file mode 100644 index 0000000..a97b8fb --- /dev/null +++ b/backend/src/main/java/com/rit/portal/controller/CommunityQuestionController.java @@ -0,0 +1,97 @@ +package com.rit.portal.controller; + +import com.rit.portal.entity.CommunityAnswer; +import com.rit.portal.entity.CommunityQuestion; +import com.rit.portal.repository.CommunityAnswerRepository; +import com.rit.portal.repository.CommunityQuestionRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.client.RestTemplate; +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/api/questions") +public class CommunityQuestionController { + + @Autowired + private CommunityQuestionRepository questionRepository; + + @Autowired + private CommunityAnswerRepository answerRepository; + + private final RestTemplate restTemplate = new RestTemplate(); + private static final String TELEGRAM_BOT_URL = "http://localhost:8082/send_question"; + + @GetMapping + public List getAllQuestions() { + return questionRepository.findAll(); + } + + @GetMapping("/paged") + public org.springframework.data.domain.Page getPagedQuestions( + @RequestParam(defaultValue = "0") int page, + @RequestParam(defaultValue = "5") int size) { + return questionRepository.findAll( + org.springframework.data.domain.PageRequest.of( + page, + size, + org.springframework.data.domain.Sort.by("createdAt").descending() + ) + ); + } + + @PostMapping + public CommunityQuestion createQuestion(@RequestBody CommunityQuestion question) { + if (question.getUpvotes() == null) question.setUpvotes(0); + if (question.getIsAnswered() == null) question.setIsAnswered(false); + question.setCreatedAt(LocalDateTime.now()); + + CommunityQuestion saved = questionRepository.save(question); + + // Notify Telegram bot in a background thread to keep it robust and non-blocking + new Thread(() -> { + try { + Map payload = new HashMap<>(); + payload.put("question_id", saved.getId()); + payload.put("title", saved.getTitle()); + payload.put("body", saved.getBody()); + payload.put("author", saved.getAuthor()); + + restTemplate.postForEntity(TELEGRAM_BOT_URL, payload, String.class); + } catch (Exception e) { + System.err.println("Failed to notify Telegram Bot intermediary: " + e.getMessage()); + } + }).start(); + + return saved; + } + + @PostMapping("/{id}/answers") + public ResponseEntity addAnswer(@PathVariable Integer id, @RequestBody CommunityAnswer answer) { + return questionRepository.findById(id).map(question -> { + answer.setQuestion(question); + if (answer.getUpvotes() == null) answer.setUpvotes(0); + if (answer.getIsAccepted() == null) answer.setIsAccepted(false); + answer.setCreatedAt(LocalDateTime.now()); + + CommunityAnswer savedAnswer = answerRepository.save(answer); + + question.setIsAnswered(true); + questionRepository.save(question); + + return ResponseEntity.ok(savedAnswer); + }).orElse(ResponseEntity.notFound().build()); + } + + @PostMapping("/{id}/upvote") + public ResponseEntity upvoteQuestion(@PathVariable Integer id) { + return questionRepository.findById(id).map(question -> { + question.setUpvotes(question.getUpvotes() + 1); + return ResponseEntity.ok(questionRepository.save(question)); + }).orElse(ResponseEntity.notFound().build()); + } +} diff --git a/backend/src/main/java/com/rit/portal/controller/NotePyqController.java b/backend/src/main/java/com/rit/portal/controller/NotePyqController.java index ebdad65..54ff9c6 100644 --- a/backend/src/main/java/com/rit/portal/controller/NotePyqController.java +++ b/backend/src/main/java/com/rit/portal/controller/NotePyqController.java @@ -9,7 +9,6 @@ import java.util.List; @RestController @RequestMapping("/api/notes") -@CrossOrigin(origins = "*") // CrossOrigin configured globally, but added here for safety public class NotePyqController { @Autowired @@ -41,7 +40,7 @@ public class NotePyqController { // Increment downloads count @PostMapping("/{id}/download") - public ResponseEntity incrementDownloads(@PathVariable Long id) { + public ResponseEntity incrementDownloads(@PathVariable Integer id) { return noteRepository.findById(id).map(note -> { note.setDownloadsCount(note.getDownloadsCount() + 1); note.setFileType(note.getFileType()); // Keep dirty check diff --git a/backend/src/main/java/com/rit/portal/entity/BusRoute.java b/backend/src/main/java/com/rit/portal/entity/BusRoute.java new file mode 100644 index 0000000..58552ea --- /dev/null +++ b/backend/src/main/java/com/rit/portal/entity/BusRoute.java @@ -0,0 +1,46 @@ +package com.rit.portal.entity; + +import jakarta.persistence.*; +import lombok.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Table(name = "bus_routes") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class BusRoute { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name = "route_number", unique = true, nullable = false) + private String number; + + @Column(name = "route_name", nullable = false) + private String name; + + @Column(name = "start_point", nullable = false) + private String from; + + @Column(name = "end_point", nullable = false) + private String to; + + @Column(name = "departure_time", nullable = false) + private String departureTime; + + @Column(name = "arrival_time", nullable = false) + private String arrivalTime; + + @Column(name = "color_code") + private String color; + + @OneToMany(mappedBy = "route", cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OrderBy("stopOrder ASC") + @Builder.Default + private List stops = new ArrayList<>(); +} diff --git a/backend/src/main/java/com/rit/portal/entity/BusStop.java b/backend/src/main/java/com/rit/portal/entity/BusStop.java new file mode 100644 index 0000000..a92361f --- /dev/null +++ b/backend/src/main/java/com/rit/portal/entity/BusStop.java @@ -0,0 +1,33 @@ +package com.rit.portal.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Table(name = "bus_stops") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class BusStop { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "route_id", nullable = false) + @JsonIgnore + private BusRoute route; + + @Column(name = "stop_name", nullable = false) + private String name; + + @Column(name = "arrival_time", nullable = false) + private String time; + + @Column(name = "stop_order", nullable = false) + private Integer stopOrder; +} diff --git a/backend/src/main/java/com/rit/portal/entity/CommunityAnswer.java b/backend/src/main/java/com/rit/portal/entity/CommunityAnswer.java new file mode 100644 index 0000000..2c49cad --- /dev/null +++ b/backend/src/main/java/com/rit/portal/entity/CommunityAnswer.java @@ -0,0 +1,40 @@ +package com.rit.portal.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.*; +import java.time.LocalDateTime; + +@Entity +@Table(name = "community_answers") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class CommunityAnswer { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "question_id", nullable = false) + @JsonIgnore + private CommunityQuestion question; + + @Column(nullable = false, columnDefinition = "TEXT") + private String body; + + @Column(nullable = false) + private String author; + + @Column(name = "upvotes") + private Integer upvotes = 0; + + @Column(name = "is_accepted") + private Boolean isAccepted = false; + + @Column(name = "created_at") + private LocalDateTime createdAt = LocalDateTime.now(); +} diff --git a/backend/src/main/java/com/rit/portal/entity/CommunityQuestion.java b/backend/src/main/java/com/rit/portal/entity/CommunityQuestion.java new file mode 100644 index 0000000..0bf8012 --- /dev/null +++ b/backend/src/main/java/com/rit/portal/entity/CommunityQuestion.java @@ -0,0 +1,46 @@ +package com.rit.portal.entity; + +import jakarta.persistence.*; +import lombok.*; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Table(name = "community_questions") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class CommunityQuestion { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(nullable = false) + private String title; + + @Column(nullable = false, columnDefinition = "TEXT") + private String body; + + @Column(nullable = false) + private String author; + + @Column(name = "upvotes") + private Integer upvotes = 0; + + @Column(name = "tags", columnDefinition = "text[]") + private List tags = new ArrayList<>(); + + @Column(name = "is_answered") + private Boolean isAnswered = false; + + @Column(name = "created_at") + private LocalDateTime createdAt = LocalDateTime.now(); + + @OneToMany(mappedBy = "question", cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @Builder.Default + private List answers = new ArrayList<>(); +} diff --git a/backend/src/main/java/com/rit/portal/entity/NotePyq.java b/backend/src/main/java/com/rit/portal/entity/NotePyq.java index d71892b..9fb586a 100644 --- a/backend/src/main/java/com/rit/portal/entity/NotePyq.java +++ b/backend/src/main/java/com/rit/portal/entity/NotePyq.java @@ -15,7 +15,7 @@ public class NotePyq { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + private Integer id; @Column(nullable = false) private String title; diff --git a/backend/src/main/java/com/rit/portal/repository/BusRouteRepository.java b/backend/src/main/java/com/rit/portal/repository/BusRouteRepository.java new file mode 100644 index 0000000..9e9db04 --- /dev/null +++ b/backend/src/main/java/com/rit/portal/repository/BusRouteRepository.java @@ -0,0 +1,10 @@ +package com.rit.portal.repository; + +import com.rit.portal.entity.BusRoute; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface BusRouteRepository extends JpaRepository { + BusRoute findByNumber(String number); +} diff --git a/backend/src/main/java/com/rit/portal/repository/BusStopRepository.java b/backend/src/main/java/com/rit/portal/repository/BusStopRepository.java new file mode 100644 index 0000000..3cb3a9c --- /dev/null +++ b/backend/src/main/java/com/rit/portal/repository/BusStopRepository.java @@ -0,0 +1,9 @@ +package com.rit.portal.repository; + +import com.rit.portal.entity.BusStop; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface BusStopRepository extends JpaRepository { +} diff --git a/backend/src/main/java/com/rit/portal/repository/CommunityAnswerRepository.java b/backend/src/main/java/com/rit/portal/repository/CommunityAnswerRepository.java new file mode 100644 index 0000000..302685f --- /dev/null +++ b/backend/src/main/java/com/rit/portal/repository/CommunityAnswerRepository.java @@ -0,0 +1,9 @@ +package com.rit.portal.repository; + +import com.rit.portal.entity.CommunityAnswer; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CommunityAnswerRepository extends JpaRepository { +} diff --git a/backend/src/main/java/com/rit/portal/repository/CommunityQuestionRepository.java b/backend/src/main/java/com/rit/portal/repository/CommunityQuestionRepository.java new file mode 100644 index 0000000..72dd96f --- /dev/null +++ b/backend/src/main/java/com/rit/portal/repository/CommunityQuestionRepository.java @@ -0,0 +1,9 @@ +package com.rit.portal.repository; + +import com.rit.portal.entity.CommunityQuestion; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CommunityQuestionRepository extends JpaRepository { +} diff --git a/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java b/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java index 6a9fd1d..c14e7fd 100644 --- a/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java +++ b/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java @@ -6,7 +6,7 @@ import org.springframework.stereotype.Repository; import java.util.List; @Repository -public interface NotePyqRepository extends JpaRepository { +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 b478081..01616ef 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=${DB_PASSWORD:postgres} +spring.datasource.password=${DB_PASSWORD:jouganxd1011} # ─── JPA / HIBERNATE SETTINGS ─── spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect diff --git a/backend/src/main/resources/bus_routes.json b/backend/src/main/resources/bus_routes.json new file mode 100644 index 0000000..206abbc --- /dev/null +++ b/backend/src/main/resources/bus_routes.json @@ -0,0 +1,2771 @@ +[ + { + "number": "R01", + "name": "Ennore Route", + "from": "Lift Gate", + "to": "RIT Campus", + "departureTime": "05:50 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Lift Gate", + "time": "05:50 AM" + }, + { + "name": "Wimco Market", + "time": "05:55 AM" + }, + { + "name": "Ajax", + "time": "06:00 AM" + }, + { + "name": "Periyar Nagar", + "time": "06:03 AM" + }, + { + "name": "Thiruvortiyur Market", + "time": "06:08 AM" + }, + { + "name": "Theradi", + "time": "06:10 AM" + }, + { + "name": "Ellaimman Koil", + "time": "06:12 AM" + }, + { + "name": "Raja Kadai", + "time": "06:14 AM" + }, + { + "name": "Toll Gate", + "time": "06:15 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R01A", + "name": "Tondiarpet Route", + "from": "New vannarpettai", + "to": "RIT Campus", + "departureTime": "06:17 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "New vannarpettai", + "time": "06:17 AM" + }, + { + "name": "Apollo", + "time": "06:18 AM" + }, + { + "name": "Tondiarpet", + "time": "06:19 AM" + }, + { + "name": "Maharani", + "time": "06:21 AM" + }, + { + "name": "Mint", + "time": "06:22 AM" + }, + { + "name": "New Bus Stand Mint", + "time": "06:27 AM" + }, + { + "name": "Thirupalli street", + "time": "06:33 AM" + }, + { + "name": "Aminijkarai", + "time": "07:00 AM" + }, + { + "name": "Skywalk", + "time": "07:02 AM" + }, + { + "name": "Arumbakkam", + "time": "07:07 AM" + }, + { + "name": "Koyambedu Metro", + "time": "07:10 AM" + }, + { + "name": "Vengaya mandi", + "time": "07:16 AM" + }, + { + "name": "Ration stop (Nerkundram)", + "time": "07:20 AM" + }, + { + "name": "Maduravoyal", + "time": "07:21 AM" + }, + { + "name": "Maduravoyal Erikarai", + "time": "07:25 AM" + }, + { + "name": "Vanagaram", + "time": "07:29 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R01B", + "name": "Kasimedu Route", + "from": "Kasimedu", + "to": "RIT Campus", + "departureTime": "06:15 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kasimedu", + "time": "06:15 AM" + }, + { + "name": "Kalmandapam", + "time": "06:21 AM" + }, + { + "name": "Royapuram Bridge", + "time": "06:27 AM" + }, + { + "name": "Beach Station", + "time": "06:30 AM" + }, + { + "name": "Parry's", + "time": "06:34 AM" + }, + { + "name": "Central", + "time": "06:37 AM" + }, + { + "name": "Egmore", + "time": "06:40 AM" + }, + { + "name": "Dasprakash", + "time": "06:44 AM" + }, + { + "name": "Eaga Theatre", + "time": "06:48 AM" + }, + { + "name": "Amjikarai Market", + "time": "06:51 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R02", + "name": "Triplicane Route", + "from": "Chintadripet (Post Offiec)", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Chintadripet (Post Offiec)", + "time": "06:20 AM" + }, + { + "name": "D1 Police Station", + "time": "06:25 AM" + }, + { + "name": "Triplicane -High Way", + "time": "06:29 AM" + }, + { + "name": "Ice House Police Station", + "time": "06:32 AM" + }, + { + "name": "Meersahibpet-Market", + "time": "06:35 AM" + }, + { + "name": "Royapettah New College", + "time": "06:39 AM" + }, + { + "name": "Sterling Road (Bharath Petrol Bunk)", + "time": "06:40 AM" + }, + { + "name": "Choolaimedu Subway", + "time": "06:43 AM" + }, + { + "name": "Choolaimedu bus stop", + "time": "06:45 AM" + }, + { + "name": "Anna Arch", + "time": "06:50 AM" + }, + { + "name": "Arumbakkam Panchaliamman Koil", + "time": "06:53 AM" + }, + { + "name": "NSK", + "time": "06:55 AM" + }, + { + "name": "Maduravoyal- Murugan Store", + "time": "06:58 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R03", + "name": "Choolai Route", + "from": "Pulianthope", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Pulianthope", + "time": "06:20 AM" + }, + { + "name": "Choolai Post Office", + "time": "06:25 AM" + }, + { + "name": "Purasaivakkam Doveton", + "time": "06:30 AM" + }, + { + "name": "Kellys Signal", + "time": "06:33 AM" + }, + { + "name": "Water tank road signal", + "time": "06:40 AM" + }, + { + "name": "Kilpauk Garden", + "time": "06:45 AM" + }, + { + "name": "Chinthamani", + "time": "06:50 AM" + }, + { + "name": "Anna Nagar Roundtana", + "time": "06:55 AM" + }, + { + "name": "Thirumangalam Blue star", + "time": "06:57 AM" + }, + { + "name": "VR Mall", + "time": "07:00 AM" + }, + { + "name": "Maduravoyal Ration Shop", + "time": "07:10 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R03A", + "name": "Collector Nagar Route", + "from": "Collector nagar", + "to": "RIT Campus", + "departureTime": "06:50 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Collector nagar", + "time": "06:50 AM" + }, + { + "name": "Golden flat", + "time": "06:55 AM" + }, + { + "name": "Mogappair West depot", + "time": "07:00 AM" + }, + { + "name": "Nolambur", + "time": "07:03 AM" + }, + { + "name": "MGR University", + "time": "07:08 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R03B", + "name": "Water Tank Route", + "from": "Gangaiamman koil", + "to": "RIT Campus", + "departureTime": "06:40 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Gangaiamman koil", + "time": "06:40 AM" + }, + { + "name": "Madina masjid", + "time": "06:43 AM" + }, + { + "name": "New Avadi Road", + "time": "06:45 AM" + }, + { + "name": "Chintamani", + "time": "06:50 AM" + }, + { + "name": "Nalli Store", + "time": "06:58 AM" + }, + { + "name": "Anna Nagar Metro", + "time": "07:05 AM" + }, + { + "name": "Thirumangalam Metro", + "time": "07:10 AM" + }, + { + "name": "Nerkundram", + "time": "07:15 AM" + }, + { + "name": "Maduravaoyal Ration Shop", + "time": "07:25 AM" + }, + { + "name": "Maduravoyal Erikarai", + "time": "07:27 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R04", + "name": "East Mogappair Route", + "from": "JJ Nagar Police Station", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "JJ Nagar Police Station", + "time": "06:30 AM" + }, + { + "name": "HDFC Bank", + "time": "06:32 AM" + }, + { + "name": "IOB Bank", + "time": "06:35 AM" + }, + { + "name": "7 H Bus Depot", + "time": "06:40 AM" + }, + { + "name": "Amutha School", + "time": "06:50 AM" + }, + { + "name": "D.R.Super Market", + "time": "06:52 AM" + }, + { + "name": "Nolambur", + "time": "06:55 AM" + }, + { + "name": "Meadows Apprtment", + "time": "06:57 AM" + }, + { + "name": "MGR University", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R05", + "name": "CIT Nagar Route", + "from": "CIT Nagar", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "CIT Nagar", + "time": "06:10 AM" + }, + { + "name": "Aranganathan Subway", + "time": "06:12 AM" + }, + { + "name": "Srinivasa Theatre", + "time": "06:14 AM" + }, + { + "name": "Metupalayam", + "time": "06:16 AM" + }, + { + "name": "Sangamam Hotel", + "time": "06:19 AM" + }, + { + "name": "Aryagowda Road", + "time": "06:24 AM" + }, + { + "name": "Vivek", + "time": "06:29 AM" + }, + { + "name": "Usman Road", + "time": "06:34 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R05A", + "name": "Loyola College Route", + "from": "Loyola College", + "to": "RIT Campus", + "departureTime": "06:40 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Loyola College", + "time": "06:40 AM" + }, + { + "name": "Choolaimedu", + "time": "06:45 AM" + }, + { + "name": "Metha Nagar", + "time": "06:49 AM" + }, + { + "name": "NSK Nagar", + "time": "06:55 AM" + }, + { + "name": "Arumbakkam (SBI Bank)", + "time": "07:00 AM" + }, + { + "name": "MMDA Cholan Street", + "time": "07:05 AM" + }, + { + "name": "MMDA Vallavan Hotel", + "time": "07:10 AM" + }, + { + "name": "CMBT (Koyambedu)", + "time": "07:15 AM" + }, + { + "name": "Rohini (Theatre)", + "time": "07:18 AM" + }, + { + "name": "Nerkundram Vengaya Mandi", + "time": "07:22 AM" + }, + { + "name": "Maduravoyal Erikarai", + "time": "07:25 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R06", + "name": "Chinmayanagar Route", + "from": "Chinmaiya Nagar", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Chinmaiya Nagar", + "time": "06:10 AM" + }, + { + "name": "Sai Nagar", + "time": "06:12 AM" + }, + { + "name": "Natesan Nagar", + "time": "06:13 AM" + }, + { + "name": "Elango Nagar", + "time": "06:14 AM" + }, + { + "name": "Virugampakkam", + "time": "06:17 AM" + }, + { + "name": "KK Nagar", + "time": "06:20 AM" + }, + { + "name": "KK Nagar ESI", + "time": "06:27 AM" + }, + { + "name": "Ashok Pillar", + "time": "06:32 AM" + }, + { + "name": "Kasi Theatre", + "time": "06:37 AM" + }, + { + "name": "Ekkatuthangal", + "time": "06:42 AM" + }, + { + "name": "Olympia", + "time": "06:43 AM" + }, + { + "name": "Porur Saravana Store", + "time": "06:55 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R07", + "name": "Santhome Route", + "from": "Mandaveli Bus Depot", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "Mandaveli Bus Depot", + "time": "06:10 AM" + }, + { + "name": "Pattinapakkam", + "time": "06:15 AM" + }, + { + "name": "Kutchery Road", + "time": "06:20 AM" + }, + { + "name": "Luz Corner", + "time": "06:25 AM" + }, + { + "name": "P.S.Sivasamy Road", + "time": "06:27 AM" + }, + { + "name": "SIET College", + "time": "06:32 AM" + }, + { + "name": "Nanthanam Signal", + "time": "06:37 AM" + }, + { + "name": "Saidapet Vetrinary Hospital", + "time": "06:42 AM" + }, + { + "name": "Saidapet Bus Stop", + "time": "06:47 AM" + }, + { + "name": "Guindy", + "time": "06:49 AM" + }, + { + "name": "Butt Road", + "time": "06:55 AM" + }, + { + "name": "Chennai Trade Centre", + "time": "07:10 AM" + }, + { + "name": "Porur", + "time": "07:15 AM" + }, + { + "name": "Ayyapanthangal", + "time": "07:18 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R08", + "name": "Kovilambakkam Route", + "from": "Kovilampakkam", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kovilampakkam", + "time": "06:10 AM" + }, + { + "name": "Keelkattalai Bus Stop", + "time": "06:12 AM" + }, + { + "name": "Madipakkam UTI Bank", + "time": "06:15 AM" + }, + { + "name": "Madipakkam Koot Road Bus stop", + "time": "06:16 AM" + }, + { + "name": "Ranga Theatre", + "time": "06:18 AM" + }, + { + "name": "Nanganallur Chidambaram Stores", + "time": "06:10 AM" + }, + { + "name": "Nanganallur Saravana Hotel", + "time": "06:22 AM" + }, + { + "name": "Vanuvampet Church", + "time": "06:25 AM" + }, + { + "name": "Surendhar Nagar Bus Stop", + "time": "06:27 AM" + }, + { + "name": "Jayalakshmi Theatre", + "time": "06:29 AM" + }, + { + "name": "Thillai Ganga Nagar Sub Way", + "time": "06:32 AM" + }, + { + "name": "Aazar Khana Bus Stop", + "time": "06:35 AM" + }, + { + "name": "Butt Road", + "time": "06:37 AM" + }, + { + "name": "Ramavaram", + "time": "06:39 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R08A", + "name": "Adambakkam Route", + "from": "Seasons", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Seasons", + "time": "06:30 AM" + }, + { + "name": "Kakkan Bridge", + "time": "06:33 AM" + }, + { + "name": "Adambakkam Bus Depot", + "time": "06:35 AM" + }, + { + "name": "St Thomas Mount", + "time": "06:38 AM" + }, + { + "name": "Deepam Foods", + "time": "06:40 AM" + }, + { + "name": "Maharaja traders", + "time": "06:45 AM" + }, + { + "name": "Vanuvampet church", + "time": "06:50 AM" + }, + { + "name": "Thilaiganga nagar subway", + "time": "06:55 AM" + }, + { + "name": "Butt road", + "time": "07:00 AM" + }, + { + "name": "Poonamallee", + "time": "07:35 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R09", + "name": "MKB Nagar Route", + "from": "Vyasarpadi", + "to": "RIT Campus", + "departureTime": "06:00 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Vyasarpadi", + "time": "06:00 AM" + }, + { + "name": "MKB Nagar", + "time": "06:05 AM" + }, + { + "name": "E.B. Stop", + "time": "06:08 AM" + }, + { + "name": "Kannadhasan Nagar", + "time": "06:10 AM" + }, + { + "name": "M.R.Nagar", + "time": "06:13 AM" + }, + { + "name": "lakshmi Amman Nagar", + "time": "06:22 AM" + }, + { + "name": "B.B.Road", + "time": "06:26 AM" + }, + { + "name": "Perumbur Market", + "time": "06:34 AM" + }, + { + "name": "Agaram", + "time": "06:40 AM" + }, + { + "name": "Peravalur Road", + "time": "06:42 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R10", + "name": "Thachoor Route", + "from": "Thachoor", + "to": "RIT Campus", + "departureTime": "05:50 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Thachoor", + "time": "05:50 AM" + }, + { + "name": "Panjetty", + "time": "05:52 AM" + }, + { + "name": "Janappanchatram Bypass", + "time": "05:55 AM" + }, + { + "name": "Karanodai Bypass", + "time": "05:58 AM" + }, + { + "name": "Vijaya Nallur", + "time": "06:03 AM" + }, + { + "name": "Toll Gate", + "time": "06:05 AM" + }, + { + "name": "Padianallur", + "time": "06:07 AM" + }, + { + "name": "Red Hills (GRT)", + "time": "06:10 AM" + }, + { + "name": "Red Hills Market", + "time": "06:12 AM" + }, + { + "name": "Kavangarai", + "time": "06:15 AM" + }, + { + "name": "Puzhal Jail", + "time": "06:17 AM" + }, + { + "name": "Puzhal Camp", + "time": "06:20 AM" + }, + { + "name": "Velammal college", + "time": "06:25 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R11", + "name": "Chengalpattu Route", + "from": "Chengalpattu Rattinakinaru", + "to": "RIT Campus", + "departureTime": "06:00 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Chengalpattu Rattinakinaru", + "time": "06:00 AM" + }, + { + "name": "New Bus Stand", + "time": "06:02 AM" + }, + { + "name": "Old Bus Stand", + "time": "06:04 AM" + }, + { + "name": "Chengalpattu Bypass", + "time": "06:07 AM" + }, + { + "name": "SP Kovil", + "time": "06:18 AM" + }, + { + "name": "MM Nagar Samiyar Gate", + "time": "06:23 AM" + }, + { + "name": "MM Nagar Bus Stand", + "time": "06:28 AM" + }, + { + "name": "KattanKulathur", + "time": "06:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R11A", + "name": "Guduvanchery Route", + "from": "Guduvanchery", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "Guduvanchery", + "time": "06:30 AM" + }, + { + "name": "Urapakkam", + "time": "06:35 AM" + }, + { + "name": "Vandalur", + "time": "06:40 AM" + }, + { + "name": "Perungalathur", + "time": "06:45 AM" + }, + { + "name": "Vandalur Bridge", + "time": "06:55 AM" + }, + { + "name": "Mannivakkam", + "time": "07:05 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R12", + "name": "Minjur Route", + "from": "Minjur Bus Stand", + "to": "RIT Campus", + "departureTime": "05:45 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "Minjur Bus Stand", + "time": "05:45 AM" + }, + { + "name": "Minjur Railway Station", + "time": "05:50 AM" + }, + { + "name": "BDO Office", + "time": "05:52 AM" + }, + { + "name": "Nandiyambakkam", + "time": "05:54 AM" + }, + { + "name": "Pattamandiri", + "time": "06:00 AM" + }, + { + "name": "Napalayam", + "time": "06:05 AM" + }, + { + "name": "Manali Pudhu nagar", + "time": "06:08 AM" + }, + { + "name": "Manali Market", + "time": "06:15 AM" + }, + { + "name": "MMDA 3rd Main Road", + "time": "06:18 AM" + }, + { + "name": "Mathur", + "time": "06:22 AM" + }, + { + "name": "Veterinary Hospital", + "time": "06:25 AM" + }, + { + "name": "Madhavaram Milk Colony", + "time": "06:28 AM" + }, + { + "name": "Arul Nagar", + "time": "06:30 AM" + }, + { + "name": "Thapalpetti", + "time": "06:32 AM" + }, + { + "name": "Moolakadai", + "time": "06:38 AM" + }, + { + "name": "Kalpana Lamp", + "time": "06:45 AM" + }, + { + "name": "Madhavaram Roundana", + "time": "06:47 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R13", + "name": "Vyasarpadi Route", + "from": "Ganeshapuram", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Ganeshapuram", + "time": "06:10 AM" + }, + { + "name": "G3 Police Station", + "time": "06:15 AM" + }, + { + "name": "Pattalam", + "time": "06:18 AM" + }, + { + "name": "Otteri", + "time": "06:20 AM" + }, + { + "name": "Podi Kadai", + "time": "06:23 AM" + }, + { + "name": "T.B.Hospital", + "time": "06:25 AM" + }, + { + "name": "Ayanawaram Signal", + "time": "06:27 AM" + }, + { + "name": "Sayyani", + "time": "06:30 AM" + }, + { + "name": "Ayanawaram Noor Hotel", + "time": "06:33 AM" + }, + { + "name": "Joint Office", + "time": "06:35 AM" + }, + { + "name": "Ayanawaram Railway Quarters", + "time": "06:37 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R13A", + "name": "ICF Route", + "from": "ICF Signal", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "ICF Signal", + "time": "06:45 AM" + }, + { + "name": "Villivakkam Bus Stand", + "time": "06:50 AM" + }, + { + "name": "Korattur Signal", + "time": "06:55 AM" + }, + { + "name": "Nolambur Signal", + "time": "07:05 AM" + }, + { + "name": "Vanagaram", + "time": "07:15 AM" + }, + { + "name": "Velappanchavadi", + "time": "07:23 AM" + }, + { + "name": "Poonamallee Bypass", + "time": "07:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R14", + "name": "Thiruvallur Route", + "from": "Sevapetai", + "to": "RIT Campus", + "departureTime": "06:25 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "Sevapetai", + "time": "06:25 AM" + }, + { + "name": "Kakkalur", + "time": "06:30 AM" + }, + { + "name": "Poonga Nagar", + "time": "06:35 AM" + }, + { + "name": "GRT", + "time": "06:50 AM" + }, + { + "name": "Manavalanagar Signal", + "time": "06:55 AM" + }, + { + "name": "Manavalanagar Railway Station", + "time": "06:57 AM" + }, + { + "name": "Putlur", + "time": "07:10 AM" + }, + { + "name": "Aranvoyal", + "time": "07:15 AM" + }, + { + "name": "Puthuchatram (India Jappan Company)", + "time": "07:20 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R14B", + "name": "Kakkalur Route", + "from": "Kakkalur Signal", + "to": "RIT Campus", + "departureTime": "06:55 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kakkalur Signal", + "time": "06:55 AM" + }, + { + "name": "SBI Bank", + "time": "06:58 AM" + }, + { + "name": "Vellavedu", + "time": "07:20 AM" + }, + { + "name": "Thirumazhisai", + "time": "07:25 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R15", + "name": "Cheyyar Route", + "from": "Cheyyar-SBI", + "to": "RIT Campus", + "departureTime": "05:30 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Cheyyar-SBI", + "time": "05:30 AM" + }, + { + "name": "Soundarya Theatre", + "time": "05:31 AM" + }, + { + "name": "Mangal X Road", + "time": "05:55 AM" + }, + { + "name": "Ayyangarkulam", + "time": "06:05 AM" + }, + { + "name": "Punjarasanthangal", + "time": "06:07 AM" + }, + { + "name": "Sevlimedu", + "time": "06:07 AM" + }, + { + "name": "Housing Board", + "time": "06:12 AM" + }, + { + "name": "Collector Office", + "time": "06:18 AM" + }, + { + "name": "Mettu street Signal", + "time": "06:20 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R15A", + "name": "Orikkai Route", + "from": "Orikkai", + "to": "RIT Campus", + "departureTime": "06:15 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Orikkai", + "time": "06:15 AM" + }, + { + "name": "JJ Nagar", + "time": "06:17 AM" + }, + { + "name": "Keerai Mandapam", + "time": "06:20 AM" + }, + { + "name": "Tollgate", + "time": "06:23 AM" + }, + { + "name": "Pachaiyappa's College", + "time": "06:30 AM" + }, + { + "name": "Ayyampettai", + "time": "06:32 AM" + }, + { + "name": "Rajampettai", + "time": "06:40 AM" + }, + { + "name": "Walajabad", + "time": "06:50 AM" + }, + { + "name": "Natha nallur", + "time": "07:00 AM" + }, + { + "name": "Panrutti", + "time": "07:03 AM" + }, + { + "name": "Oragadam", + "time": "07:12 AM" + }, + { + "name": "Arun Excello", + "time": "07:15 AM" + }, + { + "name": "Sriperumbudur High School", + "time": "07:20 AM" + }, + { + "name": "Sriperumbudur Tollgate", + "time": "07:25 AM" + }, + { + "name": "Irungattukottai bus stand", + "time": "07:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R15B", + "name": "Kancheepuram Route", + "from": "Shri Chitragupta Temple", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Shri Chitragupta Temple", + "time": "06:30 AM" + }, + { + "name": "Pookadai Chatram", + "time": "06:35 AM" + }, + { + "name": "Kammala street", + "time": "06:38 AM" + }, + { + "name": "Railway Station", + "time": "06:41 AM" + }, + { + "name": "Ponnerikarai", + "time": "06:46 AM" + }, + { + "name": "Senthamangalam", + "time": "07:01 AM" + }, + { + "name": "Santhavellore", + "time": "07:03 AM" + }, + { + "name": "Sunguvarchatram", + "time": "07:05 AM" + }, + { + "name": "Nokia Gate", + "time": "07:10 AM" + }, + { + "name": "Sathya Grand Resorts", + "time": "07:12 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R16", + "name": "Neelangkarai Route", + "from": "Prathana Theatre", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Prathana Theatre", + "time": "06:10 AM" + }, + { + "name": "Vetuvankeni", + "time": "06:15 AM" + }, + { + "name": "Thiruvanmiyur RTO Office", + "time": "06:20 AM" + }, + { + "name": "Adyar Depot", + "time": "06:29 AM" + }, + { + "name": "Madyakailash", + "time": "06:35 AM" + }, + { + "name": "Guindy", + "time": "06:42 AM" + }, + { + "name": "Mugalivakkam", + "time": "06:55 AM" + }, + { + "name": "Karayanchavadi", + "time": "07:10 AM" + }, + { + "name": "Poonamallee Bus Stand", + "time": "07:15 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R16B", + "name": "Sholinganallur Route", + "from": "Sholinganallur", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "Sholinganallur", + "time": "06:10 AM" + }, + { + "name": "Karapakkam", + "time": "06:16 AM" + }, + { + "name": "Karapakkam - TCS", + "time": "06:19 AM" + }, + { + "name": "PTC (KFC)", + "time": "06:24 AM" + }, + { + "name": "Mettukuppam", + "time": "06:26 AM" + }, + { + "name": "Medavakkam nilgiris", + "time": "06:35 AM" + }, + { + "name": "Santhoshpuram", + "time": "06:37 AM" + }, + { + "name": "Sembakkam", + "time": "06:40 AM" + }, + { + "name": "Tambaram Railway Station", + "time": "06:45 AM" + }, + { + "name": "Krishna nagar bridge", + "time": "06:48 AM" + }, + { + "name": "Kulakarai street", + "time": "06:50 AM" + }, + { + "name": "Padmavathy Kalyana Mandapam", + "time": "06:55 AM" + }, + { + "name": "Joshua School", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R17", + "name": "Valluvarkottam Route", + "from": "Valluvarkottam", + "to": "RIT Campus", + "departureTime": "06:15 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "Valluvarkottam", + "time": "06:15 AM" + }, + { + "name": "Liberty", + "time": "06:20 AM" + }, + { + "name": "Power House", + "time": "06:25 AM" + }, + { + "name": "Lakshman Sruthi", + "time": "06:30 AM" + }, + { + "name": "Thai Sathya", + "time": "06:35 AM" + }, + { + "name": "Virugambakkam", + "time": "06:40 AM" + }, + { + "name": "Alwar Thirunagar", + "time": "06:42 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R17A", + "name": "Valasaravakkam Route", + "from": "Valasaravakkam Shivan Koil", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Valasaravakkam Shivan Koil", + "time": "06:45 AM" + }, + { + "name": "Valasaravakkam", + "time": "06:50 AM" + }, + { + "name": "Saravana Bhavan Hotel", + "time": "06:53 AM" + }, + { + "name": "Lakshmi Nagar", + "time": "06:55 AM" + }, + { + "name": "Porur Bridge", + "time": "07:00 AM" + }, + { + "name": "Iyyappanthangal", + "time": "07:05 AM" + }, + { + "name": "Kattupakkam", + "time": "07:10 AM" + }, + { + "name": "Kumanachavadi", + "time": "07:15 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R18", + "name": "Velachery Route", + "from": "Murugan Kalyana mandapam", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Murugan Kalyana mandapam", + "time": "06:10 AM" + }, + { + "name": "Velachery Bus Stand", + "time": "06:15 AM" + }, + { + "name": "Kaiveli", + "time": "06:18 AM" + }, + { + "name": "Balaji Dental College", + "time": "06:20 AM" + }, + { + "name": "Pallikaranai", + "time": "06:23 AM" + }, + { + "name": "Jeyachandran", + "time": "06:27 AM" + }, + { + "name": "Rajakilpakam Signal", + "time": "06:35 AM" + }, + { + "name": "Camp Road ICICI Bank", + "time": "06:38 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R18A", + "name": "Sembakkam Route", + "from": "Sembakkam", + "to": "RIT Campus", + "departureTime": "06:25 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "Sembakkam", + "time": "06:25 AM" + }, + { + "name": "Poondi Bazaar", + "time": "06:45 AM" + }, + { + "name": "Tambaram Sanatorium", + "time": "06:50 AM" + }, + { + "name": "Chrompet", + "time": "06:55 AM" + }, + { + "name": "Nagalkeni (nayara Petrol Bunk)", + "time": "07:00 AM" + }, + { + "name": "Thiruneermalai", + "time": "07:05 AM" + }, + { + "name": "Thirumudivakkam", + "time": "07:10 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R18B", + "name": "Kelambakkam Route", + "from": "Kelambakkam - GH", + "to": "RIT Campus", + "departureTime": "06:00 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kelambakkam - GH", + "time": "06:00 AM" + }, + { + "name": "Pudupakkam", + "time": "06:10 AM" + }, + { + "name": "Mambakkam (Samathuvapuram)", + "time": "06:15 AM" + }, + { + "name": "Mambakkam Kulam", + "time": "06:20 AM" + }, + { + "name": "Sithalapakkam", + "time": "06:30 AM" + }, + { + "name": "Medavakkam Koot Road", + "time": "06:40 AM" + }, + { + "name": "Kamarajapuram", + "time": "06:43 AM" + }, + { + "name": "Tambaram Airforce signal", + "time": "06:45 AM" + }, + { + "name": "Krishna nagar", + "time": "06:52 AM" + }, + { + "name": "Bharathi nagar", + "time": "06:54 AM" + }, + { + "name": "old Perungalathur", + "time": "06:57 AM" + }, + { + "name": "mathanapuram", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R19", + "name": "Poombukar Route", + "from": "Poombukar", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Poombukar", + "time": "06:10 AM" + }, + { + "name": "Ganga Cinima", + "time": "06:25 AM" + }, + { + "name": "Donbosco", + "time": "06:28 AM" + }, + { + "name": "Poombukar", + "time": "06:30 AM" + }, + { + "name": "Korattur Bus Stop", + "time": "06:55 AM" + }, + { + "name": "Padi Britania", + "time": "06:58 AM" + }, + { + "name": "TVS Show Room", + "time": "07:10 AM" + }, + { + "name": "Ambattur", + "time": "07:12 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R19A", + "name": "Vinayagapuram Route", + "from": "Vinayagapuram Bus Stand", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Vinayagapuram Bus Stand", + "time": "06:45 AM" + }, + { + "name": "Retteri RTO Office", + "time": "06:55 AM" + }, + { + "name": "Retteri", + "time": "06:58 AM" + }, + { + "name": "Senthil Nagar", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R20", + "name": "Vepampattu Route", + "from": "Vepampattu Railway Station", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Vepampattu Railway Station", + "time": "06:30 AM" + }, + { + "name": "Madha Kovil", + "time": "06:32 AM" + }, + { + "name": "Eswar Nagar", + "time": "06:33 AM" + }, + { + "name": "Indian Bank Thiruvninravur", + "time": "06:35 AM" + }, + { + "name": "Thiruninravur Railway Station", + "time": "06:36 AM" + }, + { + "name": "Thiruninravur Bridge", + "time": "06:37 AM" + }, + { + "name": "Jaya College", + "time": "06:39 AM" + }, + { + "name": "Nemilicherri Road", + "time": "06:40 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R20A", + "name": "Pattabiram Route", + "from": "Pattabiram Gandhi Nagar", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Pattabiram Gandhi Nagar", + "time": "06:45 AM" + }, + { + "name": "Pattabiram Vasantha Mandapam", + "time": "06:46 AM" + }, + { + "name": "Sekkadu Bus Stand", + "time": "06:49 AM" + }, + { + "name": "Avadi Ponnu Store", + "time": "06:54 AM" + }, + { + "name": "Avadi J.P.Garden", + "time": "06:56 AM" + }, + { + "name": "Govarthanagiri Bus Stand", + "time": "06:59 AM" + }, + { + "name": "Chennirkuppam", + "time": "07:09 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R21", + "name": "Ayyapakkam Route", + "from": "Ayappakkam Parking", + "to": "RIT Campus", + "departureTime": "06:15 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "Ayappakkam Parking", + "time": "06:15 AM" + }, + { + "name": "Ayappakkam SBI ATM", + "time": "06:17 AM" + }, + { + "name": "Ayappakkam Petrol Bunk", + "time": "06:20 AM" + }, + { + "name": "ICF Church", + "time": "06:22 AM" + }, + { + "name": "Canara Bank", + "time": "06:27 AM" + }, + { + "name": "Singapore Shopping", + "time": "06:32 AM" + }, + { + "name": "Senneerkuppam", + "time": "07:05 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R22", + "name": "Thiruthani Route", + "from": "Thiruthani Bypass", + "to": "RIT Campus", + "departureTime": "05:55 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "Thiruthani Bypass", + "time": "05:55 AM" + }, + { + "name": "Thiruvallur Bypass X Road", + "time": "06:00 AM" + }, + { + "name": "Nagalamman Nagar", + "time": "06:08 AM" + }, + { + "name": "Krishna Poly", + "time": "06:10 AM" + }, + { + "name": "Jothi Nagar", + "time": "06:12 AM" + }, + { + "name": "Indira Gandhi Nagar", + "time": "06:15 AM" + }, + { + "name": "Swalpetaih", + "time": "06:16 AM" + }, + { + "name": "Government Hospital", + "time": "06:17 AM" + }, + { + "name": "Old Bus stand", + "time": "06:18 AM" + }, + { + "name": "Railway Station", + "time": "06:20 AM" + }, + { + "name": "New Bus Stand", + "time": "06:22 AM" + }, + { + "name": "Navy Gate", + "time": "06:30 AM" + }, + { + "name": "Venkatesapuram", + "time": "06:31 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R22A", + "name": "Sholinghur Route", + "from": "Sholinghur", + "to": "RIT Campus", + "departureTime": "05:35 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Sholinghur", + "time": "05:35 AM" + }, + { + "name": "Banavaram koot", + "time": "05:40 AM" + }, + { + "name": "Gudalore", + "time": "05:55 AM" + }, + { + "name": "Salai", + "time": "06:00 AM" + }, + { + "name": "Chitteri", + "time": "06:05 AM" + }, + { + "name": "SR Gate", + "time": "06:25 AM" + }, + { + "name": "Thakkolam Koot Road", + "time": "06:35 AM" + }, + { + "name": "Thakkolam", + "time": "06:40 AM" + }, + { + "name": "Narasimapuram", + "time": "06:55 AM" + }, + { + "name": "Perambakkam", + "time": "07:00 AM" + }, + { + "name": "Koovam Bus Stop", + "time": "07:02 AM" + }, + { + "name": "Valarpuram", + "time": "07:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R23", + "name": "K4 Police Station Route", + "from": "Nathamuni Theatre", + "to": "RIT Campus", + "departureTime": "` 6:35 am", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Nathamuni Theatre", + "time": "` 6:35 am" + }, + { + "name": "K4 Police Station", + "time": "06:40 AM" + }, + { + "name": "Labour officers Quarters", + "time": "06:52 AM" + }, + { + "name": "Vijaya Maruthi (Nuts & Spices)", + "time": "06:44 AM" + }, + { + "name": "Udayam colony", + "time": "06:46 AM" + }, + { + "name": "Kambar Colony", + "time": "06:48 AM" + }, + { + "name": "Anna Nagar West Depot", + "time": "06:50 AM" + }, + { + "name": "Thirumangalam Bridge", + "time": "06:52 AM" + }, + { + "name": "Thirumangalam Waves", + "time": "06:56 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R24", + "name": "Arcot Route", + "from": "Arcot Bus Stand", + "to": "RIT Campus", + "departureTime": "05:25 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "Arcot Bus Stand", + "time": "05:25 AM" + }, + { + "name": "Muthukadai", + "time": "05:30 AM" + }, + { + "name": "VC Motor", + "time": "05:33 AM" + }, + { + "name": "Walajapettai", + "time": "05:35 AM" + }, + { + "name": "Arignar Anna Gov College", + "time": "05:37 AM" + }, + { + "name": "Walajapettai Toll gate", + "time": "05:40 AM" + }, + { + "name": "Kaveripakkam", + "time": "05:45 AM" + }, + { + "name": "Perumpullipakkam", + "time": "06:00 AM" + }, + { + "name": "Vinayagapuram (KPM)", + "time": "06:20 AM" + }, + { + "name": "Olimugamathu Pettai(Gori)", + "time": "06:22 AM" + }, + { + "name": "Egambaranathar Koil", + "time": "06:25 AM" + }, + { + "name": "Kachapeswarar Koil", + "time": "06:28 AM" + }, + { + "name": "Pookadai chatram", + "time": "06:32 AM" + }, + { + "name": "Kammal Street", + "time": "06:35 AM" + }, + { + "name": "Indra Nagar (KPM Railwaygate)", + "time": "06:37 AM" + }, + { + "name": "Ponnerikarai", + "time": "06:40 AM" + }, + { + "name": "Santhavellore", + "time": "07:05 AM" + }, + { + "name": "Sungawarchthram", + "time": "07:10 AM" + }, + { + "name": "Vadamangalam", + "time": "07:20 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R25", + "name": "Kallikuppam Route", + "from": "Kallikuppam", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kallikuppam", + "time": "06:45 AM" + }, + { + "name": "Stedford Hospital", + "time": "06:50 AM" + }, + { + "name": "Saraswathy Nagar Indian oil petrol bunk", + "time": "06:54 AM" + }, + { + "name": "Manigandapuram", + "time": "06:56 AM" + }, + { + "name": "Thirumullaivoyal Junction", + "time": "06:58 AM" + }, + { + "name": "Vaishnavi Nagar", + "time": "07:00 AM" + }, + { + "name": "Murugappa Polytechnic", + "time": "07:02 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R25A", + "name": "Pudur Route", + "from": "Pudur", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Pudur", + "time": "06:45 AM" + }, + { + "name": "Oragadam HP Pump", + "time": "06:47 AM" + }, + { + "name": "PTR Mahal", + "time": "06:50 AM" + }, + { + "name": "Ponnu Supermarket", + "time": "06:53 AM" + }, + { + "name": "Govardhanagari", + "time": "07:15 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R26", + "name": "Andarkuppam Route", + "from": "Andarkuppam", + "to": "RIT Campus", + "departureTime": "06:35 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Andarkuppam", + "time": "06:35 AM" + }, + { + "name": "Kundrathur", + "time": "06:40 AM" + }, + { + "name": "Kundrathur Thandalam", + "time": "06:43 AM" + }, + { + "name": "Kovur", + "time": "06:45 AM" + }, + { + "name": "Gerugambakkam", + "time": "06:50 AM" + }, + { + "name": "Bai Kadai", + "time": "06:53 AM" + }, + { + "name": "Mathanandapuram", + "time": "06:55 AM" + }, + { + "name": "Venkateswara Nagar", + "time": "06:58 AM" + }, + { + "name": "Porur", + "time": "07:05 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R27", + "name": "Avadi Route", + "from": "Ajeya Stadium", + "to": "RIT Campus", + "departureTime": "06:25 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Ajeya Stadium", + "time": "06:25 AM" + }, + { + "name": "HVF", + "time": "06:28 AM" + }, + { + "name": "CRP", + "time": "06:32 AM" + }, + { + "name": "Mitnamalli", + "time": "06:35 AM" + }, + { + "name": "Muthapudupet", + "time": "06:40 AM" + }, + { + "name": "Sasthri Nagar", + "time": "06:45 AM" + }, + { + "name": "Avadi Checkpost", + "time": "06:55 AM" + }, + { + "name": "Rama Rathna Theatre", + "time": "07:06 AM" + }, + { + "name": "Avadi mankoil", + "time": "07:10 AM" + }, + { + "name": "Vasantham Nagar", + "time": "07:12 AM" + }, + { + "name": "Kovarthanagiri", + "time": "07:14 AM" + }, + { + "name": "Kendra vihar", + "time": "07:15 AM" + }, + { + "name": "Kaduveti", + "time": "07:17 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R27A", + "name": "Kollumedu Route", + "from": "Kollumedu", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Kollumedu", + "time": "06:20 AM" + }, + { + "name": "Vel Tech College", + "time": "06:30 AM" + }, + { + "name": "Kovilpathagai", + "time": "06:35 AM" + }, + { + "name": "Ajeya Stadium", + "time": "06:40 AM" + }, + { + "name": "CRPF", + "time": "06:45 AM" + }, + { + "name": "Mittanemili", + "time": "06:50 AM" + }, + { + "name": "Palavedu Service Road", + "time": "07:00 AM" + }, + { + "name": "Nemilichery Tollgate", + "time": "07:05 AM" + }, + { + "name": "Chithukadu Blue", + "time": "07:15 AM" + }, + { + "name": "Panimalar Tollgate", + "time": "07:20 AM" + }, + { + "name": "Chembarambakkam", + "time": "07:27 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R28", + "name": "Agaram Route", + "from": "Agaram", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "Agaram", + "time": "06:20 AM" + }, + { + "name": "Periyar Nagar", + "time": "06:22 AM" + }, + { + "name": "Thiruvalluvar Thirumanamandapam", + "time": "06:24 AM" + }, + { + "name": "Permal Koil", + "time": "06:26 AM" + }, + { + "name": "Kamban Nagar", + "time": "06:28 AM" + }, + { + "name": "E.B", + "time": "06:30 AM" + }, + { + "name": "Shanmugam Mahal", + "time": "06:32 AM" + }, + { + "name": "Senthil Nagar", + "time": "06:35 AM" + }, + { + "name": "Thathankuppam", + "time": "06:38 AM" + }, + { + "name": "Kalyan Jewalrs", + "time": "06:45 AM" + }, + { + "name": "Collector Nagar", + "time": "06:47 AM" + }, + { + "name": "Cheriyan Hospital", + "time": "06:48 AM" + }, + { + "name": "Golden Flats", + "time": "06:50 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R29", + "name": "Medavakkam Koot Road Route", + "from": "Vellakal", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "Vellakal", + "time": "06:20 AM" + }, + { + "name": "Rajakilpakkam Bus Stand", + "time": "06:30 AM" + }, + { + "name": "Kozhi Pannai", + "time": "06:33 AM" + }, + { + "name": "Bharath College", + "time": "06:40 AM" + }, + { + "name": "Camp Road Singal", + "time": "06:45 AM" + }, + { + "name": "Kishkintha Road", + "time": "06:55 AM" + }, + { + "name": "Erumaiyur", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R29A", + "name": "Pammal Route", + "from": "Pammal", + "to": "RIT Campus", + "departureTime": "06:35 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Pammal", + "time": "06:35 AM" + }, + { + "name": "Arunmathi theatre", + "time": "06:37 AM" + }, + { + "name": "Anagaputhur", + "time": "06:39 AM" + }, + { + "name": "Manikandan Nagar", + "time": "06:41 AM" + }, + { + "name": "Karima Nagar", + "time": "06:45 AM" + }, + { + "name": "Kundrathur (theradi)", + "time": "06:48 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R29B", + "name": "Sivanthangal Route", + "from": "Sivanthangal", + "to": "RIT Campus", + "departureTime": "07:05 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Sivanthangal", + "time": "07:05 AM" + }, + { + "name": "Muthukumaran College", + "time": "07:10 AM" + }, + { + "name": "Pattu Koot Road", + "time": "07:13 AM" + }, + { + "name": "Mangadu", + "time": "07:15 AM" + }, + { + "name": "Kankaiyamman Kovil", + "time": "07:20 AM" + }, + { + "name": "MGR Nagar", + "time": "07:23 AM" + }, + { + "name": "Kumananchavadi", + "time": "07:25 AM" + }, + { + "name": "Aravind Hospital", + "time": "07:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + } +] \ No newline at end of file diff --git a/schema.sql b/schema.sql index a0197b2..9bbd096 100644 --- a/schema.sql +++ b/schema.sql @@ -3,7 +3,7 @@ -- 1. Notes & PYQs Module Table CREATE TABLE IF NOT EXISTS notes_pyqs ( - id SERIAL PRIMARY KEY, + id BIGSERIAL PRIMARY KEY, title VARCHAR(255) NOT NULL, subject VARCHAR(250) NOT NULL, department VARCHAR(250) NOT NULL, diff --git a/src/pages/Campus/Campus.tsx b/src/pages/Campus/Campus.tsx index 0113d5b..7e47219 100644 --- a/src/pages/Campus/Campus.tsx +++ b/src/pages/Campus/Campus.tsx @@ -1,12 +1,13 @@ -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import { motion } from 'framer-motion'; -import { Search, ChevronRight, MapPin } from 'lucide-react'; +import { Search, ChevronRight, MapPin, Loader2 } from 'lucide-react'; import SectionTitle from '@/components/SectionTitle/SectionTitle'; import BusCard from '@/components/BusCard/BusCard'; import FacultyCard from '@/components/FacultyCard/FacultyCard'; import { StaggerContainer, StaggerItem } from '@/components/AnimatedContainer/AnimatedContainer'; -import { BUS_ROUTES, FACULTY_DATA, CAMPUS_LOCATIONS, DEPARTMENTS } from '@/constants'; +import { FACULTY_DATA, CAMPUS_LOCATIONS, DEPARTMENTS } from '@/constants'; import * as LucideIcons from 'lucide-react'; +import type { BusRoute } from '@/types'; type Tab = 'map' | 'bus' | 'faculty'; @@ -15,6 +16,27 @@ export default function Campus() { const [searchFaculty, setSearchFaculty] = useState(''); const [selectedDept, setSelectedDept] = useState('All Departments'); const [busSearch, setBusSearch] = useState(''); + const [busRoutes, setBusRoutes] = useState([]); + const [loadingBus, setLoadingBus] = useState(true); + + useEffect(() => { + if (activeTab === 'bus' && busRoutes.length === 0) { + setLoadingBus(true); + fetch('http://localhost:8080/api/bus-routes') + .then((res) => { + if (!res.ok) throw new Error('Failed to fetch'); + return res.json(); + }) + .then((data) => { + setBusRoutes(data); + setLoadingBus(false); + }) + .catch((err) => { + console.error('Error fetching bus routes:', err); + setLoadingBus(false); + }); + } + }, [activeTab, busRoutes.length]); const filteredFaculty = FACULTY_DATA.filter((f) => { const matchSearch = f.name.toLowerCase().includes(searchFaculty.toLowerCase()) || @@ -23,7 +45,7 @@ export default function Campus() { return matchSearch && matchDept; }); - const filteredRoutes = BUS_ROUTES.filter((r) => + const filteredRoutes = busRoutes.filter((r) => r.name.toLowerCase().includes(busSearch.toLowerCase()) || r.from.toLowerCase().includes(busSearch.toLowerCase()) || r.number.toLowerCase().includes(busSearch.toLowerCase()) @@ -179,13 +201,29 @@ export default function Campus() { style={{ fontFamily: 'Inter, sans-serif' }} /> - - {filteredRoutes.map((route) => ( - - - - ))} - + + {loadingBus ? ( +
+ +

+ Loading live bus routes from RIT Transport... +

+
+ ) : filteredRoutes.length === 0 ? ( +
+

+ No bus routes found matching "{busSearch}" +

+
+ ) : ( + + {filteredRoutes.map((route) => ( + + + + ))} + + )} )} diff --git a/src/pages/Community/Community.tsx b/src/pages/Community/Community.tsx index bcfc482..0d712ba 100644 --- a/src/pages/Community/Community.tsx +++ b/src/pages/Community/Community.tsx @@ -1,31 +1,157 @@ -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { MessageCircle, Heart, TrendingUp, ThumbsUp, Send, - Shield, Lock, Smile, ChevronRight, Search, Plus + Shield, Lock, Smile, ChevronRight, Search, Plus, User } from 'lucide-react'; import SectionTitle from '@/components/SectionTitle/SectionTitle'; import { StaggerContainer, StaggerItem } from '@/components/AnimatedContainer/AnimatedContainer'; import AnimatedContainer from '@/components/AnimatedContainer/AnimatedContainer'; import { QUESTIONS_DATA, CONFESSIONS_DATA } from '@/constants'; -import { formatDate } from '@/lib/utils'; type Tab = 'qa' | 'confession'; const TRENDING_TAGS = ['hostel', 'academics', 'clubs', 'campus', 'canteen', 'sports', 'placement', 'library']; +const AVATARS: Record = { + 'Priya S.': 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=120&h=120&q=80', + 'Ravi K.': 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?auto=format&fit=crop&w=120&h=120&q=80', + 'Arun M.': 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&w=120&h=120&q=80', +}; + +const getAvatar = (author: string) => { + return AVATARS[author] || `https://api.dicebear.com/7.x/initials/svg?seed=${encodeURIComponent(author)}`; +}; + +const getRelativeTime = (dateString: string) => { + if (!dateString) return 'just now'; + + // Normalize microsecond timestamps (e.g. 2026-07-22T13:28:18.174367) to standard millisecond precision + let normalized = dateString; + const dotIndex = dateString.indexOf('.'); + if (dotIndex !== -1) { + const mainPart = dateString.substring(0, dotIndex); + let msPart = dateString.substring(dotIndex + 1); + // Strip any trailing non-digits (like timezone offsets Z or +05:30) for truncation, then keep first 3 digits + const nonDigitMatch = msPart.match(/\D/); + let suffix = ''; + if (nonDigitMatch && nonDigitMatch.index !== undefined) { + suffix = msPart.substring(nonDigitMatch.index); + msPart = msPart.substring(0, nonDigitMatch.index); + } + normalized = `${mainPart}.${msPart.substring(0, 3)}${suffix}`; + } + + const now = new Date().getTime(); // Dynamic local time + const past = new Date(normalized).getTime(); + if (isNaN(past)) return 'just now'; + + const msPerMinute = 60 * 1000; + const msPerHour = msPerMinute * 60; + const msPerDay = msPerHour * 24; + const elapsed = now - past; + + if (elapsed < msPerMinute) { + return 'just now'; + } else if (elapsed < msPerHour) { + return Math.round(elapsed / msPerMinute) + 'm ago'; + } else if (elapsed < msPerDay) { + return Math.round(elapsed / msPerHour) + 'h ago'; + } else { + const days = Math.round(elapsed / msPerDay); + return days === 1 ? 'yesterday' : `${days}d ago`; + } +}; + export default function Community() { + const PAGE_SIZE = 5; + const [activeTab, setActiveTab] = useState('qa'); const [confessionText, setConfessionText] = useState(''); const [questionText, setQuestionText] = useState(''); + const [authorName, setAuthorName] = useState(''); const [confessionPosted, setConfessionPosted] = useState(false); const [searchQuery, setSearchQuery] = useState(''); const [likedIds, setLikedIds] = useState>(new Set()); + const [expandedQuestionIds, setExpandedQuestionIds] = useState>(new Set()); + // Server-side pagination + const [currentPage, setCurrentPage] = useState(0); + const [totalPages, setTotalPages] = useState(1); + const [questions, setQuestions] = useState([]); + const [loading, setLoading] = useState(false); + // Fallback static questions for when backend is unavailable + const [staticQuestions] = useState(QUESTIONS_DATA); - const filteredQuestions = QUESTIONS_DATA.filter((q) => - q.title.toLowerCase().includes(searchQuery.toLowerCase()) || - q.tags.some((t) => t.includes(searchQuery.toLowerCase())) - ); + const toggleAnswers = (id: string) => { + setExpandedQuestionIds((prev) => { + const next = new Set(prev); + if (next.has(id.toString())) { + next.delete(id.toString()); + } else { + next.add(id.toString()); + } + return next; + }); + }; + + const fetchQuestions = async (page = 0) => { + setLoading(true); + try { + const response = await fetch(`http://localhost:8080/api/questions/paged?page=${page}&size=${PAGE_SIZE}`); + if (response.ok) { + const data = await response.json(); + // Spring Page response: { content: [], totalPages, totalElements, number } + setQuestions(data.content || []); + setTotalPages(data.totalPages || 1); + setCurrentPage(data.number ?? page); + } else { + console.error("Failed to fetch questions from backend: HTTP status", response.status); + // Fallback: slice static questions + const start = page * PAGE_SIZE; + setQuestions(staticQuestions.slice(start, start + PAGE_SIZE)); + setTotalPages(Math.ceil(staticQuestions.length / PAGE_SIZE)); + setCurrentPage(page); + } + } catch (error) { + console.error('Backend not available. Falling back to local static questions data.', error); + const start = page * PAGE_SIZE; + setQuestions(staticQuestions.slice(start, start + PAGE_SIZE)); + setTotalPages(Math.ceil(staticQuestions.length / PAGE_SIZE)); + setCurrentPage(page); + } finally { + setLoading(false); + } + }; + + useEffect(() => { + fetchQuestions(0); + }, []); + + const getAnswersCount = (q: any) => { + if (Array.isArray(q.answers)) return q.answers.length; + if (typeof q.answers === 'number') return q.answers; + return 0; + }; + + const getVotesCount = (q: any) => { + const votesVal = typeof q.upvotes === 'number' ? q.upvotes : (typeof q.votes === 'number' ? q.votes : 0); + return votesVal; + }; + + // Client-side filter applied on top of current page (for search within page) + const filteredQuestions = questions.filter((q) => { + const titleVal = q.title || ""; + const tagsVal = q.tags || []; + return titleVal.toLowerCase().includes(searchQuery.toLowerCase()) || + tagsVal.some((t: string) => t.toLowerCase().includes(searchQuery.toLowerCase())); + }); + + const handlePageChange = (newPage: number) => { + setExpandedQuestionIds(new Set()); // collapse any open answers + fetchQuestions(newPage); + // Scroll back to the top of the questions list smoothly + document.getElementById('qa-questions-list')?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + }; const handleConfess = () => { if (!confessionText.trim()) return; @@ -34,34 +160,90 @@ export default function Community() { setTimeout(() => setConfessionPosted(false), 3000); }; - const toggleLike = (id: string) => { + const toggleLike = async (id: string) => { setLikedIds((prev) => { const next = new Set(prev); if (next.has(id)) next.delete(id); else next.add(id); return next; }); + + try { + await fetch(`http://localhost:8080/api/questions/${id}/upvote`, { + method: 'POST' + }); + fetchQuestions(); + } catch (error) { + console.log('Backend not available for upvote sync.', error); + } + }; + + const handlePostQuestion = async () => { + if (!questionText.trim()) return; + + const displayAuthor = authorName.trim() || 'Anonymous'; + + const newQuestion = { + title: questionText.split('\n')[0].substring(0, 100) || "Q&A Question", + body: questionText, + author: displayAuthor, + tags: ['fresher', 'general'], + upvotes: 0, + isAnswered: false, + createdAt: new Date().toISOString(), + answers: [] + }; + + try { + const response = await fetch('http://localhost:8080/api/questions', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + title: newQuestion.title, + body: newQuestion.body, + author: newQuestion.author, + tags: newQuestion.tags + }) + }); + + if (response.ok) { + const saved = await response.json(); + setQuestions(prev => { + // Prepend saved question and filter out duplicate placeholders + const filtered = prev.filter(q => q.id.toString() !== saved.id.toString()); + return [saved, ...filtered]; + }); + setQuestionText(''); + setAuthorName(''); + } else { + setQuestions(prev => [{ ...newQuestion, id: String(Date.now()) }, ...prev]); + setQuestionText(''); + setAuthorName(''); + } + } catch (error) { + console.error("Error saving question:", error); + setQuestions(prev => [{ ...newQuestion, id: String(Date.now()) }, ...prev]); + setQuestionText(''); + setAuthorName(''); + } }; return ( -
+
{/* Header */} -
+
-

- RIT{' '} - - Community - +

+ RIT Community

-

+

Ask questions, share confessions, and connect with fellow RIT students.

-
+
{/* Tabs */} -
+
{[ { id: 'qa' as Tab, label: 'Freshers Q&A', icon: MessageCircle }, { id: 'confession' as Tab, label: 'Confessions', icon: Heart }, @@ -69,19 +251,18 @@ export default function Community() { @@ -93,33 +274,42 @@ export default function Community() { {activeTab === 'qa' && (
{/* Ask Question Box */} -
-

Ask a Question

+
+

Ask a Question