kane50613 / github-as-a-blog

GaaB: Effortless blogging with GitHub issues and Next.js
https://gaab.yeecord.com/
GNU General Public License v3.0
9 stars 2 forks source link

GaaB: GitHub as a Blog #2

Open kane50613 opened 5 months ago

kane50613 commented 5 months ago

This project, developed as part of a Dcard internship assignment, aims to transform GitHub issues into blog posts for seamless content sharing and search engine optimization (SEO) improvement.

Deploy with Vercel

What problem does GaaB solve?

GitHub issues is good, but it's still not a perfect place for blogging. GaaB aims to solve the following problems:

SEO

The content in GitHub issues is not indexed by search engines always, which means that the content is not discoverable and hard to gain organic traffic.

By self-hosting the content with GaaB on your own domain, it can be more professional and SEO-friendly because we use Next.js to generate server-side rendered pages with low latency.

User Experience

GitHub issues is designed for issue tracking, with a lot of features that are not necessary for blogging. GaaB provides a clean and minimalistic interface for reading and writing blog posts.

Customization

The website is made with Next.js and shadcn/ui components, which means that you can easily customize the website by forking the repository and modifying the components.

Subscription

GaaB provides RSS feed through /api/rss.xml, users can subscribe to the blog and get notified when new posts are published.

Analytics

Tracking the performance of your blog is important. GaaB uses Vercel Analytics to provide insights into the traffic and performance of your blog.

You can simply enable Vercel Analytics by heading to the Vercel dashboard and enabling the Analytics feature under the settings of your project.

If you want to use other analytics service like Cloudflare Web Analytics, you can easily integrate it by yourself.

Security (Whitelisting)

Since the GitHub repository is public, anyone can create issues and comments. GaaB provides a whitelist feature to prevent spam and abuse.

By settings the WHITELISTED_AUTHORS environment variable in .env, separated by commas, only the authors in the whitelist can create issues and comments.

We also have XSS protection for the content, thanks to the react-markdown library, which automatically escapes the HTML in the content and not using dangerouslySetInnerHTML directly.

Ownership

By hosting the content on your own domain, you have full control over the page rendering.

We do not host any content, and the content is fetched from GitHub's API directly. This means that you can easily migrate to another platform without losing any content.

In the future, we may create a migration tool to help you migrate to another platform easily.

Local Development

To run the project locally, follow the steps below:

  1. Clone the repository:

    git clone git@github.com:kane50613/github-as-a-blog.git
  2. Install the dependencies:

    pnpm install
  3. Prepare the environment variables:

    cp .env.example .env

    Fill in the environment variables in .env with your GitHub OAuth App credentials, and a secret key for encrypting the session token.

  4. Run the development server:

    pnpm dev