Northcoders News fetches data from the NC NEWS API to create a news website where users can read articles, post new content and comment on individual articles.
Here is an example Northcoders News page: NC NEWS
- React - Getting Started with React
- React Router - React Router - Declarative Routing for React.js
- Node.js (v. 9.11.1 and above) - Installing Node.js Tutorial: Using nvm on macOS and Ubuntu
- NPM (v. 6.1.0 and above) - gets installed with Node
Fork this repository and clone it onto your computer using the following terminal command:
git clone <repo url>
Then, cd
into the directory and run npm install
, or npm i
for short, in you terminal to install all modules listed in the package.json. This will make the following packages available:
- React (v. 16.4.2 and above)
- React DOM (v. 16.4.2 and above) - renders React elements into the DOM
- React Router (v. 4.3.1 and above) - provides routing functionality to your React project
- React Scripts (v. 1.1.4 and above) - set of scripts which help run projects without configuring
- Axios (v. 0.18.0 and above) - used to fetch data from the NC News API
To set up the development environment and start a server (listens on port 3000 by defualt) run the command below:
npm start
This will execute the react-scripts start
script which is part of React Scripts. It also supports hot module reloading, which means that every time you hit Save in your editor, the page will reload - it saves you from having to manually do it when you make changes.
There are a number of options to host your news website. Netlify is one of them, and the link below describes how you can deploy the app quickly and easily.