Skip to content

Commit

Permalink
add linting and testing before deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambrozy committed Nov 4, 2024
1 parent e7e7b30 commit d5998d8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ jobs:
uses: oven-sh/setup-bun@v2
- name: Install bun
run: bun install
- name: Linting
run: bun run lint
- name: Testing
run: bun run test
- name: Use weather API key
run: echo "VITE_ACCUWEATHER_API_KEY=${{ secrets.VITE_ACCUWEATHER_API_KEY }}" > ./env.local
- name: Build Application
run: bun run build --base=/${{ github.event.repository.name }}/
- name: Setup Pages
Expand Down
13 changes: 11 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ See deployed version here [Open Weather App](https://ambrozy.github.io/weather-w
3. [Library and tool selection](#library-and-tool-selection)
4. [Application architecture](#application-architecture)
5. [CI/CD](#cicd)
6. [Security notes](#security-notes)
3. [Code refactoring](#code-refactoring)
4. [Ideas for further project development](#ideas-for-further-project-development)
1. [Technical issues](#technical-issues)
Expand Down Expand Up @@ -69,8 +70,8 @@ Install `bun` package manager globally. [Bun docs](https://bun.sh/)

It's enough for the demo, but not for the real application
5. **Browser support**.
- 100% support for the latest version of Chrome, Firefox, Safari, and Edge.
- 100% support for any desktop and phone screen dimensions; minimum width: 320px, maximum width (4K): 3840px.
- 100% support for the latest version of Chrome, Firefox, Safari, and Edge.
- 100% support for any desktop and phone screen dimensions; minimum width: 320px, maximum width (4K): 3840px.

### Library and tool selection:

Expand Down Expand Up @@ -118,6 +119,14 @@ Use the minimum number of required libraries for flexible and easy development.
- **CD**: Use `GitHub pages` to deploy our weather app. On master branch changes, after a successful CI check, build and
deploy the app.

### Security notes:

We are using a weather API key. If this key is exposed, anyone can use it, which is why it must be kept confidential. To
achieve this, we should store the API key in the repository secrets, and for local development, it should be kept in a
`.env.local` file, which is stored only on the development machine. To ensure that the API key does not end up in the
final build, a proxy backend should be implemented, which would add the API key and request the third-party API. In this
demo application, a free API key is used, and no proxy backend has been implemented.

# Code refactoring

1. Rewrite code in `typescript`.
Expand Down
6 changes: 3 additions & 3 deletions src/service/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const DEFAULT_GEO_POSITION: GeoPosition = {
};

export const HOURLY_FORECAST_URL =
"http://dataservice.accuweather.com/forecasts/v1/hourly/12hour/";
"https://dataservice.accuweather.com/forecasts/v1/hourly/12hour/";
export const DAILY_FORECAST_URL =
"http://dataservice.accuweather.com/forecasts/v1/daily/5day/";
"https://dataservice.accuweather.com/forecasts/v1/daily/5day/";
export const GEO_POSITION_URL =
"http://dataservice.accuweather.com/locations/v1/cities/geoposition/search";
"https://dataservice.accuweather.com/locations/v1/cities/geoposition/search";

0 comments on commit d5998d8

Please sign in to comment.