NewsBite is a cutting-edge news aggregation application that provides users with a seamless and personalized news browsing experience. Built with React, TypeScript, and leveraging the power of modern web technologies, NewsBite offers a rich set of features designed to keep users informed and engaged.
- Aggregates news from multiple reputable sources, including The New York Times API.
- Unified article format for consistent presentation across different sources.
- Category Filter: Browse news by specific categories (e.g., technology, politics, sports).
- Date Range Selection: Filter articles within a custom date range.
- Keyword Search: Find articles containing specific keywords or phrases.
- Source Filter: Focus on news from particular sources.
- Author Filter: Discover articles by specific journalists or authors.
- Fully responsive layout that adapts to various screen sizes and devices.
- Implements accessibility best practices for an inclusive user experience.
- Toggle between light and dark themes for comfortable reading in any environment.
- Utilizes React Query for efficient data fetching and caching.
- Automatic refetching to ensure the latest news is always available.
- Visually appealing article cards with images, titles, abstracts, and metadata.
- Quick access to full articles via external links.
- Implements lazy loading and code splitting for faster initial load times.
- Efficient state management using Zustand for a smooth user experience.
- Graceful error handling with user-friendly error messages.
- Skeleton loading states for a polished loading experience.
- Persistent filters and settings using local storage.
- Intuitive mobile navigation with a responsive header and mobile menu.
- Structure in place to easily add multi-language support.
NewsBite integrates with three powerful news APIs to provide a diverse and comprehensive news feed:
-
The New York Times API: Offers access to high-quality journalism and breaking news from one of the world's leading news organizations.
-
The Guardian API: Provides a wide range of news articles from The Guardian and The Observer, known for their investigative journalism and international coverage.
-
News API: Aggregates headlines from over 80,000 sources worldwide, offering a broad spectrum of news content.
- Docker installed on your machine
-
Copy the sample environment file:
cp .env.sample .env
-
Open the
.env
file and provide your own API keys for the following services:- NYT API
- The Guardian API
- News API
The
.env
file should look similar to this:VITE_NYT_API_KEY=your_nyt_api_key_here VITE_THE_GUARDIAN_API_KEY=your_guardian_api_key_here VITE_NEWS_API_ORG_KEY=your_news_api_key_here
Replace
your_*_api_key_here
with your actual API keys obtained from the respective services.
-
Clone the repository:
git clone https://github.com/Vette1123/NewsBite.git cd NewsBite
-
Build the Docker image:
docker build -t newsbite .
-
Run the Docker container:
docker run -p 3000:3000 newsbite
-
Access the application: Open your browser and navigate to
http://localhost:3000
Our Dockerfile implements several best practices and features:
- Multi-stage build: Optimizes the final image size by separating build and runtime environments.
- Non-root user: Enhances security by running the application as a non-root user.
- Health check: Ensures the application is running correctly within the container.
- Environment variables: Allows for easy configuration of API keys and other settings.
- Caching: Leverages Docker layer caching for faster builds.
- React
- TypeScript
- Vite
- Tailwind CSS
- React Query
- Zustand
- Axios
- React Router
- Shadcn UI
- Docker
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
This project is MIT licensed.
- The New York Times API
- The Guardian API
- News API
- All other news sources and APIs used in this project
- The open-source community for the amazing tools and libraries