An open API service indexing awesome lists of open source software.

https://github.com/pace11/readable

Simple News APP with integration using NYT (New York Times) API
https://github.com/pace11/readable

Last synced: 5 months ago
JSON representation

Simple News APP with integration using NYT (New York Times) API

Awesome Lists containing this project

README

          

πŸ“– READable


Simple News APP with integration using NYT (New York Times) API











## πŸ•ΈοΈ Stack

- Reactjs + Typescript βœ…
- Shadcn (UI Library) βœ…
- Bun βœ…
- Vite βœ…
- Zustand (Store Management) βœ…
- Tanstack Query (Client Data Fetching) βœ…
- Tanstack Router (Filesystem Routing) βœ…
- Github Actions and Docker (Deployment, Infra) βœ…

## ✏️ Script

| Script Name | Description | Command |
| ----------------- | ---------------------------- | ------------------------- |
| `dev` | Start development server | `bun run dev` |
| `generate-routes` | Generate tanstack routes gen | `bun run generate-routes` |
| `build` | Build for production | `bun run build` |
| `preview` | Preview production build | `bun run preview` |
| `lint` | Lint codebase | `bun run lint` |

## 🌟 Features

- Keyword-based search functionality implemented βœ…
- Suggestions appear while typing, sourced from extracted keywords in the API response βœ…
- Users can bookmark articles, stored locally on browser using Zustand βœ…

## ▢️ How to run

- Clone this repository
- Makesure you already install bun on globally
- Install dependency first with `bun install`
- Run development mode with `bun run dev`

## πŸš€ How to deploy

- Branching Strategy with Git Flow
- First, Create new branch with prefix `feature_*` example `feature_bookmark`
- Open Pull Request and target merging branch is `master`
- Put the title and description and then please wait until finished reviewing
- Reviewing is finished, Merging `_feature_*` branch into `master` and deployment flow is ready to go πŸƒ
- Flow Deployment πŸ‘‡πŸ‘‡πŸ‘‡

1. Trigger GitHub Actions when push branch `master`

```yaml
on:
push:
branches:
- master
```

2. Setup Docker Buildx, Login Docker Hub, Build and Push to Docker Hub

```yaml
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and Push to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/readable-app:latest
build-args: |
VITE_NEWS_API_URL=${{ secrets.VITE_NEWS_API_URL }}
VITE_NEWS_API_KEY=${{ secrets.VITE_NEWS_API_KEY }}
```

3. SSH to Production Server and Pull Latest Changes

```yaml
steps:
- name: SSH to Production Server and Pull Latest Changes
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd pace-app-neo
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/readable-app:latest
sudo docker compose up -d readable-app
```