This application presents simple usage of React + Typescript with basic usage of React Query and Styled components.
Browser fetch of data is not allowed through CORS limits. And because of this there is also BE server to circumvent this complication. It downloads fresh response from ČNB and will also prepare response in right typed format.
Otherwise I would fetch those data (txt file) during app build through command line, but this solution was not preferred because of data freshness and solution completeness.
I used pnpm as package manager. Application runs on Vite and has React v18.
- Clone this repo
- Start BE server - server is automatically started on port 3000
cd server
pnpm i
pnpm prod
- Build or start already built app
pnpm i
pnpm build
pnpm preview
Application now runs on http://localhost:4173/
- BE server can run as system service or under PM2, Caddy or nginx + Let's encrypt
- Docker containers with docker-compose and Caddy proxies (FE production build with file serve, BE on port proxy as /api virtualhost)
- .. so many options :-)
Data is loaded from Czech national bank
Documentation: https://www.cnb.cz/en/faq/Format-of-the-foreign-exchange-market-rates/