Giter VIP home page Giter VIP logo

blog-master's Introduction

image

Blog Master

Introduction · Demo · Features · Project Structure · Installation · Tech Stack · Contact Me


Introduction

Blog Master is an application integrated with the GitHub API to allow you to view, create, edit, and close issues, effectively using GitHub issues as your own blogging platform. See Installation to get started right away.

Demo

Visit the website: https://blog-master-alpha.vercel.app/

Features

1. Easily Manage Your Issue: Sign in to GitHub with just one click, and effortlessly track your issues (blog posts) across your repositories.

2. Block-Based Text Editor: A familiar, Notion-style, rich text editor that enables you to create beautiful blog posts.

3. Search for Others’ Issues: Explore and discover issues posted by other users within the platform.

Project Structure

  1. Directory Structure

    .
    ├── app
    │   ├── [owner]
    │   │   ├── error.tsx
    │   │   ├── issue
    │   │   │   ├── [number]
    │   │   │   │   ├── edit
    │   │   │   │   │   └── page.tsx
    │   │   │   │   ├── loading.tsx
    │   │   │   │   └── page.tsx
    │   │   │   ├── loading.tsx
    │   │   │   ├── new
    │   │   │   │   ├── loading.tsx
    │   │   │   │   └── page.tsx
    │   │   │   └── page.tsx
    │   │   ├── layout.tsx
    │   │   └── page.tsx
    │   ├── api
    │   │   └── auth
    │   │       └── [...nextauth]
    │   │           └── route.ts
    │   ├── icon.ico
    │   ├── layout.tsx
    │   ├── opengraph-image.png
    │   ├── page.tsx
    │   └── robots.ts
    ├── components
    │   ├── <custom-component>.tsx
    │   └── ui
    │       └── <ui-component>.tsx
    ├── lib
    │   ├── auth.ts
    │   ├── context
    │   │   └── client-provider.tsx
    │   ├── github-api.ts
    │   ├── hooks
    │   │   └── useOwnerAndRepo.tsx
    │   ├── types
    │   │   ├── next-auth.d.ts
    │   │   └── types.ts
    │   └── utils.ts
    ├── public
    │   └── <photo>.png
    ├── styles
    │   └── <styles>.css
    ├── package.json
    └── README.md
  2. App Router

    / :

    • The welcome page that allows users to sign in with GitHub or search for other users. For signed-in users, this page will redirect them directly to their /[owner]/issue page.

    /[owner]/issue :

    • The left side displays information about the owner and all their repositories that are public and able to create issue. When users switch between different repositories, the currently viewed repository is stored in the path query, e.g. ?repo=reposirory-name. On the right side of the page, issues created under the current repository are listed. Initially, only ten issues are loaded, and when the page is scrolled to the bottom, an additional ten are loaded until no more issues are available.
    • When a user clicks on a issue from the list, they will be directed to the page of the issue at /[owner]/issue/[number], where the number corresponds to the issue's number.
    • For signed-in users, they can click the "Your Issues" button in the header to access their own page (the [owner] is themselves). In their own page, a "New Issue" button will appear, enabling users to create a new issue. Also, each listed issue will have a dots icon on the right side, allowing users to select options for editing or deleting the issue.

    /[owner]/issue/[number] :

    • The issue page, which converts the Markdown content fetched from the GitHub API and renders it.
    • Users can click the comments icon to see all comments related to the issue.
    • For signed-in users, there will be a dots icon, allowing users to select options for editing or deleting the issue.

    /[owner]/issue/[number]/edit :

    • The issue editing page requires users to input a title and a body with a minimum of 30 characters.
    • When the user clicks the 'Save' button, the body content will be converted into Markdown format and updated the respective issue via the GitHub API.

    /[owner]/issue/new :

    • The page to create a new issue which requires users to input a title and a body with a minimum of 30 characters.
    • When the user clicks the 'Save' button, the body content will be converted into Markdown format and then used to create a new issue via the GitHub API.
  3. The GitHub REST API that I used (Base URL: https://api.github.com)

    /users/{owner} (GET): Get publicly available information about the user

    /users/{owner}/repos (GET): Get all public repositories that can create issues for the user

    /repos/{owner}/{repo}/issues (GET): Get all open issues in a repository

    /repos/{owner}/{repo}/issues/{issue_number} (GET): Get an Issue

    /repos/{owner}/{repo}/issues/{issue_number}/comments (GET): Get all comments on an issue

    /repos/{owner}/{repo}/issues (POST): Create an issue

    /repos/{owner}/{repo}/issues/{issue_number} (PATCH): Update / Close an issue.

  4. For more technical details, check out "My Blog about Blog Master".

  5. Lighthouse Score

    image

Installation

1. Download Repo.

$ git clone https://github.com/pigbearhsien/blog-master.git
$ cd blog-master
$ npm install

2. Create .env.local file and set up the environment variables in the file.

$ cp .env.example .env
NEXTAUTH_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
  • To generate NEXTAUTH_SECRET, you can run openssl rand -base64 32 on the command line to quickly create a good value.
  • To get GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET, you can follow the instructions here to create an OAuth App.

3. Run npm run dev to start the development server.

4. Visit http://localhost:3000 to view your application.

Tech Stack

Blog Master is built on the following stack:

Contact Me

blog-master's People

Contributors

pigbearhsien avatar

Watchers

 avatar

blog-master's Issues

Test

test

testtesttesttesttesttesttesttesttesttest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.