my-news-app
所属分类:Docker
开发工具:TypeScript
文件大小:0KB
下载次数:0
上传日期:2023-08-04 11:52:35
上 传 者:
sh-1993
说明: 搜索新闻文章的简单应用程序
(A simple application to search news articles)
文件列表:
LICENSE (1064, 2023-07-27)
# My-News-App Project
## Table of Contents
- [Introduction](https://github.com/ayofalo/my-news-app/blob/master/#introduction)
- [Features](https://github.com/ayofalo/my-news-app/blob/master/#features)
- [Getting Started](https://github.com/ayofalo/my-news-app/blob/master/#getting-started)
- [Prerequisites](https://github.com/ayofalo/my-news-app/blob/master/#prerequisites)
- [Installation](https://github.com/ayofalo/my-news-app/blob/master/#installation)
- [Running the web application](https://github.com/ayofalo/my-news-app/blob/master/#running-the-web-application)
- [Running tests](https://github.com/ayofalo/my-news-app/blob/master/#running-test)
- [Running Docker](https://github.com/ayofalo/my-news-app/blob/master/#run-docker)
- [Rest API Documentation](https://github.com/ayofalo/my-news-app/blob/master/#api-documentation)
- [Usage](https://github.com/ayofalo/my-news-app/blob/master/#usage)
- [Contributing](https://github.com/ayofalo/my-news-app/blob/master/#contributing)
- [License](https://github.com/ayofalo/my-news-app/blob/master/#license)
## 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:
```bash
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:
```bash
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:
```bash
git clone https://github.com/ayofalo/my-news-app.git
```
2. Navigate to the project directory
```bash
cd my-news-app
```
3. Install the project dependencies using NPM(Node Package Manager):
```bash
npm install
```
4. Navigate to the directory of the react-frontend and express-backend as shown below and install corresponding dependencies
```bash
cd my-news-app/packages/react-frontend
```
```bash
npm install
```
```bash
cd my-news-app/packages/express-backend
```
```bash
npm install
```
### Running the web application
Once you have installed the dependencies, you can start the web application (Frontend and Backend concurrently) using
```bash
cd my-news-app
```
```bash
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
```bash
cd packages
```
```bash
cd react-frontend
```
```bash
npm run test
```
```bash
press a to run all tests
```
- run test express-backend
```bash
cd packages
cd express-backend
npm run test
```
### Run docker
navigate to the root directory
```bash
cd my-news-app
docker-compose up
```
To stop the containers
```bash
docker-compose stop
```
### API documentation
Access API documentation via Swagger UI using the link below after starting up the application
```bash
http://localhost:3001/api-docs/#/default/get_api_articles
```
### Usage
- 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.
### License
This project is licensed under the MIT License.
### Authors
Contributors names and contact info
Ayo Folami
近期下载者:
相关文件:
收藏者: