Simple News APP with integration using NYT (New York Times) API
- 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 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 |
- 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 ✅
- Clone this repository
- Makesure you already install bun on globally
- Install dependency first with
bun install
- Run development mode with
bun run dev
- Branching Strategy with Git Flow
- First, Create new branch with prefix
feature_*
examplefeature_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 intomaster
and deployment flow is ready to go 🏃 - Flow Deployment 👇👇👇
- Trigger GitHub Actions when push branch
master
on:
push:
branches:
- master
- Setup Docker Buildx, Login Docker Hub, Build and Push to Docker Hub
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 }}
- SSH to Production Server and Pull Latest Changes
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