Code Monkey home page Code Monkey logo

lgu-timetableapi's Introduction

⚠ No longer maintained ⚠ check out new APIS

+ This repository is still worth checking if you want to scrap data on your own


Lahore Garrison University
Timetable API

Blazingly fast, lightweight and easy to use.

Node 18.7.0

Key FeaturesHow To UseDownloadRoutesTechnologiesUsed ByContributorsLicense

Key Features

  • 📑 Provide data in JSON
  • 🤝 APIs for all the important data like semesters, degrees, sections and timetable
  • ⚡ Fast and easy to use
  • 🔻 ligneweight with avg response size of 633.38 bytes per request

How To Use

To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/IIvexII/LGU-TimetableAPI.git

# Go into the repository
$ cd LGU-TimetableAPI

# Install dependencies
$ npm install

# Run the app
$ npm start

Note If you're using Linux Bash for Windows, see this guide or use node from the command prompt.

Download

You can download the latest installable version of Timetable API for Windows, macOS and Linux.

Routes

Method Route Special Params Description Example
GET /semesters _ return a JSON Object containing semesters. demo
GET /degrees semester all the degree programs in a specific semester. demo
GET /sections semester,degree all the section in a semester with via degree program. demo
GET /timetable semester, degree, section all the degree programs in a specific semester. demo
GET /metadata _ all the metadata about sections, semesters and degrees demo
GET /days _ return all days of week with their id used in official timetable demo
GET /rooms _ return all rooms available in the university demo
GET /freeRooms day, time (both optional) give the rooms that doesn't not have lecture in it demo

Technologies

Technologies used in this project:

Used By

LGU Timetable Front-end - Lightweight timetable frontend on top of this API.

Our Contributors

This repository is maintained by IIvexII

Show some ❤️ by starring this awesome repository!

License

MIT - ✔️ Commercial use ✔️ Modification ✔️ Distribution ✔️ Private use

lgu-timetableapi's People

Contributors

colindaviddick avatar francosauchelli avatar iivexii avatar janitariyaz avatar pragyaasapkota avatar stacylear avatar trantantai1531 avatar vinitvh avatar zain-ul-din avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lgu-timetableapi's Issues

[SECURITY] No limit on user requests

Issue

There is currently no limit on user request that can cause damage to the quality of the system in the future when we will have many users interacting with the API (By users I mean the platforms built on top of this API). An attacker can also DOS or DDOS the system by sending bogus requests to take the server down. Although it is not affecting us now but will do in the near future when the system is more mature.

Documentation has to be written.

Description

This project will be hard to maintain or reuse for the contributors because the documentation is not written. Before we go any further, documentation must be written to save hard work on this project to go in vain.

TODO

[CLEAN CODE] Newly written code is messy

Problem

Due to the lack of time, new features are written with very unorganized and messy code. Before we proceed any further, the code should be refactored as required.

[DOC] Add newly created routes in ReadMe.md

Instructions for Contributors

While I am working on the new features of this project, I need someone who can document the routes, that I recently created, in the ReadMe.md.

Routes

/days, /rooms and /freeRooms

Method

All routes support GET method.

Params

/freeRooms route can have day and time as parameter but both of them are optional. All other routes are parameter less.

Description

/days - return all days of week with their id used in official timetable
/rooms - return all rooms available in the university
/freeRooms - give the rooms that doesn't not have lecture in it

Demo links

Login functionality fails due to reCaptcha

Todo

❌ Make the user solve the reCaptcha
❌ send the solved reCaptcha id with the request to login

Limitations

  • This is just an API which is only one way. so, The front-end would be required for this issue to be resolved.

Improve README.md

Improvements Required

  • Add new design
  • Fix the links and point them towards new links
  • Remove unwanted sections

Fetching semesters, degrees and sections is too messy

Intro

The fetching of data is too messy so, seperating the whole logic of fetching them as models so it become easy to fetch via methods like getById() and getByName().

Checklist

Make models for:

  • Semester
  • Program (Degree)
  • Section

Integration

  • #3
  • resolve every dependency

[NEW FEATURE] Find the classrooms that doesn't have lectures in it

Analysis

This page Room_slots.php on official website provide a list of days with which, we can find schedule of each classroom. This list of days have value that cannot be predicted. We have to scrap this list and then proceed to find the room schedule.

image

Scrapping classroom schedules is simple but the approach I am using in this project is:

  • Scrap less
  • Store data in database

So for the sake of this, first of all I will scrap all the rooms and store it in a separate collection and then scrap the room timetables and link them with rooms.

Todo

No Longer Maintained

Proposal

Since we're providing LGU APIS through from website this repository can be ambiguous for users that's why I propose to add a no longer maintained alert and redirect to our website on the top of the readme.md

Developer Section Link

Save the users from the hustle of having session all the time.

Main Issue
From a user perspective its very hard method to get the timetable set on their calendar or to get the timetable for their app/software because he has to get the session every time he needs to perform a function.

Performance Issue
Performance is the biggest issue of this project.

Solution
I have decided to use mongodb to boost the performance and to solve the session issue. The user can only request when the semester timetable is changed.

TODO

[PERFORMANCE] Improve performance by using Redis cache

Analysis

It is very costly to access the database every time the user require same data because we are running some loops to shape the data that is the requirement of the user.

Solution Suggested

To save time and to reduce work load, we can implement Redis to store processed data for some time.

Provide APIs for Updating collections separately and secure these routes

Problem

Database Populator leads to a time consuming and resource hungry solution for populating database. To acquire data from timetable.edu.pk, it requires 598 requests to be sent. The whole process takes about 3-4 minutes.

Solution

To tackle this problem, we can provide a set of APIs for updating specific data.


TODO

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.