Skip to content

Simple quiz web application built with Oak web framework for Deno

Notifications You must be signed in to change notification settings

fravl/drill-and-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project 2: Drill & Practice

Deno JS Postgres Docker

Part of the FiTech Web Software Development class.

Explore a world of knowledge by crafting and exchanging questions across diverse subjects. Challenge yourself with quizzes featuring both your own and community-crafted questions.

The application has the following functionalities:

  • Authentication and authorization
  • Add or delete topics as an admin
  • Add or delete questions and corresponding answer options for topics
  • Quiz yourself on a topic on the web or via the API

Quiz API

  • GET /api/questions/random recieve a random quiz question in format:
    {
      "questionId": 1,
      "questionText": "How much is 1+1?",
      "answerOptions": [
        { "optionId": 1, "optionText": "2" },
        { "optionId": 2, "optionText": "4" },
        { "optionId": 3, "optionText": "6" },
      ]
    }
  • POST /api/questions/answer check your answer by sending a JSON in format:
    {
      "questionId": 1,
      "optionId": 3,
    }

View online

To test the application online visit https://wsd-project-2.fly.dev/

For testing admin functionality, use the login email admin@admin.com with password 123456

Run locally

Running the application requires a Docker and Docker Compose installation on your machine.

To start the application and a Postgresql database, run the following command

docker-compose up

and access the application at http://localhost:7777

E2E Testing

The Playwright E2E tests can be executed by running the following command from the root directory:

docker-compose run --entrypoint=npx e2e-playwright playwright test && docker-compose rm -sf

In case of any errors such as Flyway migrations not completing, run docker-compose down and try again.

Note that the database is not setup and torn for individual test runs and test database entries remain after the tests.

About

Simple quiz web application built with Oak web framework for Deno

Topics

Resources

Stars

Watchers

Forks