{"id":26367483,"url":"https://github.com/rahulrmcoder/game-capital-quiz","last_synced_at":"2025-03-16T21:17:20.998Z","repository":{"id":273175573,"uuid":"918904351","full_name":"RahulRmCoder/Game-Capital-Quiz","owner":"RahulRmCoder","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-19T07:17:32.000Z","size":1118,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T08:20:15.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RahulRmCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-19T07:10:21.000Z","updated_at":"2025-01-19T07:17:33.000Z","dependencies_parsed_at":"2025-01-19T08:20:23.120Z","dependency_job_id":"23b31c87-169a-4805-8a95-e0845e25cc4c","html_url":"https://github.com/RahulRmCoder/Game-Capital-Quiz","commit_stats":null,"previous_names":["rahulrmcoder/game-capital-quiz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulRmCoder%2FGame-Capital-Quiz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulRmCoder%2FGame-Capital-Quiz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulRmCoder%2FGame-Capital-Quiz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulRmCoder%2FGame-Capital-Quiz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RahulRmCoder","download_url":"https://codeload.github.com/RahulRmCoder/Game-Capital-Quiz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933454,"owners_count":20370988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-16T21:17:20.513Z","updated_at":"2025-03-16T21:17:20.988Z","avatar_url":"https://github.com/RahulRmCoder.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Game-Capital-Quiz\n\nThis is a fun and interactive web application where users can test their knowledge of world capitals. The application fetches country and capital data from a PostgreSQL database and presents a random country for the user to guess its capital.\n\n---\n\n## Features\n- Random country is presented for users to guess the capital.\n- Tracks the user's total correct answers (score).\n- Provides immediate feedback on whether the answer is correct or not.\n- Alerts the user when the game is over and displays their best score.\n- Option to restart the game.\n- Uses a PostgreSQL database to fetch country and capital data dynamically.\n\n---\n\n## Technologies Used\n\n### Backend\n- **Node.js**\n- **Express.js**\n- **PostgreSQL**\n\n### Frontend\n- **HTML5**\n- **CSS**\n- **JavaScript**\n\n---\n\n## Prerequisites\n\nEnsure you have the following installed:\n1. [Node.js](https://nodejs.org/)\n2. [PostgreSQL](https://www.postgresql.org/)\n\n---\n\n## Setup Instructions\n\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/RahulRmCoder/Game-Capital-Quiz.git\ncd Game-Capital-Quiz\n```\n\n### 2. Install Dependencies\nRun the following command to install the required dependencies:\n```bash\nnpm install\n```\n\n### 3. Configure PostgreSQL Database\n\n1. Ensure PostgreSQL is running.\n2. Create a database named `world`.\n3. Create a table named `capitals` with the following schema:\n   ```sql\n   CREATE TABLE capitals (\n       id SERIAL PRIMARY KEY,\n       country VARCHAR(255) NOT NULL,\n       capital VARCHAR(255) NOT NULL\n   );\n   ```\n4. Populate the table with sample data:\n   ```sql\n   INSERT INTO capitals (country, capital) VALUES\n   ('France', 'Paris'),\n   ('United Kingdom', 'London'),\n   ('United States of America', 'New York');\n   ```\n\n### 4. Update Database Connection\nOpen the `index.js` file and update the PostgreSQL connection details:\n```javascript\nconst db = new pg.Client({\n    user: \"postgres\",\n    host: \"localhost\",\n    database: \"world\",\n    password: \"your_password\",\n    port: 5432,\n});\n```\nReplace `your_password` with your PostgreSQL password.\n\n### 5. Start the Server\nRun the server using:\n```bash\nnode index.js\n```\nThe server will start at [http://localhost:3002](http://localhost:3002).\n\n---\n\n## File Structure\n```\nIndian-Cricket-Players-Stats/\n├── public/\n│   └── styles/\n│       └── main.css  # CSS file for styling the application\n├── views/\n│   └── index.ejs     # EJS template for rendering the game\n├── index.js          # Main server-side script\n└── README.md         # Project documentation\n```\n\n---\n\n## Usage\n1. Open your browser and go to `http://localhost:3002`.\n2. Guess the capital of the displayed country and submit your answer.\n3. The application will indicate whether your answer is correct and update your score.\n4. When the game ends, a message will alert you, and you can restart.\n\n---\n\n## Future Enhancements\n- Add a timer to make the game more challenging.\n- Implement user authentication and leaderboard functionality.\n- Support multiple languages for country names and capitals.\n- Add difficulty levels based on the region or number of countries.\n\n---\n\n## License\nThis project is licensed under the MIT License. Feel free to use and modify it as per your needs.\n\n---\n\n## Contributions\nContributions are welcome! Feel free to submit a pull request or open an issue in the repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulrmcoder%2Fgame-capital-quiz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahulrmcoder%2Fgame-capital-quiz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulrmcoder%2Fgame-capital-quiz/lists"}