Link to the live app: https://poc-convo-quiz.vercel.app/
This app allows users to take english listening comprehension quizzes. The first screen the user sees is the title page with instructions on how to use the app and a list of the apps. From this page the user can click on one of the quizzes to go to a quiz. Once the quiz is started each question plays an audio or video and presents fill in the blank sentences for the student to fill out. At the end of the quiz the student sees how many questions they got wrong or right. Administrators can create new quizzes, and edit quizzes and questions.
HTML5, CSS3, React, JavaScript, Node.js, Express.
link to live api: https://still-garden-93095.herokuapp.com/
Migrations: https://www.npmjs.com/package/postgrator-cli
Settings in ./postgrator.js
require('dotenv').config();
module.exports = {
PORT: process.env.PORT || 8000,
NODE_ENV: process.env.NODE_ENV || 'development',
DATABASE_URL: process.env.DATABASE_URL || 'postgresql://postgres@localhost/quiz',
TEST_DATABASE_URL: process.env.TEST_DATABASE_URL || 'postgresql://postgres@localhost/quiz-test'
}
migrate
Using postgrator behind scenes to read .sql
files in ./migrations
dir.
npm run migrate
to migrate to latest schemanpm run migrate -- 1
to migrate to step 1 of schemanpm run migrate -- 0
to completely rollback schema
seed
Use the files inside ./seeds
dir
e.g. to seed the database named quiz
:
psql -U $DB_USER -d $DB_NAME -f ./seeds/seed.quiz_questions.sql
psql -U postgres -d quiz -f ./seeds/seed.quiz_questions.sql
psql -U postgres -d quiz -f ./seeds/seed.quizzes.sql
-
GET /api/quiz
- get all quizzes
-
POST /api/quiz
- create a quiz
-
GET /api/quiz/:quizId
- get a specific quiz
-
PATCH /api/quiz/:quizId
- update a specific quiz
-
DELETE /api/quiz/:quizId
- delete a specific quiz
-
GET /api/questions
- get all questions
-
POST /api/questions
- create a question
-
GET /api/quiz/:quizNum/questions
- get all questions from a specific quiz
-
GET /api/questions/:id
- get a specific question
-
PATCH /api/questions/:id
- update a specific question
-
DELETE /api/questions/:id
- delete a specific question
GET /
- Express Welcome to Express
for running the app:
DATABASE_URL
is being used by ./src/server.js
to initialize knex.
The expected format is:
"postgresql://$DB_USER:$DB_PASS@$DB_HOST:$DB_PORT/$DB_NAME"
You should only need DATABASE_URL
to start the application.
There are default values set in ./src/config.js
but they probably won't work for you. You should set your own values for it in your .env
.