Here is a demo of it during the week (I used a fake time to simulate midday on a wednesday)
This website is responsive!
I live on campus, but, I often work late in my dorm room and never know what's actually open. I would go to the Campus Center just to find that Forte Pizzeria is closed or that it is too late to head to GDS for a chicken fajita. Eventually, half a semester of this constant feeling of doubt led me to think up an idea of having a "status page" for NJIT restaurants on (and off coming soon) campus.
What it does
NJITFood does exactly what it says on the tin, it is a web application that shows what food is currently available at NJIT. It was designed to be simple to navigate, being only a single page, and to not require an external API so that it could hypothetically work offline and in areas of limited connectivity around campus (like in Cypress elevators).
How I built it
The site itself is a static webpage, hosted on GitHub pages, which makes an AJAX call to a static JSON file in the same repository. The reason for this is so that the JSON file will be cached, but so that the site's inner HTML content itself can be dynamically generated clientside.
I started by making the JSON file, which was just a listing of every restaurant and all of the hours that the particular restaurant is open. I decided to make this file manually rather than use Google Places or similar API's so that I can account for the hours that GDS is open but not serving hot food, for example. This also means that the site itself doesn't depend on external API's staying alive, and all of the data is in a Git repo, so it is crowd-sourced.
and keyword in Python is a
&& in most other languages, and, forgetting this caused me an extra half hour of debugging!
Once the parser was written and working (it returns an array of generic objects that have the appropriate keys and values), I just had to append those entries to a table and render it. I wrote the front-end using Bootstrap 4, using Bootswatch's Materia (formerly known as Paper) theme, with custom CSS on top of it to stylize it for NJIT. The navigation bar uses NJIT Red, as does the custom favicon, which is a cross between a heart and a cookie.
Challenges I ran into
Accomplishments that I'm proud of
What I learned
What's next for NJITFood
My stretch goal, so to speak, is adding off-campus restaurants and food trucks, as well as finding people to maintain this project after I graduate (which is still nearly four years away, so, I have some time!). I have a list of restaurants ready to add, I just did not have the time to verify the opening and closing times for each of them today, so I decided to just use the on-campus restaurants for now.
Additionally, I would love to use the Python version of the parser to make an accessible API for use in other applications. I currently have it running with Flask, a Python web framework, but it is not publicly accessible at this time.