Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tech News

A simple news aggregator web app built as a college project. It fetches real-time technology and startup news using the NewsAPI and displays them as clean, responsive cards.


##Features

  • Live News Feed β€” Fetches latest tech and startup news using NewsAPI
  • Category Filters β€” Filter news by AI, Crypto, Gadgets, or view All
  • Search β€” Instantly search through loaded articles by title or description
  • Read More β€” Click any article link to open the full story in a new tab
  • Image Fallback β€” Broken images are replaced with a placeholder automatically
  • Responsive Layout β€” Cards wrap cleanly on all screen sizes

πŸ› οΈ Tech Stack

Technology Usage
HTML Page structure
CSS Styling and layout
JavaScript Logic, DOM manipulation, API calls
NewsAPI Public news data source

πŸ“ Project Structure

Tech-News/
β”œβ”€β”€ index.html      # Main HTML file
β”œβ”€β”€ index.css       # Stylesheet
β”œβ”€β”€ index.js        # JavaScript logic
└── README.md       # Project documentation

βš™οΈ How It Works

  1. On page load, fetch() calls the NewsAPI with the query technology OR startup
  2. The response JSON is stored in allArticles array
  3. forEach loop creates a card for each article and appends it to #main
  4. Filter buttons update the displayed cards by filtering allArticles using .filter()
  5. Search input filters articles in real time by matching title and description

πŸ”‘ API Used

NewsAPI β€” https://newsapi.org

  • Endpoint: GET /v2/everything
  • Parameters used: q, sortBy, language, apiKey

Note: The free tier of NewsAPI only works on localhost for development. For production deployment, a paid plan is required.


How to Run

  1. Clone or download this repository
  2. Open index.html directly in your browser, or use a local server like VS Code Live Server
  3. News will load automatically on page open

Concepts Used

  • fetch() and Promises (.then())
  • forEach loop for DOM rendering
  • filter() for category and search filtering
  • createElement and innerHTML for dynamic card creation
  • localStorage (for upcoming Night Mode feature)
  • CSS Flexbox for card layout
  • onerror attribute for image fallback

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages