Skip to content

tharindu899/portfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitHub Work Gallery banner

✨ Tharindu Work Gallery

🌐 A modern GitHub portfolio gallery with live repositories, GitHub-style README previews, automatic repo categories, matching SVG preview covers, and online-only PWA install support.

React Vite GitHub Pages PWA

Version No cache Mobile first License


🧭 What is this?

Tharindu Work Gallery is a clean React + Vite portfolio project that loads public GitHub repositories and presents them in a beautiful command-center style UI.

It is built for:

  • πŸ§‘β€πŸ’» Developer portfolios with real GitHub repos
  • πŸ“¦ Project galleries with repo details and README previews
  • 🧠 Automatic categories and icons from repo name, language, topics, and description
  • πŸ–ΌοΈ Automatic SVG project preview covers when screenshots are missing
  • πŸ“± Installable PWA that stays fully online and avoids stale cache problems
  • πŸš€ GitHub Pages deployment with a ready workflow

✨ Main features

Feature Status Details
🧭 Modern portfolio UI βœ… Ready Sticky top navigation, hero, timeline projects, smooth mobile layout
πŸ”΄ Live GitHub repo loading βœ… Ready Loads selected repos or all public repos from your GitHub profile
🧠 Auto category detection βœ… Ready Finance, Android, Web, Automation, Media, Tools
🎯 Auto icon detection βœ… Ready Wallet, piggy, film, terminal, React, Android, pen, book, and more
πŸ“˜ GitHub-style README preview βœ… Ready GitHub-like fonts, headings, code blocks, tables, links, and dark mode
πŸ–ΌοΈ Automatic repo preview SVG βœ… Ready Matching preview cover for every repo details page
πŸ“± Online-only PWA βœ… Ready Installable app, network-only service worker, no stale app cache
πŸŒ— Theme toggle βœ… Ready Day/dark theme with matching UI colors
πŸ“² Mobile-first layout βœ… Ready Works cleanly on phone screens and desktop screens
πŸš€ GitHub Pages workflow βœ… Ready .github/workflows/pages.yml deploys the built site

πŸš€ Quick start

corepack enable
corepack prepare pnpm@9.15.4 --activate
pnpm install
pnpm dev

Open the local URL from Vite, then edit the config files below.


βš™οΈ Main setup files

File Purpose
πŸ§‘β€πŸ’Ό src/config/site.config.js Profile info, contact links, GitHub username, category list, UI options
πŸ“¦ src/config/projects.config.js Selected repo links, manual overrides, custom photos, tags, notes, status
🌐 public/manifest.webmanifest PWA name, icons, theme color, shortcuts
πŸ“‘ public/sw.js Online-only service worker with no precache
πŸ–ΌοΈ src/utils/repoPreview.js Automatic matching SVG preview generator
πŸ“˜ src/components/ReadmeViewer.jsx GitHub-like README preview renderer

πŸ”— GitHub repo loading methods

🟒 Method 1 β€” load all public repos from one account

Edit src/config/site.config.js:

githubUsername: 'tharindu899'

A full profile link also works:

githubUsername: 'https://github.com/tharindu899'

🟣 Method 2 β€” show only selected repo links

Edit src/config/projects.config.js:

export const repositoryLinks = [
  'https://github.com/tharindu899/CashNest_X',
  'tharindu899/Inkwell',
  {
    url: 'https://github.com/tharindu899/MyRepo',
    featured: true,
    photo: 'images/projects/my-repo.png'
  }
];

When repositoryLinks has items, the app loads only those exact repos. When it is empty, the app loads all public repos from githubUsername.


πŸ“Œ Home pinned item limit

βœ… Latest: pinned badges now show on both Home and Projects page, but Home is still limited to 3 pinned items.

The home page now shows only pinned project items, capped to 3, and only 3 focus/method cards.

The Projects page is not limited. It keeps the normal full repo list, and pinned repos show a Pinned badge there too.

Edit src/config/site.config.js when you want to change the Home limit:

ui: {
  pinnedProjectLimit: 3,
  workItemLimit: 3
}

Project page still shows all repos. Repos with featured: true also show the Pinned badge on the Projects page.

βœ… Pin CashNest X correctly

GitHub repo names use the real repo slug, not only the display title. For CashNest X, use CashNest_X in projectOverrides:

export const projectOverrides = {
  CashNest_X: {
    title: 'CashNest X',
    aliases: ['CashNest', 'CashNest X', 'cashnest-x'],
    featured: true,
    category: 'finance',
    icon: 'piggy'
  }
};

The app now also matches override title and aliases, so CashNest X, CashNest_X, and cashnest-x can all point to the same repo.

🧠 Automatic categories and icons

The app checks repo name, owner, description, topics, language, and homepage to choose the best category and icon.

