An easy peasy headline news reader that enable you to grasp the up-to-date news headlines in light mode, dark mode and ... 90s mode! 🎉
The web application has been deployed: https://wacky-news-reader.web.app/.
- Create an account from The New York Times Developer Network. Create an API key and enable "Top Stories API".
- Create a file
.env
in the topmost directory of this project. Put the API key (not the secret) in the file:REACT_APP_NYT_API_KEY=<API Key>
. - Install the dependencies:
npm ci
. - Start the development server:
npm run start
- Open
http://localhost:3000
from a browser.
The component tests are located in src/__tests__
.
- Run jest in watch mode:
npm run test:jest
The end-to-end tests are located in cypress/integration
. Here is how you run the test in the interactive runner:
- Ensure Chrome and Firefox browsers have been installed.
- Run the development server. Ensure
http://localhost:3000
is up and running from the previous section. - Open Cypress:
npx cypress open
. - Select the desired browser (Chrome or Firefox) and click the test to run.
Cypress also offers us to run the test in headless mode: npx cypress run --headless --browser chrome
.
- Log in to your Google account via a browser.
- Create a Firebase project and register this web application: https://firebase.google.com/docs/web/setup.
- Log in to your Google account via the CLI:
npx firebase login
. - Ensure Firebase can preview and host the website:
npx firebase emulators:start
. The web application should be running onhttp://localhost:5000
. - Deploy the web application:
npx firebase deploy --only hosting
.
You can also use the Github Actions to deploy. You need to define two repository secrets under Settings > Secrets from the Github project's page.
API_KEY
: The API key from The New York Times Developer Network.FIREBASE_TOKEN
: The login token given bynpx firebase login:ci
.
Please feel free to send me a message.