{"id":20739875,"url":"https://github.com/ecureuill/milhasapi","last_synced_at":"2026-05-06T01:35:18.692Z","repository":{"id":184346879,"uuid":"671268466","full_name":"ecureuill/milhasapi","owner":"ecureuill","description":"API  developed as resut of the 7th Back-end Challenge of Alura.","archived":false,"fork":false,"pushed_at":"2023-08-14T18:09:35.000Z","size":419,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T01:42:42.950Z","etag":null,"topics":["ai","allura","alura-challenge","alura-challenges","alurachallenges","flywaydb","java","mockmvc","mysql","openai-java","spring-boot","vitrinedev"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ecureuill.png","metadata":{"files":{"readme":".github/README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-07-27T00:05:01.000Z","updated_at":"2023-08-15T22:59:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"763cc431-5d61-42b2-9851-f477e7bdc31e","html_url":"https://github.com/ecureuill/milhasapi","commit_stats":null,"previous_names":["ecureuill/milhasapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecureuill%2Fmilhasapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecureuill%2Fmilhasapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecureuill%2Fmilhasapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecureuill%2Fmilhasapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecureuill","download_url":"https://codeload.github.com/ecureuill/milhasapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243030771,"owners_count":20224663,"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":["ai","allura","alura-challenge","alura-challenges","alurachallenges","flywaydb","java","mockmvc","mysql","openai-java","spring-boot","vitrinedev"],"created_at":"2024-11-17T06:26:29.860Z","updated_at":"2025-10-26T23:39:55.825Z","avatar_url":"https://github.com/ecureuill.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \n# :airplane: Milhas API \n\n![Docker](https://img.shields.io/badge/-Docker-000?\u0026logo=Docker)\n![Linux](https://img.shields.io/badge/-Linux-000?\u0026logo=Linux)\n![Spring](https://img.shields.io/badge/-Spring-000?\u0026logo=Spring)\n![MySQL](https://img.shields.io/badge/-MySQL-000?\u0026logo=MySQL)\n![Git](https://img.shields.io/badge/Git-000?\u0026logo=Git)\n![VSCode](https://img.shields.io/badge/VSCode-000?\u0026logo=visualstudiocode)\n\n\u003c/div\u003e\n\n\u003ca href=\"https://www.alura.com.br/challenges/back-end-7/\"\u003e\n    \u003cimg src=\"https://www.alura.com.br/assets/img/challenges/logos/logo-challenges-back-end.1680020826.svg\" alt=\"Aimeos logo\" title=\"Alura Challenges\" align=\"left\" height=\"60px\"/\u003e\n\u003c/a\u003e\n\nThe goal is to provide information and resource related to possible travel destinations, showing photos, texts and also resources about testimonials from other travelers. In addition to integrating AI into your application.\n\n-------------\n\n\u003cbr/\u003e\n\n## :mag: Table Of Content\n\n- [About](#scroll-about)\n  - [Used Technologies](#used-technologies)  \n- [The Challenge](#dart-the-challenge)\n    - [Project Steps](#project-steps)\n- [Walkthrough](#footprints-walkthrough)\n- [API Doc](#scroll-api-doc)\n- [Running Locally](#rocket-running-locally)\n\n## :scroll: About\n\nAPI in development to the [7th Back-end Challenge](https://www.alura.com.br/challenges/back-end-7/) of Alura.\n\n### Used Technologies:\n- Language: Java\n- Framework: Spring Boot \n- Migration Tool: Flywaydb\n- Documentation: SpringDoc Swagger\n- OpeanAI Integration: [openai-java](https://github.com/TheoKanning/openai-java)\n- Other libraries: Lombok, DataFaker\n- Database: MySQL\n- Development environment: Docker\n- Code Editor: VS Code\n\n## :dart: The Challenge\n\n\u003e In this 7th Backend challenge, we are going to develop an API that will be integrated with Frontend. Our challenge is to provide information and resources from the database related to possible travel destinations, displaying photos and eye-catching text that encourages the user to want to visit that destination.\n\u003e\n\u003e In addition, we will also provide resources on testimonials from other travelers and, finally, we will integrate AI into our application.\n\n### Project steps\n\n- **\u003cfont color=\"green\"\u003eFirst Week\u003c/font\u003e**\n    - [x] **Testimonial CRUD** Create `/depoimentos` endpoint to perform CRUD operations. \n    - [x] **Random Testimonials**: Create `depoimentos-home` endpoint to show 3 random testimonials\n    - [x] **CORS** Enable CORS request from any origin on the development phase.\n    - [x] **Test** Verify the status code of GET, POST, PUT, DELETE of `/depoimentos` endpoint \n\n- **\u003cfont color=\"green\"\u003eSecond Week\u003c/font\u003e**\n    - [x] **Destination CRUD** Create `/destinos` endpoint to perform CRUD operations.\n    - [x] **Search Destination** by name.\n    - [x] **Test** `destinos` endpoint\n\n- **Third and Fourth Week**\n    - [x] **Update `destinos` endpoint** with the fields\n        - id\n        - Photo 1\n        - Photo 2\n        - Name\n        - Meta (max 160 characters)\n        - Description text (optional)\n    - [x] `/destinos/{id}` endpoint should retrieve\n        - Photo 1\n        - Photo 2\n        - Name\n        - Meta\n        - Description text\n    - [x] **AI integration** to generate description about destination, in case of some destination has no description\n    - [x] **Test** `destinos` endpoint\n\n## :footprints: Walkthrough\n\nCheck my steps to develop this project [here](DEV_WALKTHROUGH.md)\n\n## :scroll: API Doc \n\nThis projects uses [SpringDoc](https://springdoc.org/) (Swagger) to generate API documentation. You can check it by runing the project and accessing [swagger-ui](localhost:8080/swagger-ui/index.html)\n\n## :rocket: Running locally\n\n```bash\n# clone the repository\ngit clone https://github.com/ecureuill/milhasapi.git\n\n# Navigate to the cloned directory\ncd milhasapi\n```\n\nMilhasAPI uses MySQL as the database. Create a MySQL database, named **milhasapi** and update the database configuration in `src/main/resources/application.properties` file:\n\n```bash\nspring.datasource.url=jdbc:mysql://[URL]:[PORT]/milhasapi\nspring.datasource.username=[USERNAME]\nspring.datasource.password=[PASSWORD]\n```\nMilhasAPI is integrated to ChatGPT to generate destination description. Create an API key on [openai platform](platform.openai.com) and export it as environmet variable.\n\n```bash\nexport OPENAI_KEY=123\n```\nRun the project\n\n```bash\nmvn spring-boot:run\n```\n\nTo use this API, you can make HTTP requests to the provided endpoints using tools like cURL or Postman. \n\n\n\u003c!-- ------------\n\n\n| :placard: Vitrine.Dev |     |\n| -------------  | --- |\n| :sparkles: Nome        | **Milhas API**\n| :label: Tecnologias | Java Spring Boot, Docker, MySQL, Flyway, OpenAPI Swagger \n| :rocket: URL         | https://github.com/ecureuill/milhasapi\n| :fire: Desafio     | https://www.alura.com.br/challenges/back-end-7/\n\nInserir imagem com a #vitrinedev ao final do link --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecureuill%2Fmilhasapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecureuill%2Fmilhasapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecureuill%2Fmilhasapi/lists"}