Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation-01-update-readme #6

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
238 changes: 236 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,238 @@
### Doc
![Index app](./doc/assets/img/weather-data.png)

* [weather-conditions](https://openweathermap.org/weather-conditions)
<div align="right">
<a href="./translation/README.es.md" target="_blank">
<img src="./doc/assets/translation/arg-flag.jpg" width="10%" height="10%" />
</a>
<a href="./README.md" target="_blank">
<img src="./doc/assets/translation/eeuu-flag.jpg" width="10%" height="10%" />
</a>
</div>

<div align="center">

# Microservice OpenWeather Nodejs Jest AWS

</div>

Microservice for the integration of the Open Weather API with focus on unit and integration tests implementing Nodejs, Jest, Serverless-framework, aws-lambda, api gateway, git, others. AWS services are tested locally. The project code and its documentation (less technical doc) have been developed in English.


* [Weather-conditions](https://openweathermap.org/weather-conditions)
* [Api keys](https://home.openweathermap.org/api_keys)
* [Playlist functionality test](https://www.youtube.com/watch?v=oLSrmqMq0Zs\&list=PLCl11UFjHurB9JzGtm5e8-yp52IcZDs5y) <a href="https://www.youtube.com/watch?v=oLSrmqMq0Zs\&list=PLCl11UFjHurB9JzGtm5e8-yp52IcZDs5y" target="_blank"> <img src="https://github.com/andresWeitzel/Microservice_Mercadolibre_Users_AWS/blob/master/doc/assets/social-networks/yt.png" width="5%" height="5%" /> </a>

<br>

## Index 📜

<details>
<summary> See </summary>

<br>

### Sección 1) Description, configuration and technologies.

* [1.0) Project description.](#10-description-)
* [1.1) Project execution.](#11-project-execution-)
* [1.2) Project setup from scratch](#12-project-setup-from-scratch-)
* [1.3) Technologies.](#13-technologies-)

### Sección 2) Endpoints and Examples

* [2.0) Endpoints and resources.](#20-endpoints-and-resources-)
* [2.1) Examples.](#21-examples-)

### Sección 3) Functionality test and references

* [3.0) Functionality test.](#30-functionality-test-and-references-)
* [3.1) References.](#31-references-)

<br>

</details>

<br>

## Sección 1) Description, configuration and technologies.

### 1.0) Description [🔝](#index-)

<details>
<summary>See</summary>

<br>

### 1.0.0) General description


### 1.0.1) Description Architecture and Operation


<br>

</details>

### 1.1) Project execution [🔝](#index-)

<details>
<summary>See</summary>
<br>

<br>

</details>
<br>

### 1.2) Project setup from scratch [🔝](#index-)

<details>
<summary>Ver</summary>

<br>

<br>

</details>

### 1.3) Technologies [🔝](#index-)

<details>
<summary>See</summary>

<br>

| **Technologies** | **Version** | **Purpose** |
| ------------- | ------------- | ------------- |
| [SDK](https://www.serverless.com/framework/docs/guides/sdk/) | 4.3.2 | Automatic Module Injection for Lambdas |
| [Serverless Framework Core v3](https://www.serverless.com//blog/serverless-framework-v3-is-live) | 3.23.0 | Core Services AWS |
| [Systems Manager Parameter Store (SSM)](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) | 3.0 | Management of Environment Variables |
| [Jest](https://jestjs.io/) | 29.7 | Framework para pruebas unitarias, integración, etc. |
| [Amazon Api Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html) | 2.0 | API Manager, Authentication, Control and Processing |
| [NodeJS](https://nodejs.org/en/) | 14.18.1 | js library |
| [Sequelize](https://sequelize.org/) | ^6.11.0 | ORM |
| [Mysql](https://www.mysql.com/) | 10.1 | SGDB |
| [XAMPP](https://www.apachefriends.org/es/index.html) | 3.2.2 | Server package |
| [VSC](https://code.visualstudio.com/docs) | 1.72.2 | IDE |
| [Postman](https://www.postman.com/downloads/) | 10.11 | http client |
| [CMD](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) | 10 | Símbolo del Sistema para linea de comandos |
| [Git](https://git-scm.com/downloads) | 2.29.1 | Version control |
| Otros | Otros | Otros |

</br>

| **Plugin** |
| ------------- |
| [Serverless Plugin](https://www.serverless.com/plugins/) |
| [serverless-offline](https://www.npmjs.com/package/serverless-offline) |
| [serverless-offline-ssm](https://www.npmjs.com/package/serverless-offline-ssm) |

</br>

| **Extensión** |
| ------------- |
| Prettier - Code formatter |
| YAML - Autoformatter .yml |
| Error Lens - for errors and indent |
| Tabnine - IA Code |
| Otros - Otros |

<br>

</details>

<br>

## Sección 2) Endpoints and Examples.

### 2.0) Endpoints and resources [🔝](#index-)

<details>
<summary>See</summary>

<br>

</details>

### 2.1) Examples [🔝](#index-)

<details>
<summary>See</summary>
<br>


<br>

</details>

<br>

## Section 3) Functionality Testing and References.

### 3.0) Functionality test [🔝](#index-)

<details>
<summary>See</summary>

<br>

</details>

### 3.1) References [🔝](#índice-)

<details>
<summary>See</summary>

<br>

#### Configuration

* [How to use Sequelize with Node.js and MySQL](https://jasonwatmore.com/post/2022/06/26/nodejs-mysql-connect-to-mysql-database-with-sequelize-mysql2)
* [Recommended Video Tutorial](https://www.youtube.com/watch?v=im7THL67z0c)

#### Tools

* [AWS Design Tool app.diagrams.net](https://app.diagrams.net/?splash=0\&libs=aws4)

#### Sequelize

* [Models and Operators](https://sequelize.org/docs/v6/core-concepts/model-querying-basics/)

#### Free market

* [Users and applications](https://developers.mercadolibre.com.ar/es_ar/usuarios-y-aplicaciones)
* [Description of users](https://developers.mercadolibre.com.ar/es_ar/producto-consulta-usuarios)

#### Swagger with Serverless

* [Autoswagger](https://www.npmjs.com/package/serverless-auto-swagger)
* [Documentation serverless api](https://levelup.gitconnected.com/documenting-your-serverless-solutions-509f1928564b)

#### Open Apiv3 with Serverless

* [serverless open api ](https://www.serverless.com/plugins/serverless-openapi-documentation)

#### API Gateway

* [Best Api-Gateway Practices](https://docs.aws.amazon.com/whitepapers/latest/best-practices-api-gateway-private-apis-integration/rest-api.html)
* [Creating Custom Api-keys](https://towardsaws.com/protect-your-apis-by-creating-api-keys-using-serverless-framework-fe662ad37447)
* [Gateway Api properties configuration](https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml)

#### Serverless frameworks

* [Plugins](https://www.serverless.com/plugins)

#### Libraries/Plugins

* [Field validation](https://www.npmjs.com/package/node-input-validator)
* [serverless-offline-ssm](https://www.serverless.com/plugins/serverless-offline-ssm)
* [serverless open api ](https://www.serverless.com/plugins/serverless-openapi-documentation)

#### Jest
* [Environment vars solution](https://stackoverflow.com/questions/48033841/test-process-env-with-jest)


<br>

</details>

Binary file added doc/assets/img/weather-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/assets/translation/arg-flag.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/assets/translation/eeuu-flag.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/controllers/weather-condition/get.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
//helpers
const { sendGetRequest } = require("../../helpers/axios/request/get");
const { statusCode } = require("../../helpers/enums/http/status-code");
const { statusCode } = require("../../enums/http/status-code");
const { createJson } = require("../../helpers/file-system/create-json");
const { bodyResponse } = require("../../helpers/http/body-response");
//const
Expand Down
30 changes: 14 additions & 16 deletions src/data/json/weather-condition/weather-condition-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,29 @@
],
"base": "stations",
"main": {
"temp": 303.45,
"feels_like": 302.44,
"temp_min": 303.45,
"temp_max": 303.45,
"pressure": 1011,
"humidity": 33,
"sea_level": 1011,
"grnd_level": 990
"temp": 306.71,
"feels_like": 306.19,
"temp_min": 306.71,
"temp_max": 306.71,
"pressure": 1010,
"humidity": 32,
"sea_level": 1010,
"grnd_level": 989
},
"visibility": 10000,
"wind": {
"speed": 6.59,
"deg": 31,
"gust": 7.52
"speed": 6.12,
"deg": 18,
"gust": 6.21
},
"clouds": {
"all": 0
},
"dt": 1701090264,
"dt": 1704463937,
"sys": {
"type": 2,
"id": 2040186,
"country": "AR",
"sunrise": 1701075537,
"sunset": 1701126513
"sunrise": 1704445863,
"sunset": 1704497456
},
"timezone": -10800,
"id": 3865483,
Expand Down
Empty file added translation/README.es.md
Empty file.