Skip to content

Repository files navigation

My-News-App Project

Table of Contents

Introduction

My-news-app

This is a web application that helps users to query archives containing historical news. The users can search by specifying a search query, To and From Published dates and Order of results. Each article shows the title, sourcename, description, image and when the article was published.

Technologies used

  • Frontend: ReactJS with Material UI using Typescript
  • Backend: NodeJS & RestAPI & Expressjs & using Typescript
  • REST API documentation: Swagger UI
  • Testing: Jest, React testing library, Supertest & MSW
  • Monorepo management: Lerna was used
  • CI - Github Actions
  • Containerization - Docker

Features

Getting Started

To run this web application on your local machine, follow the steps below:

Prerequisites

Before getting started, ensure that you have the following software installed on your machine:

  • Node.js: Download and install Node.js from the official website: https://nodejs.org
  • TypeScript: You can install TypeScript globally using npm:
npm install -g typescript

Before you start the application, you need to set up an environment variable to store your API key. Here's how you can do it:

PORT = 3001
VALID_API_KEY="YOUR API KEY"

Create a file called .env in express-backend folder of the project with the environmental variables above. Replace "YOUR API KEY" with your key.

Installation

Step-by-step guide on how to install the project and its dependencies.

  1. Clone the repository to your local machine using Git:
git clone https://github.com/ayofalo/my-news-app.git
  1. Navigate to the project directory
cd my-news-app
  1. Install the project dependencies using NPM(Node Package Manager):
npm install
  1. Navigate to the directory of the react-frontend and express-backend as shown below and install corresponding dependencies
cd my-news-app/packages/react-frontend
npm install
cd my-news-app/packages/express-backend
npm install

Running the web application

Once you have installed the dependencies, you can start the web application (Frontend and Backend concurrently) using

cd my-news-app
npm run start:both

Running Tests

Once you have installed the dependencies, you can run test within the react-frontend and express-backend directory

  • react-frontend
cd packages
cd react-frontend
npm run test
press a to run all tests
  • run test express-backend
cd packages
cd express-backend
npm run test

Run docker

navigate to the root directory

cd my-news-app
docker-compose up

To stop the containers

docker-compose stop

API documentation

Access API documentation via Swagger UI using the link below after starting up the application

http://localhost:3001/api-docs/#/default/get_api_articles

Usage

License

This project is licensed under the MIT License.

Authors

Contributors names and contact info

Ayo Folami

Releases

Packages

Contributors

Languages