Skip to content

Web application built with Node.js, Express, JavaScript, and EJS (Embedded JavaScript) that serves as a quiz game for identifying flags stored in a PostgreSQL database. ๐Ÿ’ป๐Ÿ—‚

Notifications You must be signed in to change notification settings

shanibider/PostgreSQL-Flag-Quiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—บ PostgreSQL Flag Quiz Website

Check out the website here!

This is a web application that serves as a quiz game for identifying flags stored in a PostgreSQL database. Built with -

Node.js, Express, JavaScript, and EJS (Embedded JavaScript)

Note

Windows does not display flag images for emoji. Instead, Windows will show you the country code which looks this: "๐Ÿ‡ฆ๐Ÿ‡ซ" :

So as a Windows user, the easiest way to see the flags is simply to use the Mozilla Firefox browser (instead of Chrome). Firefox displays flags just fine!

Table of Contents

Tech stack๐Ÿ’ป

My Skills

  • Node.js: JavaScript runtime environment for executing JavaScript code server-side.
  • Express.js: A web application framework for Node.js used for building web applications and APIs.
  • EJS (Embedded JavaScript): Templating engine for generating HTML markup with plain JavaScript.
  • PostgreSQL: Open-source relational database system for storing flag data.
  • Body-parser: Middleware for parsing incoming request bodies in Express.
  • pg (node-postgres): A PostgreSQL client for Node.js used to interact with the PostgreSQL database.
  • dotenv: A zero-dependency module that loads environment variables from a .env file into process.env.

Features๐Ÿš€

  • Users can play a quiz game where they are presented with random flags and must input the corresponding country name.
  • The application keeps track of the total score, displaying it to the user after each guess.
  • Utilizes PostgreSQL as the database backend to store flag data.

Screenshots๐Ÿ–ผ๏ธ

22

Dependencies๐Ÿงฑ

  • Express.js: A web application framework for Node.js used for building web applications and APIs.
  • Body-parser: Middleware for parsing incoming request bodies in Express.
  • pg (node-postgres): A PostgreSQL client for Node.js used to interact with the PostgreSQL database.
  • dotenv: A zero-dependency module that loads environment variables from a .env file into process.env.

Getting Started๐ŸŽฏ

  1. Clone this repository to your local machine.

  2. Install dependencies using npm install.

  3. Set up a PostgreSQL database and populate it with flag data.

  4. Create a .env file in the root directory and add your database credentials:

    DB_USER=your_username
    DB_HOST=your_host
    DB_DATABASE=your_database
    DB_PASSWORD=your_password
    DB_PORT=your_port
    
    
  5. Run the application using npm start.

  6. Access the application in your web browser at http://localhost:3000 .

Database Schema

The database should contain a table named flags with columns representing flag data, such as name, image_url, etc.

Usage๐Ÿ“

  • Visit the homepage (/) to start the quiz game.
  • Input the corresponding country name for the presented flag and submit your answer.
  • The application will indicate whether your answer is correct and display the total score.
  • Continue playing to test your knowledge of flags!

flags๐Ÿ“”

emoji_flags

Cheat Sheet for Country Emojis๐Ÿ“”

