Try it yourself! (html render quality may vary)
-If you see a security warning, go here instead, domain.com domains don't seem to like Heroku apps (second time this has happened to me)
Mainly inspired by this swedish project, Callifornia is an effort to let get people from far away get an inside look at The Golden State. Since RUHacks is based in Toronto, as a California resident my whole life, I wanted to give y'all a chance to see what's going on over here even though some of you have never been here before. Callifornia is a way to meet new people, do some research, or simply to have some fun and learn about life on the West Coast (#bestcoast).
Go call someone with the site and compliment them, I double dog dare you! (That means you have to do it now)
What it does
Callifornia is a site that allows anyone anywhere in the world to call a randomly chosen open buisness or public entity in the state of California, USA. The phone number and map for the location are determined by picking a random value from a MongoDB Atlas database I constructed specially for and during this hackathon with over 7,000 different entries in it, so odds are you'll never see the same phone number twice. The choice to not display the place names was deliberate, as not to allow people to be biased against calling certain results when they use the site. If you want to see what I did to create this massive database yourself, check out zipprocess.py in the GitHub repo.
The Flask web server that handles all requests makes sure that the random entry is actually open at the time of the request, grabbing another entry if that is not the case, so you can Callifornia all day long.
Callifornia serves a few practical purposes: -Make someone's day better by saying something nice (and I'm sure people could use a little of that right now considering the state of the world as I write this)
-Make some new connections and meet new people!
-It's an easy way to conduct anthropological research or political surveys since the results are randomly generated and all the people who answer are people working in the state of California. My backend is also incredibly modular in the sense that this app could be recoded to call some other state or group of states very easily.
-Makes it really easy to learn new things since you can hear about many people from many walks of life and their experiences.
-It's Omegle except without having to have video (and the many terrible things held within) and without the trolls.
How we built it
Callifornia is deployed on Heroku, and is managed by a Python Flask server that makes requests to the MongoDB Atlas database, which is hosted on GCP, that contains all the phone numbers and associated info and also sends requests the Google Cloud Static Maps API to render the page you make the call from. Then, there is a button that allows you to call the phone number when clicking it if you're on mobile or have calling enabled for your browser, and a plain text version of that number to call otherwise.
The database was generated especially for Callifornia and RUHacks this weekend by first collecting all the zip codes in California from the uszipcodes library and then for each zip code, asking Radar.io's Places API to return all the places near the coordinates of that zipcode. Then, those results are stored in a list and passed through Google Cloud's Place Search API, which finds that place in Google's system and allows us to store a 'Place ID' in the database to help render the calling page with the Google Cloud Place API later. All in all there are 7,905 entries in the database and over 20,000 API calls were needed to fill the database.
Challenges we ran into
-Generating the database ate up all my GCP free trial credits :(
-Plain HTML/CSS is really hard to use and not knowing a fancy web framework like React.js or Bootstrap.js made this a necessity, especially when considering it's hard to control how HTML renders on different devices
-Testing the entries in the database for validity since some entries referred to places in Virginia or Texas for some reason or they didn't have a phone number associated with them (our system only returns businesses that are open as of when you click through and are in the great state of California)
Accomplishments that we're proud of
-Creating a truly massive database for the first time
-Getting more experience with the GCP Dashboard system
-Helping to connect people during the pandemic
What we learned
-We should really stop using HTML for this kind of project and just learn fancy framework already
-Don't leave a script requesting endless API info on overnight
What's next for Callifornia
-Working with anthropologists and survey makers to help make systems more catered specifically to their needs
-Prettier front end