Git Product home page Git Product logo

schema-stumper's Introduction

schema-stumper

A simple quiz game that loads a database schema and sees if you can name all the fields for the tables.

This project was bootstrapped with Create React App. Some of the Create React App things like tests are not fully implemented at this time.

How does it work?

It works by scanning a Postgres database for all of the tables and columns, caches this schema and starts a static web app quiz game based on this schema.

You configure the app via environment variables to point at a Postgres database.

When the app starts up it will try to connect to the DB and generate a static file to power the quiz game.

How to run it

You run the app by specifying some environment variables to connect to a Postgres database. The environment variables are:

  • DATABASE_HOST the address of the database. Defaults to 0.0.0.0
  • DATABASE_PORT the port for the database. Defaults to 5432
  • DATABASE_NAME the name of the database to connect to. Must be specified.
  • DATABASE_USER the user account to connect with. Defaults to postgres.
  • DATABASE_PASSWORD the password to connect with. Must be specified.

So to run the game simply run npm start preceded by any environment variables that aren't already set in your shell.

e.g.: (this assumes the other required ENV variables are set...)

DATABASE_NAME=billing npm start

How to play

Running npm start (see above) with the proper DB connection info specified should open a browser pointed at localhost:3000.

Table List Screen

The first screen lists all of the tables from the database you configured.

For each table you'll either see a completion percentage or your best time (scores are stored to the browser's localStorage).

Clicking on a table name will take you to the Table Quiz Screen.

Table Quiz Screen

Here's where you can test your table knowledge! The quiz is to see if you know all the column names.

When you click START begin typing in the names of the columns and hit enter to submit them. Case matters! If the column exists you'll see it appear. If it doesn't exist, you'll see a red X. There are no penalties for wrong guesses, it's just feedback.

When you guess all the column names or run out of time, the quiz screen will close and you'll be taken back to the list screen to view your score (it's a little abrupt as currently implemented, but you'll get the idea).

Good Luck and have fun!

schema-stumper's People

Contributors

rgbz avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.