Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.
/ ucfparking Public archive

Park at UCF's main campus without the hassle! This project includes a site, an API, a web scraper, and a machine-learning algorithm to predict capacities so anyone can plan their route with ease.

License

Notifications You must be signed in to change notification settings

jakeva/ucfparking

Repository files navigation

UCF Parking

This project makes it easy to view parking garage space availability on the University of Central Florida's main campus. This project contains a web scraper and REST API written in Python and a website written in Next.js with Tailwind CSS. This project aims to relieve the stress of finding a parking spot on campus and assist students with creating a plan before arriving on site.

Features

  • 🚀 Hourly parking data scraped since March 21st, 2021!
  • 🖥️ Public API with access to a bunch of methods. Learn more!
  • 📦 Out of the box included dashboard with various customizable sorting and viewing options.
  • 📱 Mobile support.
  • 🔥 Linting support with pre-commit hooks.

API Routes

Please note that these routes are for ucfparking.com. Please note that each of these routes returns a page of JSON. The timezone in this project is UTC. Queries with an asterik (*) next to the description may take a bit of time depending on the amount of data in the database.

Get the last row of data entered in the database.

/

* Get all of the data in the database.

/all

Get the combined data from the current day.

/today

Get the combined data from the past 24 hours.

/lastday

Get the combined data from the past 7 days.

/week

Get the combined data from the past 30 days.

/lastmonth

* Get the combined data from the past 365 days.

/lastyear

* Get access to the specified year's data.

/:year:

Get access to the specified year-month's data.

/:year:/:month:

Get access to the specified year-month-day's data.

/:year:/:month:/:day:

Get statistics about the data.

/stats

* Get garage space availability predictions for the next 24 hours.

/predict_next_day

Local Installation

Before running, there are a few environment variables to setup in this project, used for security reasons:

  • DB_HOST - your database's host address
  • DB_USER - your database's user name
  • DB_PASS - your database's user password
  • DB_NAME - your database's name
  • DB_PORT - your database's port . . . usually 3306!
  • SENTRY_URL - very helpful debugging tool

With this current project setup, a MySQL database is required to store the data. We use a plan provided by ClearDB MySQL on Heroku.

Dependencies need to be installed on your environment by running:

  pip install -r requirements.txt

Once you've set that all up, you can begin to start scraping data and setup your own API!

To run the web scraping script, run the following command inside the project:

  python api/deploy/main.py

To run the API locally, run the following command inside the project:

uvicorn api.api:app --reload --port 5000

Then open localhost to see your application running.

Deployment

The API, data scraper, and database currently run on a dyno on Heroku. The Next.js site is deployed on Vercel.

This project uses Advanced Python Scheduler to run the data scrapper every sharp hour (:00).

The Heroku add-on's that are used include: ClearDB MySQL and New Relic's APM.

To get the API to work, take a look at the Procfile and how we use Uvicorn to run it.

About

Park at UCF's main campus without the hassle! This project includes a site, an API, a web scraper, and a machine-learning algorithm to predict capacities so anyone can plan their route with ease.

Topics

Resources

License

Stars

Watchers

Forks