This project integrates with the New York Times Most Popular Articles API using Test-Driven Development (TDD). It includes unit tests with Jest, React Testing Library, and JSdom, as well as end-to-end tests with Cypress. SonarQube is used for generating reports on code quality.
- Node.js >= 20
- PostgreSQL
- Java 17 (for SonarQube)
-
Obtain API Key: Visit New York Times Developer to obtain your API key.
-
Environment Setup:
- Copy
.env.example
to.env
and fill in your API key and other necessary environment variables.
- Copy
-
Install Dependencies: Before running the project, ensure all dependencies are installed:
npm install
-
Run in Development:
npm start
For production deployment, Docker is recommended:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --build
-
React ecosystem:
react
- React libraryreact-dom
- React DOM bindingsreact-scripts
- Scripts and configuration for Create React Appreact-redux
- Official React bindings for Reduxreact-router-dom
- DOM bindings for React Router@chakra-ui/react
- UI component library@emotion/react
,@emotion/styled
- CSS-in-JS library@fontsource/archivo
- Font package
-
State Management:
@reduxjs/toolkit
- Redux toolkit for efficient Redux development
-
Testing:
jest
- Testing framework for JavaScript@testing-library/react
- Testing utilities for React@testing-library/jest-dom
- Custom Jest matchers for React testing@testing-library/user-event
- Simulate events for React testingcypress
- End-to-end testing framework for web applications
-
Other Utilities:
framer-motion
- Animation library for React componentsreact-share
- Social media share buttons for Reacttypescript
- TypeScript for type-safe JavaScript
-
Start Development Server:
npm start
-
Build for Production:
npm run build
-
Run Tests:
npm test
-
Run End-to-End Tests with Cypress:
npm run test:e2e
-
Generate Code Coverage and SonarQube Report:
npm run sonar
-
Linting and Formatting:
npm run lint npm run format
-
Open Cypress Test Runner:
npm run cypress:open
SonarQube:
- Ensure SonarQube is set up locally or use SonarQube cloud services for code quality reports.