Category Emoji Detected from
Finance πŸ’° cash, money, budget, salary, expense, loan, bank, wallet
Media 🎬 movie, film, cinema, stream, video, TMDb, Telegram, anime
Android πŸ€– Android, APK, AAB, Kotlin, Java, Capacitor, Cordova, Compose
Web 🌐 React, Vite, website, portfolio, dashboard, PWA, HTML, CSS
Automation ⚑ GitHub Actions, workflow, script, deploy, Termux, Docker, bot
Tools 🧰 Default fallback when nothing else matches

Need a custom result? Use projectOverrides.

export const projectOverrides = {
  CashNest_X: {
    title: 'CashNest X',
    category: 'finance',
    featured: true,
    icon: 'piggy',
    photo: 'images/projects/cashnest-x.png',
    shortNote: 'Mobile-first personal finance tracker.',
    tags: ['React', 'Capacitor', 'Finance'],
    status: 'Active'
  }
};

πŸ–ΌοΈ Preview image method

βœ… Automatic SVG preview

Every project details page gets a generated SVG preview when no screenshot is set.

The SVG preview includes:

  • 🏷️ Repo title
  • πŸ‘€ Owner/repo name
  • 🧭 Category
  • πŸ’» Main language
  • ⭐ Stars
  • 🍴 Forks
  • 🚦 Status
  • 🧩 Tags

βœ… Custom screenshots

Put images here:

public/images/projects/my-project.png
public/images/projects/gallery/my-project-screen-1.png

Then set:

MyRepoName: {
  photo: 'images/projects/my-project.png',
  photos: [
    'images/projects/my-project.png',
    'images/projects/gallery/my-project-screen-1.png'
  ]
}

πŸ“± Online-only PWA method

This app is installable as a PWA, but it intentionally does not keep old cached app files.

  • βœ… Install support through manifest.webmanifest
  • βœ… Service worker registration through src/pwa/registerOnlineOnlyPwa.js
  • βœ… Network-only fetch in public/sw.js
  • βœ… Same-origin app files handled by the service worker
  • βœ… External GitHub API, raw README files, avatars, and badges bypass the service worker
  • βœ… No precache list
  • βœ… No stale UI after updates
  • βœ… Offline message instead of old cached pages

This is useful for GitHub Pages projects where you want every visit to load the latest deployed build while live GitHub repo data still loads correctly.


🧾 Full project structure

πŸ“ Click to show every file with emoji labels
πŸ“¦ github-work-gallery-pwa/
β”œβ”€β”€ 🧬 .github/
β”‚   └── βš™οΈ workflows/
β”‚       └── πŸš€ pages.yml
β”œβ”€β”€ πŸ“š docs/
β”‚   β”œβ”€β”€ πŸ“˜ CHANGELOG.md
β”‚   β”œβ”€β”€ πŸ“˜ CONFIGURATION.md
β”‚   β”œβ”€β”€ πŸ“˜ DEPLOY_GITHUB_PAGES.md
β”‚   β”œβ”€β”€ πŸ“˜ FULL_GUIDE.md
β”‚   β”œβ”€β”€ πŸ“˜ PROJECT_STRUCTURE.md
β”‚   β”œβ”€β”€ πŸ“˜ PWA_ONLINE_ONLY.md
β”‚   └── πŸ“˜ REPO_PREVIEWS.md
β”œβ”€β”€ 🌐 public/
β”‚   β”œβ”€β”€ 🎨 icons/
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ app-icon.svg
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ apple-touch-icon.png
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ favicon-48.png
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ pwa-icon-192.png
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ pwa-icon-512.png
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ pwa-maskable-192.png
β”‚   β”‚   └── πŸ–ΌοΈ pwa-maskable-512.png
β”‚   β”œβ”€β”€ πŸ–ΌοΈ images/
β”‚   β”‚   β”œβ”€β”€ πŸ§‘β€πŸ’Ό profile/
β”‚   β”‚   β”‚   └── πŸ–ΌοΈ profile.svg
β”‚   β”‚   β”œβ”€β”€ πŸ“¦ projects/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ gallery/
β”‚   β”‚   β”‚   └── πŸ–ΌοΈ project-placeholder.svg
β”‚   β”‚   └── πŸ“˜ readme/
β”‚   β”‚       └── πŸ–ΌοΈ top-banner.svg
β”‚   β”œβ”€β”€ πŸ“± manifest.webmanifest
β”‚   └── 🟨 sw.js
β”œβ”€β”€ 🧠 src/
β”‚   β”œβ”€β”€ 🧩 components/
β”‚   β”‚   β”œβ”€β”€ 🎨 icons/
β”‚   β”‚   β”‚   └── βš›οΈ Icon.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ CategoryFilter.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ Header.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ Hero.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ IconButton.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ Layout.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ ProfileSidebar.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ ProjectModal.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ ProjectTimeline.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ PwaInstallButton.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ ReadmeViewer.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ SearchBox.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ SectionHeader.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ StatStrip.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ ThemeToggle.jsx
β”‚   β”‚   └── βš›οΈ WorkTiles.jsx
β”‚   β”œβ”€β”€ βš™οΈ config/
β”‚   β”‚   β”œβ”€β”€ 🟨 projects.config.js
β”‚   β”‚   └── 🟨 site.config.js
β”‚   β”œβ”€β”€ πŸͺ hooks/
β”‚   β”‚   β”œβ”€β”€ 🟨 useGithubRepos.js
β”‚   β”‚   └── 🟨 useHashRoute.js
β”‚   β”œβ”€β”€ πŸ“„ pages/
β”‚   β”‚   β”œβ”€β”€ βš›οΈ Contact.jsx
β”‚   β”‚   β”œβ”€β”€ βš›οΈ Home.jsx
β”‚   β”‚   └── βš›οΈ Projects.jsx
β”‚   β”œβ”€β”€ πŸ“± pwa/
β”‚   β”‚   β”œβ”€β”€ 🟨 registerOnlineOnlyPwa.js
β”‚   β”‚   └── 🟨 usePwaInstallPrompt.js
β”‚   β”œβ”€β”€ 🎨 styles/
β”‚   β”‚   └── 🎨 index.css
β”‚   β”œβ”€β”€ 🧰 utils/
β”‚   β”‚   β”œβ”€β”€ 🟨 format.js
β”‚   β”‚   β”œβ”€β”€ 🟨 github.js
β”‚   β”‚   └── 🟨 repoPreview.js
β”‚   β”œβ”€β”€ βš›οΈ App.jsx
β”‚   └── βš›οΈ main.jsx
β”œβ”€β”€ πŸ“¦ .npmrc
β”œβ”€β”€ 🌐 index.html
β”œβ”€β”€ πŸ”§ package.json
β”œβ”€β”€ πŸ“˜ README.md
└── 🟨 vite.config.js

