Skip to content

imaditya55/worldCapital

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 World Capitals Quiz App

A simple quiz application that asks users questions about countries and their capitals.

The app is built using Node.js, Express, and PostgreSQL.
Questions are fetched from a database and shown dynamically on the web page using EJS.


✨ Features

  • Random country–capital questions
  • Score tracking
  • PostgreSQL database integration
  • Dynamic pages with EJS
  • Secure environment variable setup

🛠 Tech Stack

  • Backend: Node.js, Express
  • Database: PostgreSQL
  • Template Engine: EJS
  • Tools: dotenv, pg

📁 Project Structure

worldCapital/ │ ├── index.js ├── db.js ├── package.json ├── .env.example ├── views/ │ └── index.ejs ├── public/ │ └── css / js / images

yaml Copy code


⚙️ How to Run the Project

  1. Clone the repository
    git clone <repository-url>
  2. nstall dependencies

bash Copy code npm install 3. Create a .env file using .env.example

env Copy code DB_USER= DB_HOST= DB_NAME= DB_PASSWORD= DB_PORT= 4. Add your PostgreSQL database details

  1. Start the server

bash Copy code node index.js Open your browser and visit http://localhost:3000

About

This is a quiz app that asks questions about countries and their capitals. The app is built using Node.js and Express and gets questions from a PostgreSQL database. Each time a user answers a question, the app checks the answer and updates the score. The pages are created on the server using EJS, so the questions and score change dynamically.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors