Skip to content
This repository has been archived by the owner on Feb 15, 2018. It is now read-only.

dailybruin/sources-2016

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sources-Revamp

A redo of the current internal sources website to:

  • Move away from Google Sheets as our data store, and use MySQL instead
  • Add Google OAuthentication for our @media.ucla.edu emails
  • Serve up a snazzy front-end
  • Make the list of sources editable

Installation

Getting the Repo

  1. Find a folder you'd like to hold this code in.
  2. Navigate to it, e.g., cd /Users/user/Code/
  3. Clone this repo: git clone https://github.com/daily-bruin/Sources-Revamp.git

Node.js and NPM

Next, you'll need Node and npm to run a local server instance:

  1. Install Homebrew .
  2. Install Node.js: brew install node
  3. Install npm: brew install npm
  4. Install dependencies with npm install
  5. By default, you can start the server with node ./bin/www. When in doubt, consult the start field in package.json for the right start command.

On Linux, you can also do a native install of NodeJS from this tutorial.

MySQL

For local testing:

  1. You may use any instance of the MySQL server. On Mac, install Homebrew and continue on to step 2. See instructions for Linux and instructions for Windows, and continue to step 3.
  2. Use Homebrew to install MySQL: brew install mysql
  3. Start mysql with mysql.server start or if it's already running: mysql.server restart
  4. Change the password for root
  5. Launch the MySQL REPL as mysql in Bash
  6. Create a new user db with password bruins111: CREATE USER db
  7. Change the password for the new user: update mysql.user set password=PASSWORD('bruins111') where User='db';. (Original tutorial)
  8. Give them privileges to the default test database (comes with a fresh MySQL install): GRANT ALL PRIVILEGES ON test.* TO db@localhost;
  9. Reload all the permissions: flush privileges;
  10. Head over to app.js to set-up the database connection. A more detailed example can be found here

Schema

  1. Inside of the MySQL REPL, switch over to the test database: use test
  2. Create a new table:
CREATE TABLE sources (
    name VARCHAR(60),
    org VARCHAR(500),
    phones VARCHAR(500),
    emails VARCHAR(500),
    notes VARCHAR(1000)
);
  1. And insert a test row:
INSERT INTO sources VALUES (
"Bob Bobsworth", 
"(UCPD: Assistant Cop), (ASUCLA: Architect of Dreams, Chief Ambassador)", 
"(Work: 000-000-0000), (Cell: 512-512-5121, 111-111-1111)", 
"(Work: [email protected]), (Personal: [email protected])", 
"Emotionally unavailable"
);

About

The Daily Bruin's internal repository of sources.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published