πŸ“š Full documentation

Guide What it explains
πŸ“˜ docs/FULL_GUIDE.md Complete A-Z setup, edit, run, build, deploy, and customize guide
πŸ—‚οΈ docs/PROJECT_STRUCTURE.md Full emoji file tree and explanation for every important folder
βš™οΈ docs/CONFIGURATION.md Profile, links, categories, repo links, overrides, screenshots
πŸ“± docs/PWA_ONLINE_ONLY.md Online-only PWA method, icons, no-cache behavior, install notes
πŸ–ΌοΈ docs/REPO_PREVIEWS.md Automatic SVG previews and custom screenshot method
πŸš€ docs/DEPLOY_GITHUB_PAGES.md GitHub Pages deployment with Actions workflow
πŸ“ docs/CHANGELOG.md Project update notes and release history

πŸ› οΈ Commands

# 🧩 Install dependencies
pnpm install

# πŸ”₯ Start local development
pnpm dev

# πŸ—οΈ Build production files
pnpm build

# πŸ‘€ Preview production build
pnpm preview

πŸš€ Deploy to GitHub Pages

  1. πŸ“€ Push this project to a public GitHub repo.
  2. βš™οΈ Go to Settings β†’ Pages.
  3. πŸ§ͺ Set Build and deployment to GitHub Actions.
  4. 🌿 Push to main or master.
  5. βœ… The workflow builds and deploys the website.

🧩 Tech stack

React Vite Markdown GitHub PWA


πŸ§‘β€πŸ’» Author

Tharindu Prabath
πŸ“ Sri Lanka
🌐 GitHub: tharindu899
πŸ“§ Email: prabath99t@gmail.com


βœ… Latest update

  • πŸ› οΈ Fixed live GitHub repo loading in the online-only PWA
  • πŸ“‘ Service worker now bypasses external GitHub API/README/avatar/badge requests
  • πŸ” Added safer GitHub fetch handling with no-store live requests
  • 🧩 If the full GitHub profile list is blocked, configured/override repos are checked one by one first
  • πŸ“Œ Pinned project logic stays the same: Home shows pinned max 3, Projects shows all repos with badges
./push.sh "fix live github repo loading; update online pwa api bypass; improve configured repo fallback"

πŸ› οΈ Live GitHub Repo Loading Fix

This app now uses a stronger online loader:

  1. 🌐 GitHub user repos API
  2. πŸ”Ž GitHub search API fallback
  3. πŸͺž mirror metadata fallback
  4. πŸ“Œ configured repo links / project overrides as the final safe fallback

If your browser was already using an old installed PWA cache, open the site once and hard refresh. On Android Chrome, use Site settings β†’ Storage β†’ Clear & reset if the old page still appears. The new service worker is online-only and clears old caches automatically after it loads.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors