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

Challenge Charlie - Vítor Emanuel Queiroz Ferreira #173

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
99cecdd
:tada: init - Commit inicial: Configurado NextJS, ChakraUI, Theme, Es…
vitoremanuelqf Mar 9, 2023
40b7dbd
:lipstick: feat - Diagramação da pagina home, configuracao e integrac…
vitoremanuelqf Mar 20, 2023
91994ba
:iphone: feat - Responsividade adicionada ao projeto.
vitoremanuelqf Mar 23, 2023
1c3746b
Merge pull request #1 from vitoremanuelqf/feat/home-page
vitoremanuelqf Mar 27, 2023
2a37d54
:sparkles: feat - Configuração das APIS: Open Cage e Open Weather, cr…
vitoremanuelqf Apr 7, 2023
c031030
Merge pull request #2 from vitoremanuelqf/feat/apis-integration
vitoremanuelqf Apr 7, 2023
106618f
:sparkles: feat - Criação do componente de exibição dos Ícones, integ…
vitoremanuelqf Apr 14, 2023
90c0454
Merge pull request #3 from vitoremanuelqf/feat/integration
vitoremanuelqf Apr 14, 2023
977537e
:bug: fix - Correção do retorno dos erros e aleração do retorno das i…
vitoremanuelqf Apr 17, 2023
38fd321
:books: docs - Atualização do README
vitoremanuelqf Apr 17, 2023
acda723
Merge pull request #4 from vitoremanuelqf/feat/integration
vitoremanuelqf Apr 17, 2023
536b14b
Adicionado o test dos components de: Wallpaper, Today, Tomorrow, Afte…
vitoremanuelqf Apr 22, 2023
8d1c0f4
Merge pull request #5 from vitoremanuelqf/test/components
vitoremanuelqf Apr 22, 2023
a2a2e8d
:bug: fix - Remoção do @ na pasta @types, remoção do endereço local n…
vitoremanuelqf Apr 22, 2023
aafcbe7
:goal_net: Mesclando com a correção.
vitoremanuelqf Apr 22, 2023
a2510ca
Merge branch 'develop' of github.com:vitoremanuelqf/challenge-charlie…
vitoremanuelqf Apr 24, 2023
8e0c029
:books: docs - Atualização do README
vitoremanuelqf Apr 24, 2023
fd298c5
Merge pull request #7 from vitoremanuelqf/docs
vitoremanuelqf Apr 24, 2023
de3e437
:pencil: fix - Correção do README
vitoremanuelqf Apr 24, 2023
f4e0d4a
Merge pull request #8 from vitoremanuelqf/docs
vitoremanuelqf Apr 24, 2023
7666e19
:sparkles: feat - Configuração do Docker
vitoremanuelqf Apr 25, 2023
4b5b612
Merge pull request #9 from vitoremanuelqf/feat/docker-configuration
vitoremanuelqf Apr 25, 2023
6a92dea
:books: docs - Atualização da documentação: Como executar a aplicação…
vitoremanuelqf Apr 25, 2023
476caa0
Merge pull request #10 from vitoremanuelqf/docs
vitoremanuelqf Apr 25, 2023
b0e8eec
Merge pull request #11 from vitoremanuelqf/develop
vitoremanuelqf Apr 25, 2023
2dbe996
:mag: feat - Configuração do SEO, correção da posição dos elementos d…
vitoremanuelqf Apr 25, 2023
7d89675
Merge pull request #12 from vitoremanuelqf/feat/seo
vitoremanuelqf Apr 25, 2023
bbd4e88
Merge pull request #13 from vitoremanuelqf/develop
vitoremanuelqf Apr 25, 2023
cb334ad
Atualização do README
vitoremanuelqf Apr 25, 2023
0c8d9e0
Merge pull request #14 from vitoremanuelqf/docs
vitoremanuelqf Apr 25, 2023
8c222c1
Merge pull request #15 from vitoremanuelqf/develop
vitoremanuelqf Apr 25, 2023
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
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
README.md
.next
docker
.git
14 changes: 14 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# BING
ENV_BASE_URL_BING="https://www.bing.com"
ENV_PARAMS_URL_BING="/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=pt-US"

