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
To run this web application on your local machine, follow the steps below:
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 typescriptBefore 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.
Step-by-step guide on how to install the project and its dependencies.
- Clone the repository to your local machine using Git:
git clone https://github.com/ayofalo/my-news-app.git- Navigate to the project directory
cd my-news-app- Install the project dependencies using NPM(Node Package Manager):
npm install- Navigate to the directory of the react-frontend and express-backend as shown below and install corresponding dependencies
cd my-news-app/packages/react-frontendnpm installcd my-news-app/packages/express-backendnpm installOnce you have installed the dependencies, you can start the web application (Frontend and Backend concurrently) using
cd my-news-appnpm run start:bothOnce you have installed the dependencies, you can run test within the react-frontend and express-backend directory
- react-frontend
cd packagescd react-frontendnpm run testpress a to run all tests- run test express-backend
cd packages
cd express-backend
npm run testnavigate to the root directory
cd my-news-app
docker-compose up
To stop the containers
docker-compose stopAccess API documentation via Swagger UI using the link below after starting up the application
http://localhost:3001/api-docs/#/default/get_api_articles-
Accessing the homepage: Open your web browser and navigate to http://localhost:3000 to view the homepage.
-
Using the API: Refer to the Swagger API documentation at http://localhost:3001/api-docs for a detailed list of available endpoints and how to interact with them.
-
Troubleshooting If you encounter any issues or have questions, please feel free to reach out to us by creating an issue on our GitHub repository: https://github.com/ayofalo/my-news-app/issues.
This project is licensed under the MIT License.
Contributors names and contact info
Ayo Folami