A website to easily find societies and events in trinity
Scrapes events for each society from facebook every 24hours Makes it easy to keep up with events from societies you are interested in
visit /api for more information
Note that you must have NodeJS and a MySQL 5.7 server installed. You will also need an api key from "https://www.scraperapi.com/"
- First, you need to initialise a database called "TrEvents":
CREATE DATABASE TrEvents;
- Create a user with which to access the events (using
sudo mysql -u root
or otherwie). replace "newuser" and "password" with your own values:
i) CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
ii) GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
iii)FLUSH PRIVILEGES;
- Add the newuser & password to config/mysql-credentials.json.
- Add your "https://www.scraperapi.com/" api key(s) to config/scraperApiKeys.js
- Run
npm install
from the "trinity-events" directry. - Run
node ./initial-setup/setup.js
to set up the tables in MySQL. This may take a while as the societies need to be scraped one at a time. You could also edit the script to use societies from your own database. - Run
npm run build
to compile the react page. - Run
node server.js
to start the server. This could be added to systemd to be run always run, or run with "forever" or "nodemon" to suit your needs