├── backend ├── package.json ├── services │ ├── pricing.test.js │ └── pricing.js ├── index.js ├── controllers │ └── index.js └── csv │ └── pricing.csv ├── public ├── favicon.ico ├── logo192.png ├── logo512.png ├── robots.txt ├── manifest.json └── index.html ├── .env ├── src ├── Error.js ├── setupTests.js ├── Loader.js ├── App.test.js ├── index.css ├── reportWebVitals.js ├── index.js ├── App.css ├── App.js ├── logo.svg └── Pricing.js ├── README.md ├── .gitignore └── package.json /backend/package.json: -------------------------------------------------------------------------------- 1 | {"type": "module"} -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abbasikov/bigmac/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abbasikov/bigmac/HEAD/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abbasikov/bigmac/HEAD/public/logo512.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | #for resolving react and jest dependencies 2 | SKIP_PREFLIGHT_CHECK=true 3 | 4 | BACKEND_PORT=3001 5 | FRONTEND_PORT=3000 6 | -------------------------------------------------------------------------------- /backend/services/pricing.test.js: -------------------------------------------------------------------------------- 1 | const pricing = require('./pricing'); 2 | 3 | test('check if readCsv() returns an array', () => { 4 | expect(typeof(pricing.readCsv())).toBe([]); 5 | }); -------------------------------------------------------------------------------- /src/Error.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | function Error() { 4 | return ( 5 |
68 | Please enter an amount of money in your local currency 69 |
70 | this.calculatePricing(e.target.value)} 81 | maxLength='10' 82 | required 83 | /> 84 |
90 | You could buy {this.state.numberOfMacsInYourCountry}{' '}
91 | of Big Macs in your country
92 |
93 | Your Dollar Purchasing Parity (PPP) is{' '}
94 | {this.props.pricing.user_dollar_ppp}
95 |
96 | This is a simple lookup to the table
97 |
109 | You could buy{' '}
110 | {this.state.numberOfMacsInRandomCountry} number of
111 | Big Macs in {this.props.pricing.random_country} with{' '}
112 | {this.state.input}
113 |
114 | Your {this.state.input} is worth about{' '}
115 | {this.state.worthInRandom} in{' '}
116 | {this.props.pricing.random_country}
117 |