{"id":19755600,"url":"https://github.com/jonatandb/weatherapp_api","last_synced_at":"2026-04-14T00:03:39.941Z","repository":{"id":82442911,"uuid":"479925177","full_name":"Jonatandb/weatherapp_api","owner":"Jonatandb","description":"API of https://github.com/Jonatandb/weatherapp_frontend","archived":false,"fork":false,"pushed_at":"2023-06-05T03:58:36.000Z","size":2594,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T09:09:51.549Z","etag":null,"topics":["jonatandb","openapi","openapi3","swagger","typescript"],"latest_commit_sha":null,"homepage":"https://weatherapp-jdb.web.app","language":"JavaScript","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/Jonatandb.png","metadata":{"files":{"readme":"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":"2022-04-10T05:46:27.000Z","updated_at":"2022-04-13T23:06:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"7bc07c4e-3d43-410a-9bdf-091f2c82468c","html_url":"https://github.com/Jonatandb/weatherapp_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jonatandb/weatherapp_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jonatandb%2Fweatherapp_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jonatandb%2Fweatherapp_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jonatandb%2Fweatherapp_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jonatandb%2Fweatherapp_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jonatandb","download_url":"https://codeload.github.com/Jonatandb/weatherapp_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jonatandb%2Fweatherapp_api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259606882,"owners_count":22883558,"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":["jonatandb","openapi","openapi3","swagger","typescript"],"created_at":"2024-11-12T03:12:36.580Z","updated_at":"2026-04-14T00:03:39.915Z","avatar_url":"https://github.com/Jonatandb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Características generales y técnicas:\n\n- Desarrollado con JavaScript utilizando Node.js.\n- Se utiliza el API del servicio de clima [Open Weather Map](https://openweathermap.org/).\n- La ciudad actual se detecta con la IP del usuario, utilizando el servicio de [IP-API](https://ip-api.com/).\n\n---\n\n\u003ccenter\u003e\n\n![desktop](OpenApi_Screenshot.png)\n\n\u003c/center\u003e\n\n---\n\n### Esta API provee en formato JSON el estado del tiempo por medio de diferentes endpoints:\n\n- Ruta base:\n  - **/v1**\n- Endpoints:\n\n  - **/location** (_Devuelve nombre de la ciudad actual según la IP del usuario._)\n  - **/current/_city_** (_Devuelve clima según \"city\", o de la ciudad actual si no se especificó una._)\n  - **/forecast/_city_** (_Devuelve pronóstico a 5 días según \"city\", o de la ciudad actual si no se especificó una._)\n\n    - **Nota**: _El parámetro \"city\" es opcional. Si no está presente se usa la cuidad correspondiente a la IP del usuario._\n\n  - **/openapi** (_Swagger (openapi): Interfaz web que muestra documentación de la API y permite interactuar con los endpoints_)\n\n---\n\n### Requerimientos:\n\n- [NodeJs v.16](https://nodejs.org/es/)\n- API KEY de [Open Weather Map](https://openweathermap.org/) (_Requiere crear cuenta gratuita_)\n\n---\n\n### Miscelaneos:\n\n- Utilizar el archivo **_.env.example_** como modelo para crear un archivo llamado **_.env_** que tenga el siguiente contenido:\n  - `PORT` (_Especifica el puerto en que se desea que se ejecute la API._)\n  - `IP_API_SERVICE_BASE_URL` _(Especifica la url de la API que provee información sobre la ubicación según la IP proporcionada, viene pre-configurada.)_\n  - `WEATHER_SERVICE_API_KEY` _(Especifica la API KEY de Open Weather Map. Requiere registro gratuito.)_\n\n---\n\n### Ejecución:\n\n\u003e - npm install\n\u003e - npm start\n\u003e - Navegar a http://localhost:3001/v1/openapi si se desea ver e interactuar con la lista de endpoints (_**3001** es el puerto sugerido, se debe configurar en el archivo .env -\u003e **PORT**_)\n\n---\n\n### Tests/Coverage:\n\n\u003e - npm test\n\u003e - npm run test:coverage (_Luego abrir el archivo: **backend\\coverage\\lcov-report\\index.html**_)\n\u003e - ~~**NOTA** Debido a que tuve problemas para ejecutar los tests, ya que estoy usando módulos de ES con [_Dynamic imports_](https://javascript.info/modules-dynamic-imports) en un proyecto CommonJS, tuve que crear dos nuevos scripts para correr los tests, los cuales utilizan características experimentales de Node JS. (_[Fuente](https://stackoverflow.com/a/61653104/10752198)_). Los nuevos scripts son los siguientes:~~\n\u003e   - ~~_npm run test:experimental_~~\n\u003e   - ~~_npm run test:coverage:experimental_~~\n\u003e     - _(Solucionado instalando versiones anteriores de node-fetch y public-ip totalmente compatibles con CommonJS)_\n\n---\n\n### Pendientes/Bugs:\n\n- [https://github.com/Jonatandb/weather-app-with-fastify/issues](https://github.com/Jonatandb/weather-app-with-fastify/issues)\n\n---\n\n### Sitios investigados:\n\n- https://stackoverflow.com/questions/45053974/requiring-an-async-function-in-nodejs\n- https://stackoverflow.com/questions/50974313/node-js-async-module-require\n- https://github.com/fastify/fastify/issues/267 Weird behavior with fastify.register, async/await\n- https://stackoverflow.com/questions/27906551/node-js-logging-use-morgan-and-winston\n- https://www.fastify.io/docs/latest/Reference/Plugins/\n- https://www.fastify.io/docs/latest/Guides/Getting-Started/#your-first-plugin\n- https://futurestud.io/tutorials/retrieve-a-requests-ip-address-in-node-js\n- https://openweathermap.org/api/one-call-api\n- https://openweathermap.org/faq#:~:text=OpenWeather%20uses%20Unix%20time%20and,forecast%20and%20historical%20weather%20data\n- https://stackoverflow.com/questions/62376115/how-to-obtain-open-weather-api-date-time-from-city-being-fetched\n- https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-screen-queries.md\n- https://www.youtube.com/watch?v=KYjjtRgg_H0\u0026ab_channel=midudev TESTING en REACT 🧪 ¡Aprende DESDE CERO! Con react-testing-library y Jest (FullStack Bootcamp JS)\n- https://code.visualstudio.com/docs/languages/jsconfig What is jsconfig.json?\n- https://github.com/microsoft/TypeScript/issues/46700#issuecomment-968084329 Auto import doesn't work unless it already imported from another file #46700\n- https://github.com/microsoft/vscode/issues/132299 Auto Import not working (Typescript ) after latest update\n- https://openweathermap.org/weather-conditions\n- https://www.freecodecamp.org/news/how-to-create-a-react-app-with-a-node-backend-the-complete-guide/\n- https://github.com/fastify/fastify-cors\n- https://github.com/OAI/OpenAPI-Specification/issues/93 - Optional path parameters 💔\n- https://www.fastify.io/docs/latest/Reference/Validation-and-Serialization/\n- https://editor.swagger.io/\n- https://swagger.io/docs/specification/2-0/describing-parameters/\n- https://github.com/fastify/fastify/pull/2607#discussion_r501120298 - The optional chain operator /:opt?\n- https://ajv.js.org/json-schema.html\n- https://www.fastify.io/docs/latest/Reference/Validation-and-Serialization/#validation\n- https://github.com/fastify/fastify/blob/main/docs/Reference/Request.md\n- https://stackoverflow.com/questions/60372790/node-v13-jest-es6-native-support-for-modules-without-babel-or-esm\n- https://stackoverflow.com/questions/31629389/how-to-use-eslint-with-jest\n- https://jackfiallos.com/entendiendo-code-covereage-usando-jest\n- https://jestjs.io/es-ES/search?q=coverage\n- https://github.com/micromatch/micromatch\n- https://jestjs.io/docs/configuration#collectcoveragefrom-array\n- https://joshtronic.com/2017/10/24/configuring-jest-to-show-code-coverage-for-all-of-your-files/\n- https://www.fastify.io/docs/latest/Guides/Testing/#benefits-of-using-fastifyinject\n- https://github.com/fastify/fastify/blob/main/test/listen.test.js\n- https://www.fastify.io/docs/latest/Reference/Server/#server\n- https://jestjs.io/es-ES/docs/getting-started\n- https://github.com/zentered/demo-async-fastify-with-jest ♥\n- https://zentered.co/articles/setup-async-fastify-with-jest-test/ ♥♥\n- https://javascript.plainenglish.io/how-to-build-a-reliable-authentication-api-with-fastify-c5a24bf8cd41 mongodb jwt bcrypt\n- https://stackoverflow.com/questions/tagged/fastify+jestjs?tab=Newest\n- https://stackoverflow.com/questions/71545883/how-to-setup-and-teardown-a-web-server-with-jest\n- https://fettblog.eu/void-in-javascript-and-typescript/\n- https://daily-dev-tips.com/posts/common-jest-matchers/\n- https://dev.to/wolfejw86/setup-a-fastify-app-with-jest-tests-the-right-way-43ih\n- https://dev.to/itsrennyman/how-i-structure-my-fastify-application-1j93#fifth-unit-testing\n- https://node-tap.org/docs/getting-started/\n- https://www.fastify.io/docs/latest/Guides/Testing/#testing-with-a-running-server\n- https://ajv.js.org/json-schema.html#type\n- https://stackoverflow.com/questions/38933973/how-to-provide-example-value-to-a-response-body-of-content-type-text-html-in-sw\n- https://github.com/testdouble/teenytest\n- https://stackoverflow.com/questions/40795836/how-do-you-use-the-files-and-directories-properties-in-package-json\n- https://stackoverflow.com/questions/38009315/redirecting-from-aws-api-gateway-using-response-302\n- https://stackoverflow.com/questions/60332687/how-to-define-two-different-responses-for-same-response-code-with-302-redirect\n- https://github.com/fastify/fastify-swagger\n- https://lenguajejs.com/automatizadores/introduccion/commonjs-vs-es-modules/\n- https://www.youtube.com/watch?v=JD6VNRdGl98\u0026ab_channel=LeonardoKuffo REST y RESTful APIs | Te lo explico en 5 minutos!\n- https://www.youtube.com/watch?v=99YMeCBk3jw\u0026ab_channel=LazyLoading Arquitectura monolítica vs microservicios\n- https://www.youtube.com/watch?v=QDXMoDbOd5s\u0026ab_channel=MakeitReal Microservicios vs Monolito\n- https://www.youtube.com/watch?v=EKseAAm4pvY Creando aplicaciones web con Node.js y Fastify\n- https://www.youtube.com/watch?v=YfN9hElekuM\u0026ab_channel=LeiferMendez CORS\n- https://eslint.org/docs/user-guide/getting-started\n- https://github.com/prettier/eslint-config-prettier\n- https://lenguajejs.com/javascript/caracteristicas/eslint/\n- https://github.com/Cristiandi/demo-fastify/blob/master/src/environment.js --------- Interesante manejo de diferentes .env (local, development, etc)\n- https://platzi.com/tutoriales/1339-fundamentos-javascript/2181-como-usar-eslint-y-prettier-para-mejorar-tu-codigo-javascript/\n- https://daily-dev-tips.com/posts/lets-talk-about-software-testing/\n- https://daily-dev-tips.com/posts/adding-jest-test-to-a-project/?utm_source=Daily+Dev+Tips\u0026utm_medium=email\u0026utm_campaign=mailinglist\n- https://www.conventionalcommits.org/es/v1.0.0/#especificaci%c3%b3n\n- https://github.com/petervanderdoes/gitflow-avh#git-flow-usage\n- https://docs.github.com/es/get-started/quickstart/github-flow\n- https://tech-wiki.online/es/node-setimmediate.html\n- https://www.cual-es-mi-ip.net/\n- https://www.npmjs.com/package/ip-address\n- https://stackoverflow.com/questions/3162457/how-to-check-with-javascript-if-connection-is-local-host\n- https://stackoverflow.com/questions/20553554/node-js-return-hostname\n- https://stackoverflow.com/questions/21987311/check-is-nodejs-connection-come-from-localhost\n- https://www.npmjs.com/package/is-localhost-url\n- https://blog.devgenius.io/server-side-development-with-fastify-async-and-await-and-route-prefixes-d5704eb5206\n- https://jaywolfe.dev/rapidly-build-a-nodejs-rest-api-with-fastify-postgresql-and-swagger-documentation/\n- https://github.com/fastify/example -------------- Collection of Fastify projects\n- https://github.com/fastify/fastify\n- https://stackoverflow.com/questions/70478820/unable-to-deploy-nodejs-fastify-app-in-azure-app-service-linux\n- https://dev.to/ruanmartinelli/how-to-use-schemas-on-fastify-for-fun-and-profit-25e9\n- https://dev.to/dsalinasgardon/the-6-best-javascript-frameworks-to-use-in-2022-4k5k\n- https://dev.to/eomm/why-should-i-prefer-fastify-to-expressjs-44c4\n- https://www.fastify.io/docs/latest/Reference/Routes/#route-prefixing\n- https://github.com/useaurora/api/blob/main/app.js --------------------- Buena división entre app.js y server.js \\*\\*\n- https://github.com/fastify/fastify-autoload\n- https://dev.to/itsrennyman/how-i-structure-my-fastify-application-1j93\n- https://dev.to/thomasbnt/perspective-api-20al\n- https://dev.to/thomasbnt/create-a-fastify-server-23lg\n- https://dev.to/hypeddev/es-modules-in-fastify-349f\n- https://github.com/fastify/fastify-express\n- https://json-schema.org/learn/getting-started-step-by-step\n- https://dev.to/cristiandi/demo-api-using-fastify-48jo\n- https://dev.to/whitep4nth3r/how-i-massively-improved-my-website-performance-by-using-the-right-tool-for-the-job-23cl\n- https://www.freecodecamp.org/espanol/news/que-es-jamstack/\n- https://dev.to/dailydevtips1/building-a-fastify-nodejs-server-296g\n- https://www.fastify.io/docs/latest/Guides/Plugins-Guide/\n- https://github.com/gquittet/graceful-server\n- https://github.com/fastify/fastify-sensible\n- https://github.com/fastify/fastify-nextjs\n- https://github.com/fastify/fastify-helmet\n- https://github.com/fastify/fastify-env\n- https://github.com/fastify/fastify-swagger\n- https://www.fastify.io/ecosystem/\n- https://www.fastify.io/docs/latest/Guides/Testing/\n- https://www.fastify.io/docs/v3.0.x/Routes/\n- https://www.fastify.io/docs/latest/Guides/Getting-Started/\n- https://www.fastify.io/\n- https://xp123.com/articles/3a-arrange-act-assert/\n- https://martinfowler.com/bliki/GivenWhenThen.html\n- https://dev.to/stealthmusic/everything-thats-not-tested-will-break-1adg\n- https://dev.to/codingpizza/what-is-a-unit-test-1e1m\n- https://github.com/Huachao/vscode-restclient\n- https://stackoverflow.com/questions/69063074/rest-client-vscode-extention-is-not-sending-json-data\n- https://dev.to/tusharpandey13/getting-on-with-es6-nodejs-eslint-without-babel-4ip7\n- https://www.npmjs.com/package/morgan\n- https://ichi.pro/es/funciones-emocionantes-de-javascript-es2021-32885188220171\n- https://babeljs.io/docs/en/babel-cli\n- https://www.freecodecamp.org/news/setup-babel-in-nodejs/\n- https://www.freecodecamp.org/espanol/news/que-es-babel/\n- https://hacks.mozilla.org/2015/08/es6-in-depth-modules/\n- https://blog.logrocket.com/how-to-use-ecmascript-modules-with-node-js/\n- https://stackoverflow.com/questions/69041454/error-require-of-es-modules-is-not-supported-when-importing-node-fetch\n- https://es.stackoverflow.com/questions/484949/problema-con-fetch-en-node\n- https://stackoverflow.com/questions/6784753/passing-route-control-with-optional-parameter-after-root-in-express\n- https://stackoverflow.com/questions/60205891/import-json-extension-in-es6-node-js-throws-an-error\n- https://kinsta.com/es/base-de-conocimiento/http-304/\n- https://es.stackoverflow.com/questions/199109/obtener-la-ip-del-cliente-en-node-js\n- https://expressjs.com/en/4x/api.html#trust.proxy.options.table\n- https://www.mickpatterson.com.au/blog/api-versioning-with-nodejs-and-express/\n- https://stackoverflow.com/questions/51513715/node-js-rest-api-versioning-the-right-way/51514184#51514184\n- https://www.atlassian.com/es/git/tutorials/comparing-workflows/gitflow-workflow\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonatandb%2Fweatherapp_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonatandb%2Fweatherapp_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonatandb%2Fweatherapp_api/lists"}