fac-15 / meetTheFACers

Express week 8 project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Meet the FACers

Express Handlebars week 8 project. A basic CV template / skills database for FAC 15. Gives Json a good headstart on his student project!

It's kinda got this way with gifs now...

User stories

  • As a member of FAC, I want to pair with coursemates who are of a similar level, to train on workshops
  • As a member of FAC, I want to help form a strong team with coursemates who have different strengths
  • As a member of FAC, I want to know which coursemates are best equipped to help me with a particular coding problem

Whiteboarding / Planning

setup instructions

  1. clone repo
  2. npm install to install all dependencies
  3. Create a local database with pgcli or psql (see below)
  4. node db/db_build.js to build the database locally, as we haven't made on on Heroku yet. NOTE: Uncomment the line: // dbBuilder(); in db/db_build.js first.
  5. config.envshould look something like this:
DATABASE_URL = postgres://<user_name>:<password>@localhost:5432/<database_name>
  1. npm run dev to run on port 1989. The year that Express Yourself came out. Our original project name.
  2. Runs on staging branch

Creating a local database

  • Connect to postgres, by typing psql or pgcli in the terminal.
  • Create the database by typing CREATE DATABASE <database_name>;.
  • Create a superuser with a password by typing CREATE USER <user_name> WITH SUPERUSER PASSWORD '<password>'; (the password needs to be in quotes, otherwise you get an error).
  • Change ownership of the database to the new user by typing ALTER DATABASE <database_name> OWNER TO <user_name>;

Stuff and Things we did...

DOM bits

SQL bits

  • SELECT LUNCH - Posting info to one table, returning the id to enter into another table Select Lunch
  • can't send headers after they were sent to the client error
  • problem with database connection (on Martin's laptop), had to install pgcli new version. Much frustration.
  • did an INNER JOIN to get all user data from two tables in the database. Joined user_ids to retrieve names.

Other stuff of note

  • Lots of self indulgent CSS
  • Posting data to server through the form
  • Using a handlebars helper function
  • Array.sort() method to sort by skill ascending
  • replicating backend rendering in the frontend (see public/index.js)
  • HackMD with some bits and bobs in

Things we didn't do:

  • Extensive Testing
  • Login, Signup, protected routes (authentication)
  • Database Testing
  • Pick an original name
  • Host on Heroku
  • Check if user exists in database before adding
  • Server side validation
  • Travis CI and the fancy badges

About

Express week 8 project.


Languages

Language:JavaScript 43.1%Language:CSS 32.4%Language:HTML 21.4%Language:PLpgSQL 3.2%