News admin dashboard
Tags: react, javascript, programming, buildinpublic
Published: 2024-03-31 15:16:31

Try me: [https://admin-dashboard-seven-gules.vercel.app/](https://admin-dashboard-seven-gules.vercel.app/)

# Admin dashboard for News
React JS, Material UI, X-charts.

# Installation guide

In the project directory, you can run:
### `npm install`

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

# Dashboard 

## Activity: 
Provides quick access to key
metrics and functionalities of the admin panel. This could include user activity, content statistics, quick links to manage news feeds, view performance reports, top-performing news, shared news, commented news, etc.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uzz61q15pue47tl0nvey.png)

## Trending News
Top 3 trending news. Comparing the views count.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xrhfcbq82mx4vizjje75.png)

## Add News
Add title, Content, ./images/image and Video for new news.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sk967ygk14l9kon52n4g.png)

### Mobile preview
A mobile preview screen, enabling
administrators/sub-editors/content writers to see how the news feed will appear on mobile devices before publishing.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b41vxyj8tw48pxl4dd6b.png)

## News report
A bar graph ploted with detailed analysis with views as respect to the news catagory.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6pnumaaam8y9ro4hz5a.png)

## Manage content 
All uploaded news with options to view analytics, edit, and delete the news.

### News analytics

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hdxjsryltitgl38prhqt.png)

### Edit uploaded news

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0rtvip1oddswli4noap7.png)

# Code structure
Used Context API to pass the news data among all the components.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ja69ebi7nuh9gvap4mf.png)

Seperate components and pages. Using `useContext` inside child component to recive the array and passing `updateArray` functions to update the array as needed.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qywj9gqm04g85h8ueju4.png)

# API call
Inside the App.js file cahange the rows data array with a `fetch API` call and from backend and change the value parameters.