# Open Cage
ENV_BASE_URL_OPEN_CAGE="https://api.opencagedata.com"
ENV_API_KEY_OPEN_CAGE="31fc23367d7a4e6c8dad89fba83d3145"

# Open Weather
ENV_BASE_URL_OPEN_WEATHER="https://api.openweathermap.org"
ENV_API_APPID_OPEN_WEATHER="efcdcf9645161aebc4b7efc3fe851dcf&lang=pt_br"

# IBGE
ENV_BASE_URL_IBGE="https://servicodados.ibge.gov.br"
14 changes: 14 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# BING
ENV_BASE_URL_BING="https://www.bing.com"
ENV_PARAMS_URL_BING="/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=pt-US"

# Open Cage
ENV_BASE_URL_OPEN_CAGE="https://api.opencagedata.com"
ENV_API_KEY_OPEN_CAGE="31fc23367d7a4e6c8dad89fba83d3145"

# Open Weather
ENV_BASE_URL_OPEN_WEATHER="https://api.openweathermap.org"
ENV_API_APPID_OPEN_WEATHER="efcdcf9645161aebc4b7efc3fe851dcf&lang=pt_br"

# IBGE
ENV_BASE_URL_IBGE="https://servicodados.ibge.gov.br"
14 changes: 14 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# BING
ENV_BASE_URL_BING="https://www.bing.com"
ENV_PARAMS_URL_BING="/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=pt-US"

# Open Cage
ENV_BASE_URL_OPEN_CAGE="https://api.opencagedata.com"
ENV_API_KEY_OPEN_CAGE="31fc23367d7a4e6c8dad89fba83d3145"

# Open Weather
ENV_BASE_URL_OPEN_WEATHER="https://api.openweathermap.org"
ENV_API_APPID_OPEN_WEATHER="efcdcf9645161aebc4b7efc3fe851dcf&lang=pt_br"

# IBGE
ENV_BASE_URL_IBGE="https://servicodados.ibge.gov.br"
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "@rocketseat/eslint-config/react",
"rules": {
"camelcase": "off",
"no-redeclare": "off",
"@typescript-eslint/camelcase": "off"
}
}
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

exec >/dev/console 2>&1;
npx --no-install lint-staged
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.PHONY: build-development
build-development: ## Build the development docker image.
docker compose -f docker/development/docker-compose.yml build

.PHONY: start-development
start-development: ## Start the development docker container.
docker compose -f docker/development/docker-compose.yml up -d

.PHONY: stop-development
stop-development: ## Stop the development docker container.
docker compose -f docker/development/docker-compose.yml down

.PHONY: build-staging
build-staging: ## Build the staging docker image.
docker compose -f docker/staging/docker-compose.yml build

.PHONY: start-staging
start-staging: ## Start the staging docker container.
docker compose -f docker/staging/docker-compose.yml up -d

.PHONY: stop-staging
stop-staging: ## Stop the staging docker container.
docker compose -f docker/staging/docker-compose.yml down

.PHONY: build-production
build-production: ## Build the production docker image.
docker compose -f docker/production/docker-compose.yml build

.PHONY: start-production
start-production: ## Start the production docker container.
docker compose -f docker/production/docker-compose.yml up -d

.PHONY: stop-production
stop-production: ## Stop the production docker container.
docker compose -f docker/production/docker-compose.yml down
59 changes: 59 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# <img src="https://avatars1.githubusercontent.com/u/7063040?v=4&s=200.jpg" alt="HU" width="24" /> Charlie Challenge

[[English](README.md) | [Portuguese](README.pt.md)]

