Download Postgresql through Homebrew
$ brew install postgres
Alternatively, if you do not have homebrew installed
Start up postgress
brew services start POSTGRESQL
Create database quizzam_dev
$ psql
CREATE DATABASE quizzam_dev;
Create database quizzam_test
$ psql
CREATE DATABASE quizzam_test;
To manage quizzam_dev and quizzam_test, we reccomend using Postico.
Alternatively, here is a psql cheatsheet.
- Currently, the databases exists without seed data. After the repo is installed in the directions below, we can apply the seed data to the databases we jsut created.
Clone / fork the repo
cd quizzam
npm install
To start the app, we will need to run the build and server in seperate terminal windows.
In build window
npm run build
In server window
npm run server
In browser open up http://localhost:3000/
- Quizzam should be running without any seed data
- You can now follow the Migrating Database instructions below.
Knex is included to create the schema for quizzam_dev and quizzam_text. We have also provided initial seed data, for your use.
knex migrate:latest
knex seed:run
In some cases after using the app and adding dummy data, we might want to reapply the initial seed data. To do this, we rollback the migration and reaaply with the seed data.
knex migrate:rollback
knex migrate:latest
knex seed:run