{"id":18022854,"url":"https://github.com/orliluq/trivia","last_synced_at":"2026-05-04T21:35:52.468Z","repository":{"id":260184434,"uuid":"880472589","full_name":"Orliluq/trivia","owner":"Orliluq","description":" 🎃 Backend Challenge (Java): API para una trivia de Halloween!  🎃","archived":false,"fork":false,"pushed_at":"2024-10-30T00:31:22.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T18:17:01.572Z","etag":null,"topics":["devtools","h2-database","jakarta","java","jpa-persistence-applications","openapi","springboot","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Orliluq.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":"2024-10-29T19:37:06.000Z","updated_at":"2024-11-12T17:01:25.000Z","dependencies_parsed_at":"2024-10-30T02:14:44.033Z","dependency_job_id":null,"html_url":"https://github.com/Orliluq/trivia","commit_stats":null,"previous_names":["orliluq/trivia"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orliluq%2Ftrivia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orliluq%2Ftrivia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orliluq%2Ftrivia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orliluq%2Ftrivia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Orliluq","download_url":"https://codeload.github.com/Orliluq/trivia/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226191,"owners_count":20904467,"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":["devtools","h2-database","jakarta","java","jpa-persistence-applications","openapi","springboot","swagger-ui"],"created_at":"2024-10-30T07:05:51.362Z","updated_at":"2026-05-04T21:35:52.428Z","avatar_url":"https://github.com/Orliluq.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend Challenge (Java): 👻 Halloween Trivia API 👻\n\n![Java](https://img.shields.io/badge/Java-21-blue)\n![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.3.5-brightgreen)\n![Build](https://img.shields.io/github/workflow/status/your-username/halloween-trivia-api/Build%20API%20Project)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n![Contributions](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)\n![Swagger](https://img.shields.io/badge/documented%20with-Swagger-orange.svg)\n\n## 👻 **Theme:** Create an API for a Halloween trivia game!\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://git.io/typing-svg\"\u003e\n    \u003cimg src=\"https://readme-typing-svg.demolab.com?font=Fira+Code\u0026pause=1000\u0026color=F70729\u0026width=435\u0026lines=Trick+or+treat+code!+%F0%9F%91%BB;The+creepiest+API+%F0%9F%8E%83\"/\u003e\u003c/a\u003e\u003cbr\u003e\n\u003c/p\u003e\n\n## Description 🧛‍♂️\n\nThis project involves developing a RESTful API in Java that serves as a trivia game centered around Halloween. The API manages questions and answers related to myths and legends of Halloween.\n\n## Requirements 🕸️\n\n- Implement endpoints to:\n  - Add questions\n  - List all questions\n  - Update existing questions\n- Questions must include a difficulty level (easy, medium, hard).\n- Users should be able to retrieve a list of random questions for each difficulty level.\n- Document the API using Swagger or OpenAPI.\n\n## Endpoints ⚰️\n\nHere are the available endpoints in the API:\n\n1. **Add a New Question**\n   - **Endpoint:** `POST /questions`\n   - **Description:** Adds a new trivia question to the database.\n   - **Request Body:**\n     ```json\n     {\n         \"question\": \"What supernatural being is said to emerge from its grave on Halloween?\",\n         \"answer\": \"Zombie\",\n         \"difficulty\": \"hard\"\n     }\n     ```\n\n2. **List All Questions**\n   - **Endpoint:** `GET /questions`\n   - **Description:** Retrieves all trivia questions from the database.\n   \n3. **Update an Existing Question**\n   - **Endpoint:** `PUT /questions/{id}`\n   - **Description:** Updates a trivia question by its ID.\n   - **Request Body:**\n     ```json\n     {\n         \"question\": \"What supernatural being is said to emerge from its grave on Halloween?\",\n         \"answer\": \"Zombie\",\n         \"difficulty\": \"medium\"\n     }\n     ```\n\n4. **Get Random Questions by Difficulty**\n   - **Endpoint:** `GET /questions/random/{difficulty}`\n   - **Description:** Retrieves a list of random questions based on the specified difficulty level (easy, medium, hard).\n\n## Technologies Used 🦇\n\n- Java\n- Spring Boot\n- JPA (Java Persistence API)\n- H2 Database (or any database of your choice)\n- Swagger/OpenAPI for API documentation\n\n![swagger](https://github.com/user-attachments/assets/2aa26024-edfa-49df-9389-41435a823b4b)\n\n## Setup Instructions 💀\n\n1. Clone this repository:\n```bash\n   `git clone https://github.com/Orliluq/trivia.git`\n```\n2. Navigate to the project directory:\n```bash\n   `cd trivia` \n```\n3. Build the project:\n```bash\n   `./mvnw clean install`\n```\n4. Run the application:\n```bash\n   `./mvnw spring-boot:run` \n```\n5. Access the API documentation at:\n```bash\n   `http://localhost:8080/swagger-ui.html` \n```\n\n## License 🎃\nThis project is licensed under the MIT License.\n\n## Contributing 😱\nFeel free to submit issues or pull requests if you want to contribute to this project!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forliluq%2Ftrivia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forliluq%2Ftrivia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forliluq%2Ftrivia/lists"}