ico shortcode ico shortcode
top ๐Ÿ‡ฆ๐Ÿ‡จ :ascension_island: ๐Ÿ‡ฆ๐Ÿ‡ฉ :andorra: top
top ๐Ÿ‡ฆ๐Ÿ‡ช :united_arab_emirates: ๐Ÿ‡ฆ๐Ÿ‡ซ :afghanistan: top
top ๐Ÿ‡ฆ๐Ÿ‡ฌ :antigua_barbuda: ๐Ÿ‡ฆ๐Ÿ‡ฎ :anguilla: top
top ๐Ÿ‡ฆ๐Ÿ‡ฑ :albania: ๐Ÿ‡ฆ๐Ÿ‡ฒ :armenia: top
top ๐Ÿ‡ฆ๐Ÿ‡ด :angola: ๐Ÿ‡ฆ๐Ÿ‡ถ :antarctica: top
top ๐Ÿ‡ฆ๐Ÿ‡ท :argentina: ๐Ÿ‡ฆ๐Ÿ‡ธ :american_samoa: top
top ๐Ÿ‡ฆ๐Ÿ‡น :austria: ๐Ÿ‡ฆ๐Ÿ‡บ :australia: top
top ๐Ÿ‡ฆ๐Ÿ‡ผ :aruba: ๐Ÿ‡ฆ๐Ÿ‡ฝ :aland_islands: top
top ๐Ÿ‡ฆ๐Ÿ‡ฟ :azerbaijan: ๐Ÿ‡ง๐Ÿ‡ฆ :bosnia_herzegovina: top
top ๐Ÿ‡ง๐Ÿ‡ง :barbados: ๐Ÿ‡ง๐Ÿ‡ฉ :bangladesh: top
top ๐Ÿ‡ง๐Ÿ‡ช :belgium: ๐Ÿ‡ง๐Ÿ‡ซ :burkina_faso: top
top ๐Ÿ‡ง๐Ÿ‡ฌ :bulgaria: ๐Ÿ‡ง๐Ÿ‡ญ :bahrain: top
top ๐Ÿ‡ง๐Ÿ‡ฎ :burundi: ๐Ÿ‡ง๐Ÿ‡ฏ :benin: top
top ๐Ÿ‡ง๐Ÿ‡ฑ :st_barthelemy: ๐Ÿ‡ง๐Ÿ‡ฒ :bermuda: top
top ๐Ÿ‡ง๐Ÿ‡ณ :brunei: ๐Ÿ‡ง๐Ÿ‡ด :bolivia: top
top ๐Ÿ‡ง๐Ÿ‡ถ :caribbean_netherlands: ๐Ÿ‡ง๐Ÿ‡ท :brazil: top
top ๐Ÿ‡ง๐Ÿ‡ธ :bahamas: ๐Ÿ‡ง๐Ÿ‡น :bhutan: top
top ๐Ÿ‡ง๐Ÿ‡ป :bouvet_island: ๐Ÿ‡ง๐Ÿ‡ผ :botswana: top
top ๐Ÿ‡ง๐Ÿ‡พ :belarus: ๐Ÿ‡ง๐Ÿ‡ฟ :belize: top
top ๐Ÿ‡จ๐Ÿ‡ฆ :canada: ๐Ÿ‡จ๐Ÿ‡จ :cocos_islands: top
top ๐Ÿ‡จ๐Ÿ‡ฉ :congo_kinshasa: ๐Ÿ‡จ๐Ÿ‡ซ :central_african_republic: top
top ๐Ÿ‡จ๐Ÿ‡ฌ :congo_brazzaville: ๐Ÿ‡จ๐Ÿ‡ญ :switzerland: top
top ๐Ÿ‡จ๐Ÿ‡ฎ :cote_divoire: ๐Ÿ‡จ๐Ÿ‡ฐ :cook_islands: top
top ๐Ÿ‡จ๐Ÿ‡ฑ :chile: ๐Ÿ‡จ๐Ÿ‡ฒ :cameroon: top
top ๐Ÿ‡จ๐Ÿ‡ณ :cn: ๐Ÿ‡จ๐Ÿ‡ด :colombia: top
top ๐Ÿ‡จ๐Ÿ‡ต :clipperton_island: ๐Ÿ‡จ๐Ÿ‡ท :costa_rica: top
top ๐Ÿ‡จ๐Ÿ‡บ :cuba: ๐Ÿ‡จ๐Ÿ‡ป :cape_verde: top
top ๐Ÿ‡จ๐Ÿ‡ผ :curacao: ๐Ÿ‡จ๐Ÿ‡ฝ :christmas_island: top
top ๐Ÿ‡จ๐Ÿ‡พ :cyprus: ๐Ÿ‡จ๐Ÿ‡ฟ :czech_republic: top
top ๐Ÿ‡ฉ๐Ÿ‡ช :de: ๐Ÿ‡ฉ๐Ÿ‡ฌ :diego_garcia: top
top ๐Ÿ‡ฉ๐Ÿ‡ฏ :djibouti: ๐Ÿ‡ฉ๐Ÿ‡ฐ :denmark: top
top ๐Ÿ‡ฉ๐Ÿ‡ฒ :dominica: ๐Ÿ‡ฉ๐Ÿ‡ด :dominican_republic: top
top ๐Ÿ‡ฉ๐Ÿ‡ฟ :algeria: ๐Ÿ‡ช๐Ÿ‡ฆ :ceuta_melilla: top
top ๐Ÿ‡ช๐Ÿ‡จ :ecuador: ๐Ÿ‡ช๐Ÿ‡ช :estonia: top
top ๐Ÿ‡ช๐Ÿ‡ฌ :egypt: ๐Ÿ‡ช๐Ÿ‡ญ :western_sahara: top
top ๐Ÿ‡ช๐Ÿ‡ท :eritrea: ๐Ÿ‡ช๐Ÿ‡ธ :es: top
top ๐Ÿ‡ช๐Ÿ‡น :ethiopia: ๐Ÿ‡ช๐Ÿ‡บ :eu:
:european_union:
top
top ๐Ÿ‡ซ๐Ÿ‡ฎ :finland: ๐Ÿ‡ซ๐Ÿ‡ฏ :fiji: top
top ๐Ÿ‡ซ๐Ÿ‡ฐ :falkland_islands: ๐Ÿ‡ซ๐Ÿ‡ฒ :micronesia: top
top ๐Ÿ‡ซ๐Ÿ‡ด :faroe_islands: ๐Ÿ‡ซ๐Ÿ‡ท :fr: top
top ๐Ÿ‡ฌ๐Ÿ‡ฆ :gabon: ๐Ÿ‡ฌ๐Ÿ‡ง :gb:
:uk:
top
top ๐Ÿ‡ฌ๐Ÿ‡ฉ :grenada: ๐Ÿ‡ฌ๐Ÿ‡ช :georgia: top
top ๐Ÿ‡ฌ๐Ÿ‡ซ :french_guiana: ๐Ÿ‡ฌ๐Ÿ‡ฌ :guernsey: top
top ๐Ÿ‡ฌ๐Ÿ‡ญ :ghana: ๐Ÿ‡ฌ๐Ÿ‡ฎ :gibraltar: top
top ๐Ÿ‡ฌ๐Ÿ‡ฑ :greenland: ๐Ÿ‡ฌ๐Ÿ‡ฒ :gambia: top
top ๐Ÿ‡ฌ๐Ÿ‡ณ :guinea: ๐Ÿ‡ฌ๐Ÿ‡ต :guadeloupe: top
top ๐Ÿ‡ฌ๐Ÿ‡ถ :equatorial_guinea: ๐Ÿ‡ฌ๐Ÿ‡ท :greece: top
top ๐Ÿ‡ฌ๐Ÿ‡ธ :south_georgia_south_sandwich_islands: ๐Ÿ‡ฌ๐Ÿ‡น :guatemala: top
top ๐Ÿ‡ฌ๐Ÿ‡บ :guam: ๐Ÿ‡ฌ๐Ÿ‡ผ :guinea_bissau: top
top ๐Ÿ‡ฌ๐Ÿ‡พ :guyana: ๐Ÿ‡ญ๐Ÿ‡ฐ :hong_kong: top
top ๐Ÿ‡ญ๐Ÿ‡ฒ :heard_mcdonald_islands: ๐Ÿ‡ญ๐Ÿ‡ณ :honduras: top
top ๐Ÿ‡ญ๐Ÿ‡ท :croatia: ๐Ÿ‡ญ๐Ÿ‡น :haiti: top
top ๐Ÿ‡ญ๐Ÿ‡บ :hungary: ๐Ÿ‡ฎ๐Ÿ‡จ :canary_islands: top
top ๐Ÿ‡ฎ๐Ÿ‡ฉ :indonesia: ๐Ÿ‡ฎ๐Ÿ‡ช :ireland: top
top ๐Ÿ‡ฎ๐Ÿ‡ฑ :israel: ๐Ÿ‡ฎ๐Ÿ‡ฒ :isle_of_man: top
top ๐Ÿ‡ฎ๐Ÿ‡ณ :india: ๐Ÿ‡ฎ๐Ÿ‡ด :british_indian_ocean_territory: top
top ๐Ÿ‡ฎ๐Ÿ‡ถ :iraq: ๐Ÿ‡ฎ๐Ÿ‡ท :iran: top
top ๐Ÿ‡ฎ๐Ÿ‡ธ :iceland: ๐Ÿ‡ฎ๐Ÿ‡น :it: top
top ๐Ÿ‡ฏ๐Ÿ‡ช :jersey: ๐Ÿ‡ฏ๐Ÿ‡ฒ :jamaica: top
top ๐Ÿ‡ฏ๐Ÿ‡ด :jordan: ๐Ÿ‡ฏ๐Ÿ‡ต :jp: top
top ๐Ÿ‡ฐ๐Ÿ‡ช :kenya: ๐Ÿ‡ฐ๐Ÿ‡ฌ :kyrgyzstan: top
top ๐Ÿ‡ฐ๐Ÿ‡ญ :cambodia: ๐Ÿ‡ฐ๐Ÿ‡ฎ :kiribati: top
top ๐Ÿ‡ฐ๐Ÿ‡ฒ :comoros: ๐Ÿ‡ฐ๐Ÿ‡ณ :st_kitts_nevis: top
top ๐Ÿ‡ฐ๐Ÿ‡ต :north_korea: ๐Ÿ‡ฐ๐Ÿ‡ท :kr: top
top ๐Ÿ‡ฐ๐Ÿ‡ผ :kuwait: ๐Ÿ‡ฐ๐Ÿ‡พ :cayman_islands: top
top ๐Ÿ‡ฐ๐Ÿ‡ฟ :kazakhstan: ๐Ÿ‡ฑ๐Ÿ‡ฆ :laos: top
top ๐Ÿ‡ฑ๐Ÿ‡ง :lebanon: ๐Ÿ‡ฑ๐Ÿ‡จ :st_lucia: top
top ๐Ÿ‡ฑ๐Ÿ‡ฎ :liechtenstein: ๐Ÿ‡ฑ๐Ÿ‡ฐ :sri_lanka: top
top ๐Ÿ‡ฑ๐Ÿ‡ท :liberia: ๐Ÿ‡ฑ๐Ÿ‡ธ :lesotho: top
top ๐Ÿ‡ฑ๐Ÿ‡น :lithuania: ๐Ÿ‡ฑ๐Ÿ‡บ :luxembourg: top
top ๐Ÿ‡ฑ๐Ÿ‡ป :latvia: ๐Ÿ‡ฑ๐Ÿ‡พ :libya: top
top ๐Ÿ‡ฒ๐Ÿ‡ฆ :morocco: ๐Ÿ‡ฒ๐Ÿ‡จ :monaco: top
top ๐Ÿ‡ฒ๐Ÿ‡ฉ :moldova: ๐Ÿ‡ฒ๐Ÿ‡ช :montenegro: top
top ๐Ÿ‡ฒ๐Ÿ‡ซ :st_martin: ๐Ÿ‡ฒ๐Ÿ‡ฌ :madagascar: top
top ๐Ÿ‡ฒ๐Ÿ‡ญ :marshall_islands: ๐Ÿ‡ฒ๐Ÿ‡ฐ :macedonia: top
top ๐Ÿ‡ฒ๐Ÿ‡ฑ :mali: ๐Ÿ‡ฒ๐Ÿ‡ฒ :myanmar: top
top ๐Ÿ‡ฒ๐Ÿ‡ณ :mongolia: ๐Ÿ‡ฒ๐Ÿ‡ด :macau: top
top ๐Ÿ‡ฒ๐Ÿ‡ต :northern_mariana_islands: ๐Ÿ‡ฒ๐Ÿ‡ถ :martinique: top
top ๐Ÿ‡ฒ๐Ÿ‡ท :mauritania: ๐Ÿ‡ฒ๐Ÿ‡ธ :montserrat: top
top ๐Ÿ‡ฒ๐Ÿ‡น :malta: ๐Ÿ‡ฒ๐Ÿ‡บ :mauritius: top
top ๐Ÿ‡ฒ๐Ÿ‡ป :maldives: ๐Ÿ‡ฒ๐Ÿ‡ผ :malawi: top
top ๐Ÿ‡ฒ๐Ÿ‡ฝ :mexico: ๐Ÿ‡ฒ๐Ÿ‡พ :malaysia: top
top ๐Ÿ‡ฒ๐Ÿ‡ฟ :mozambique: ๐Ÿ‡ณ๐Ÿ‡ฆ :namibia: top
top ๐Ÿ‡ณ๐Ÿ‡จ :new_caledonia: ๐Ÿ‡ณ๐Ÿ‡ช :niger: top
top ๐Ÿ‡ณ๐Ÿ‡ซ :norfolk_island: ๐Ÿ‡ณ๐Ÿ‡ฌ :nigeria: top
top ๐Ÿ‡ณ๐Ÿ‡ฎ :nicaragua: ๐Ÿ‡ณ๐Ÿ‡ฑ :netherlands: top
top ๐Ÿ‡ณ๐Ÿ‡ด :norway: ๐Ÿ‡ณ๐Ÿ‡ต :nepal: top
top ๐Ÿ‡ณ๐Ÿ‡ท :nauru: ๐Ÿ‡ณ๐Ÿ‡บ :niue: top
top ๐Ÿ‡ณ๐Ÿ‡ฟ :new_zealand: ๐Ÿ‡ด๐Ÿ‡ฒ :oman: top
top ๐Ÿ‡ต๐Ÿ‡ฆ :panama: ๐Ÿ‡ต๐Ÿ‡ช :peru: top
top ๐Ÿ‡ต๐Ÿ‡ซ :french_polynesia: ๐Ÿ‡ต๐Ÿ‡ฌ :papua_new_guinea: top
top ๐Ÿ‡ต๐Ÿ‡ญ :philippines: ๐Ÿ‡ต๐Ÿ‡ฐ :pakistan: top
top ๐Ÿ‡ต๐Ÿ‡ฑ :poland: ๐Ÿ‡ต๐Ÿ‡ฒ :st_pierre_miquelon: top
top ๐Ÿ‡ต๐Ÿ‡ณ :pitcairn_islands: ๐Ÿ‡ต๐Ÿ‡ท :puerto_rico: top
top ๐Ÿ‡ต๐Ÿ‡ธ :palestinian_territories: ๐Ÿ‡ต๐Ÿ‡น :portugal: top
top ๐Ÿ‡ต๐Ÿ‡ผ :palau: ๐Ÿ‡ต๐Ÿ‡พ :paraguay: top
top ๐Ÿ‡ถ๐Ÿ‡ฆ :qatar: ๐Ÿ‡ท๐Ÿ‡ช :reunion: top
top ๐Ÿ‡ท๐Ÿ‡ด :romania: ๐Ÿ‡ท๐Ÿ‡ธ :serbia: top
top ๐Ÿ‡ท๐Ÿ‡บ :ru: ๐Ÿ‡ท๐Ÿ‡ผ :rwanda: top
top ๐Ÿ‡ธ๐Ÿ‡ฆ :saudi_arabia: ๐Ÿ‡ธ๐Ÿ‡ง :solomon_islands: top
top ๐Ÿ‡ธ๐Ÿ‡จ :seychelles: ๐Ÿ‡ธ๐Ÿ‡ฉ :sudan: top
top ๐Ÿ‡ธ๐Ÿ‡ช :sweden: ๐Ÿ‡ธ๐Ÿ‡ฌ :singapore: top
top ๐Ÿ‡ธ๐Ÿ‡ญ :st_helena: ๐Ÿ‡ธ๐Ÿ‡ฎ :slovenia: top
top ๐Ÿ‡ธ๐Ÿ‡ฏ :svalbard_jan_mayen: ๐Ÿ‡ธ๐Ÿ‡ฐ :slovakia: top
top ๐Ÿ‡ธ๐Ÿ‡ฑ :sierra_leone: ๐Ÿ‡ธ๐Ÿ‡ฒ :san_marino: top
top ๐Ÿ‡ธ๐Ÿ‡ณ :senegal: ๐Ÿ‡ธ๐Ÿ‡ด :somalia: top
top ๐Ÿ‡ธ๐Ÿ‡ท :suriname: ๐Ÿ‡ธ๐Ÿ‡ธ :south_sudan: top
top ๐Ÿ‡ธ๐Ÿ‡น :sao_tome_principe: ๐Ÿ‡ธ๐Ÿ‡ป :el_salvador: top
top ๐Ÿ‡ธ๐Ÿ‡ฝ :sint_maarten: ๐Ÿ‡ธ๐Ÿ‡พ :syria: top
top ๐Ÿ‡ธ๐Ÿ‡ฟ :swaziland: ๐Ÿ‡น๐Ÿ‡ฆ :tristan_da_cunha: top
top ๐Ÿ‡น๐Ÿ‡จ :turks_caicos_islands: ๐Ÿ‡น๐Ÿ‡ฉ :chad: top
top ๐Ÿ‡น๐Ÿ‡ซ :french_southern_territories: ๐Ÿ‡น๐Ÿ‡ฌ :togo: top
top ๐Ÿ‡น๐Ÿ‡ญ :thailand: ๐Ÿ‡น๐Ÿ‡ฏ :tajikistan: top
top ๐Ÿ‡น๐Ÿ‡ฐ :tokelau: ๐Ÿ‡น๐Ÿ‡ฑ :timor_leste: top
top ๐Ÿ‡น๐Ÿ‡ฒ :turkmenistan: ๐Ÿ‡น๐Ÿ‡ณ :tunisia: top
top ๐Ÿ‡น๐Ÿ‡ด :tonga: ๐Ÿ‡น๐Ÿ‡ท :tr: top
top ๐Ÿ‡น๐Ÿ‡น :trinidad_tobago: ๐Ÿ‡น๐Ÿ‡ป :tuvalu: top
top ๐Ÿ‡น๐Ÿ‡ผ :taiwan: ๐Ÿ‡น๐Ÿ‡ฟ :tanzania: top
top ๐Ÿ‡บ๐Ÿ‡ฆ :ukraine: ๐Ÿ‡บ๐Ÿ‡ฌ :uganda: top
top ๐Ÿ‡บ๐Ÿ‡ฒ :us_outlying_islands: ๐Ÿ‡บ๐Ÿ‡ณ :united_nations: top
top ๐Ÿ‡บ๐Ÿ‡ธ :us: ๐Ÿ‡บ๐Ÿ‡พ :uruguay: top
top ๐Ÿ‡บ๐Ÿ‡ฟ :uzbekistan: ๐Ÿ‡ป๐Ÿ‡ฆ :vatican_city: top
top ๐Ÿ‡ป๐Ÿ‡จ :st_vincent_grenadines: ๐Ÿ‡ป๐Ÿ‡ช :venezuela: top
top ๐Ÿ‡ป๐Ÿ‡ฌ :british_virgin_islands: ๐Ÿ‡ป๐Ÿ‡ฎ :us_virgin_islands: top
top ๐Ÿ‡ป๐Ÿ‡ณ :vietnam: ๐Ÿ‡ป๐Ÿ‡บ :vanuatu: top
top ๐Ÿ‡ผ๐Ÿ‡ซ :wallis_futuna: ๐Ÿ‡ผ๐Ÿ‡ธ :samoa: top
top ๐Ÿ‡ฝ๐Ÿ‡ฐ :kosovo: ๐Ÿ‡พ๐Ÿ‡ช :yemen: top
top ๐Ÿ‡พ๐Ÿ‡น :mayotte: ๐Ÿ‡ฟ๐Ÿ‡ฆ :south_africa: top
top ๐Ÿ‡ฟ๐Ÿ‡ฒ :zambia: ๐Ÿ‡ฟ๐Ÿ‡ผ :zimbabwe: top

๐Ÿ“ซ Connect with me๐Ÿ˜Š

linkedin portfolio gmail

Copyright ยฉ Shani Bider, 2024

License๐Ÿ“„

This project is licensed under the MIT License.

About

Web application built with Node.js, Express, JavaScript, and EJS (Embedded JavaScript) that serves as a quiz game for identifying flags stored in a PostgreSQL database. ๐Ÿ’ป๐Ÿ—‚

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published