Skip to content

Latest commit

Β 

History

History
118 lines (85 loc) Β· 3.98 KB

File metadata and controls

118 lines (85 loc) Β· 3.98 KB

πŸ“° New York Pines β€” A New York Times Clone

New York Pines is a React-based web application that replicates the core functionality and layout of the New York Times homepage. It leverages the official New York Times API to fetch high-quality news content and display it with a modern, responsive, and accessible interface.

This project was developed as part of the Start2Impact Front-End Development path.

πŸ” Features

  • βœ… Homepage Clone: A structured, responsive homepage inspired by the layout and flow of nytimes.com.
  • βœ… News Sections: Browse articles from multiple NYT sections like World, Technology, Health, Sports, and more.
  • βœ… Trending Slider: A hero slider at the top highlights the 3 most popular articles.
  • βœ… Search: Keyword-based article search with debounced input.
  • βœ… Load More: Paginated loading with animated entry of news cards.
  • βœ… Responsive Layout: Fully optimized for mobile, tablet, and desktop.
  • βœ… SEO Optimization: Dynamic page titles via react-helmet.
  • βœ… Scroll-to-Top button.
  • βœ… Share Button: Easily share articles with the Web Share API or copy links.
  • βœ… 404 Page: Friendly "Page Not Found" fallback with return navigation.

πŸ’‘ Bonus Features

  • βœ… Framer Motion for animations (card entry, transitions, button effects).
  • βœ… Social Footer with GitHub and LinkedIn.
  • βœ… Hamburger Menu for mobile navigation.
  • βœ… Smooth UX with hover previews, loading skeletons, tooltips, etc.
  • βœ… Lazy Loading of images for performance.

πŸ›  Tech Stack

Tool Role
React + TypeScript Frontend UI development
Vite Blazing-fast build tool
TailwindCSS (v4) Utility-first styling
Redux Toolkit Global state management
Axios Fetching NYT API data
React Router Client-side routing
Framer Motion Animations & transitions
react-helmet SEO & meta tag management

πŸ“ Project Structure

nyt-clone/
β”œβ”€β”€ public/                # Static files
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/        # Reusable components (Navbar, Footer, HeroSlider, etc.)
β”‚   β”œβ”€β”€ constants/         # Static data (sections, etc.)
β”‚   β”œβ”€β”€ pages/             # Home, Search, 404
β”‚   β”œβ”€β”€ store/             # Redux store & slices
β”‚   β”œβ”€β”€ types/             # TypeScript types
β”‚   β”œβ”€β”€ App.tsx            # App entry
β”‚   β”œβ”€β”€ main.tsx           # Root render
β”‚   └── index.css          # Global styles
β”œβ”€β”€ .env                   # API keys (NYT) *not in repository
β”œβ”€β”€ tailwind.config.js     # Tailwind setup
β”œβ”€β”€ vite.config.ts         # Vite config
└── package.json           # Dependencies & scripts

πŸš€ Getting Started

  1. Clone the Repository:

    git clone https://github.com/andreaferrari95/nyt-clone.git
  2. Install Dependencies:

    npm install
  3. Setup Environment Variables:

    Create a .env file and add your NYT API key:

    VITE_NYT_API_KEY=your_api_key_here
  4. Run the Dev Server:

    npm run dev

    Access the app at http://localhost:5173.

πŸ“¦ Scripts

  • npm run dev β€” Start local dev server
  • npm run build β€” Production build
  • npm run preview β€” Preview built app
  • npm run lint β€” Run ESLint checks

πŸ” NYT API Integration

Using these endpoints:

  • πŸ”Έ Top Stories API β€” by section (e.g., world, technology, etc.)
  • πŸ”Έ Most Popular API β€” top trending articles

More info: NYT Developer Docs.

πŸ“£ Credits

Developed by Andrea Ferrari as part of the Start2Impact curriculum.

Special thanks to:

  • πŸ“° New York Times API
  • πŸ’» Open source libraries and tools

πŸ“„ License

MIT β€” free to use, fork, and build upon.