This project includes two parts:
- berlin-event: Updating event information from three websites: Deutsche Oper Berlin, GORKI and Berghain Berlin. This part is programmed with python and docker.
- berlin-event-app: Web application built on Ruby on Rails for visitors to filter events based on three criteria: web source, date and event title.
Following are the process of deployment:
- Change the directory to berlin-event-app, run
rails db:migrate
, this will initialize the database, create a new schema called myapp_development in the localhost server and a table called events. - Run the following SQL Script to make sure the default behavior of the column created_at and updated_at remains the same in the update process.
ALTER TABLE `myapp_development`.`events`
CHANGE COLUMN `created_at` `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CHANGE COLUMN `updated_at` `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ;
-
Since the first part of this project is dockerized, Docker needs to be installed to run this project.
-
Change the directory to berlin-event, run
make exec
. After it enters the bash terminal of this docker container, run python main.py
. This will update event information from three websites sequentially.This implementation uses some useful libraries:
- Beautiful Soup and Selenium are used for scraping and parsing the html information from different websites.
- PyMySQL and SQLAlchemy are used for communicating with database, adding and updating event information.
-
Last but not least, change the directory to berlin-event-app again, run
rails server
. Navigate the browser to http://localhost:3000/, you will see message like thisHello, Berliners!
Here are some Berlin events you might be interested!Click on Berlin events and start to search the events, and here are some examples of the application.