Skip to content

boregan/lowdown

 
 

Repository files navigation

Lowdown

A weekly lowdown of all UCC Society events based on facebook events from the societies.

Requirements

Installation

Git

cd /var/www/html/lowdown

# Clones the git repo into your current directory (must be empty)
git clone https://github.com/UCCNetworkingSociety/lowdown.git .

Composer/Laravel Setup

# Installs dependencies and generates components
composer update

.env file

Place a .env file in the root of your application using the following as a template.

APP_ENV=production
APP_DEBUG=false
APP_KEY={32$9;`GTky*=A"qw&v+-pe,?rGz$+/E
APP_URL=http://localhost

DB_HOST=localhost
DB_DATABASE=lowdown
DB_USERNAME=root
DB_PASSWORD=root

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=database

MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=username
MAIL_PASSWORD=password
MAIL_ENCRYPTION=null
MAIL_KEY=aaaabbbb11111
MAIL_ADDRESS=lowdown@netsoc.co
MAIL_NAME=Lowdown

DEV_EMAIL=netsoc@uccsocieties.ie
SITE_TITLE=Lowdown
BASE_URL=http://lowdown.dev

FB_ID=123456789
FB_SECRET=aaaabbbb11111

BUGSNAG_API_KEY=aaaabbbb11111

Laravel Migration

Before running the following commands, be sure to replace the societies in DatabaseSeeder.php. (Currently working on a .csv solution to this)

# Run database migrations (table creation)
php artisan migrate

# Fetch initial data (the first society events)
php artisan db:seed

# Create queue table
php artisan queue:table

Node, Gulp and LESS

To use the application, we have to compile the less for styling but to do that, we'll need to install some dependencies from node.

cd /var/www/html/lowdown

# Install node dependencies
npm install

# Run gulp (assuming it's installed), it should take care of the rest
gulp

Job Queues

Our application relies on using a job queue to continually fetch and refresh society event information. This job queue is initialised by the command php /var/www/html/lowdown/artisan queue:work if you want to implement your own method for indefinitely running.

Supervisor

To manage the queue process, we're using Supervisor.

# Install on ubuntu
sudo apt-get install supervisor

All of the supervisor processes are stored in /etc/supervisor/etc.d. We'll add the following file lowdown-queue.conf to that directory.

[program:lowdown-queue]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/lowdown.netsoc.co/artisan queue:work
autostart=true
autorestart=true
user=netsoc
numprocs=8
redirect_stderr=true
stdout_logfile=/var/www/html/lowdown.netsoc.co/worker.log

To add and run it, we'll use the below:

# Add our conf to supervisor
sudo supervisorctl reread

# Have supervisor prepare for our processes
sudo supervisorctl update

# Start the worker
sudo supervisorctl start lowdown-queue:*

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 95.6%
  • CSS 2.4%
  • JavaScript 1.8%
  • ApacheConf 0.2%