-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
2,450 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM --platform=linux/amd64 docker.io/node:lts-alpine as builder | ||
WORKDIR /app | ||
COPY . . | ||
RUN npm i | ||
RUN npm run build | ||
|
||
|
||
FROM nginx | ||
EXPOSE 3000 | ||
COPY nginx/default.conf /etc/nginx/conf.d/default.conf | ||
COPY --from=builder app/dist/news /usr/share/nginx/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
# News App | ||
|
||
Assignment for Manantal | ||
|
||
### Specifications | ||
|
||
- Bootstrapped with nx | ||
- React | ||
- React router | ||
- Redux toolkit | ||
- Styled components | ||
- Material ui | ||
- ci github actions | ||
|
||
### Set up | ||
|
||
#### Install dependencies | ||
|
||
`npm i` | ||
|
||
#### Serve development environment | ||
|
||
`npm start` | ||
|
||
#### Simulate production environment with docker and nginx | ||
|
||
- run docker on desktop | ||
- build image | ||
`npm run build-production-image` | ||
- run image | ||
`npm run start-production` | ||
|
||
#### Run test | ||
|
||
`npm test` | ||
|
||
#### Notes | ||
|
||
I wrote tests as example will take me to much time to write tests for everything can see examples of a test of state in `src/app/news/state/news.state.test.ts` a component without state `src/app/shared/components/results/results.test.tsx` and a component with state and props `src/app/news/components/sources-filter/sources-filter.test.tsx`, same with comments you can see and example on `src/app/shared/components/results/results.tsx` | ||
Hope you like it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
server { | ||
listen 3000; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
Oops, something went wrong.