Build a responsive microsite to display the weather forecast at the locations given in the white text box (in the [example](./exemplo.jpg) image is where "Rio de Janeiro, Rio de Janeiro" appears. This text box should be an `input`, where the user can change the location. With the change of location, the weather forecast information for the new location must be loaded.

Once the page is opened, the user's geographic coordinates must be collected by the browser API to discover the city name via _reverse geocode_.

The Bing highlight image should be used as the background. Forecasts for: today, tomorrow and the day after tomorrow should be shown.

Note that there is a gradient superimposed on the original image, in fact this color reflects the current temperature of the place searched for the three dates. For temperatures below 15ºC, shades of blue should be used, for temperatures above 35ºC, shades of red should be used and shades of yellow should be used for other temperatures. When there is no chosen location, shades of gray should be used as the basis for the gradient. If the user clicks on any temperature, the temperatures should be changed from Celsius to Fahrenheit or from Fahrenheit to Celsius.

The background image URL should be extracted from the [Bing API](https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=pt-US).

To consult the weather forecast, use the one from [OpenWeather](http://api.openweathermap.org/data/2.5/weather?q={{location_name}}&APPID=772920597e4ec8f00de8d376dfb3f094) informing the name of the location instead of ` {{location_name}}` using app id `772920597e4ec8f00de8d376dfb3f094`. If necessary, create a new account.

To convert latitude and longitude to a location use [OpenCage](https://api.opencagedata.com/geocode/v1/json?q={{latitude}},{{longitude}}&key=c63386b4f77e46de817bdf94f552cddf&language=en) using the API key `c63386b4f77e46de817bdf94f552cddf`. If necessary, create a new account.

Icons can be found at http://www.alessioatzeni.com/meteocons/.

The layout must be followed, but you can suggest improvements. Describe these improvements in the README and why. You get extra points if these improvements are positive, or lose points otherwise.

## Requirements

- Preferably do it in React, but you can use other libraries or frameworks (Angular, Vue.js, etc) or pure JavaScript (Vanilla JS).
- For the style sheet, you can use whatever you prefer (CSS, SASS, LESS, CSS Modules, CSS-in-JS, etc).
- Preferably use Webpack. If you prefer, you can use [create-react-app](https://github.com/facebook/create-react-app) or similar. Doing your own Webpack setup gives you extra points.
- It is interesting that your application is ready for production. Create in Docker a `stage` fbravoor production and one for development of extra points.
- Fork this challenge and create your project (or workspace) using your version of that repository, as soon as you finish the challenge, submit a _pull request_.
- If you have any reason not to submit a _pull request_, create a private repository on Github, do every challenge on the **master** branch and don't forget to fill in the `pull-request.txt` file. As soon as you finish your development, add the user [`automator-hurb`](https://github.com/automator-hurb) to your repository as a contributor and make it available for at least 30 days. **Do not add the `automator-hurb` until development is complete.**
- If you have any problem creating the private repository, at the end of the challenge fill in the file called `pull-request.txt`, compress the project folder - including the `.git` folder - and send it to us by email.
- The code needs to run inside a Docker container.
- To run your code, all you need to do is run the following commands:
- git clone \$your-fork
- cd \$your-fork
- command to install dependencies
- command to run the application

## Evaluation criteria

- **Organization of code**: Separation of modules, view and model, back-end and front-end
- **Clarity**: Does the README explain briefly what the problem is and how can I run the application?
- **Assertiveness**: Is the application doing what is expected? If something is missing, does the README explain why?
- **Code readability** (including comments)
- **Security**: Are there any clear vulnerabilities?
- **Test coverage** (We don't expect full coverage)
- **History of commits** (structure and quality)
- **UX**: Is the interface user-friendly and self-explanatory? Is the API intuitive?
- **Technical choices**: Is the choice of libraries, database, architecture, etc. the best choice for the application?

## Doubts

Any questions you may have, check the [_issues_](https://github.com/HurbCom/challenge-charlie/issues) to see if someone hasn't already and if you can't find your answer, open one yourself. new issue!

Godspeed! ;)

<p align="center">
<img src="ca.jpg" alt="Challange accepted" />
</p>
Loading