Skip to content

joshuadanpeterson/news-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HeadlineHub

Overview

HeadlineHub, formerly known as Simple News App, is a refined web application aimed at aggregating and displaying top news headlines utilizing the News API. This project is a continuation of the Week 5: Asynchronous Programming and APIs module of the Nucamp Boot Camp, now enhanced with a more intuitive user interface and additional functionalities like search and better organization of news items. It's crafted to provide a more engaging hands-on experience with working with APIs, managing API keys securely, and handling asynchronous operations in JavaScript.

Technologies Used

  • JavaScript
  • Bootstrap for styling
  • Parcel Bundler
  • Node.js
  • News API

Setup

Project Setup

  1. Create a new folder named headline-hub in your course directory.
  2. Navigate to the headline-hub directory in your terminal.
  3. Initialize a new Node.js project with the command:
npm init -y
  1. Install Parcel as a development dependency:
npm install --save-dev parcel

File Structure

Create the following files:

  • index.html
  • scripts.js
  • styles.css
  • .env
  • .gitignore

Update package.json:

"description": "HeadlineHub is a lightweight and user-friendly news aggregation web application.",
"source": "index.html",
"scripts": {
    "start": "parcel --open"
}

Adding Enhanced HTML

In index.html, add the new structured HTML to accommodate Bootstrap styling and a better layout for news items, as per the latest updates made in the project.

Securing the API Key

  1. Open .env and add your News API key:
NEWS_API_KEY=YourApiKeyHere
  1. Ensure the API key is kept secret and not committed to version control by updating .gitignore to exclude the .env file:
node_modules
.env
.parcel-cache
dist

Initializing Git

  1. Initialize a new Git repository in your project folder:
git init
  1. Create a new repository on GitHub.
  2. Connect your local repository to the remote repository:
git remote add origin YOUR_REPOSITORY_URL
  1. Stage, commit, and push your files to the remote repository:
git add .
git commit -m "Initial commit"
git push origin main

Usage

Run the following command to start the development server:

npm run start

Parcel will open the app in your default web browser. The app will now fetch and display top headlines from the News API on the page, with additional functionalities like search and a more visually appealing layout.

Additional Resources

License

This project is for educational purposes and is unlicensed under the ISC license, allowing for free use, modification, and distribution.

About

Nucamp JavaScript Fundamentals News App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published