Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cletqui/petithub
Find obscure GitHub repositories π
https://github.com/cletqui/petithub
cloudflare-pages github hono honojs octokit petittube random repository
Last synced: about 1 month ago
JSON representation
Find obscure GitHub repositories π
- Host: GitHub
- URL: https://github.com/cletqui/petithub
- Owner: cletqui
- License: mit
- Created: 2024-06-05T20:37:42.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-29T07:59:19.000Z (about 2 months ago)
- Last Synced: 2024-11-02T14:33:55.207Z (about 2 months ago)
- Topics: cloudflare-pages, github, hono, honojs, octokit, petittube, random, repository
- Language: TypeScript
- Homepage: https://petithub.pages.dev/
- Size: 750 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PetitHub π
Explore the hidden gems of GitHub with [PetitHub](https://github.com/cletqui/petithub/)!
This project is an adaptation of the [Petit Tube](https://en.wikipedia.org/wiki/Petit_Tube) concept to GitHub: it allows users to discover random, obscure GitHub repositories that have no stars. Whether you're looking to find an undiscovered masterpiece or just satisfy your curiosity, PetitHub is here to take you on a journey through the lesser-known corners of GitHub.
![PetitHub Screenshot](.github/screenshot.png)
## Links π
- Cloudflare: [petithub.pages.dev](https://petithub.pages.dev/)
- GItHub: (coming soon) β³
[![pages-build-deployment](https://github.com/cletqui/petithub/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/cletqui/petithub/actions/workflows/pages/pages-build-deployment)## Table of Contents π
- [PetitHub π](#petithub-)
- [Links π](#links-)
- [Table of Contents π](#table-of-contents-)
- [Features β¨](#features-)
- [How It Works π](#how-it-works-)
- [Endpoints π](#endpoints-)
- [Main Page](#main-page)
- [Custom API](#custom-api)
- [Getting Started π](#getting-started-)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Using the App](#using-the-app)
- [Authentication π](#authentication-)
- [Technologies Used π οΈ](#technologies-used-οΈ)
- [Contributing π€](#contributing-)
- [License π](#license-)
- [Contact π§](#contact-)
- [Acknowledgements π](#acknowledgements-)
- [Support β](#support-)
- [Roadmap πΊοΈ](#roadmap-οΈ)
- [TODO](#todo)
- [Done](#done)## Features β¨
- π² **Random Repository Discovery**: Explore random GitHub repositories that have zero stars.
- π¨ **Custom Repository Display**: View repository information (name, author, language, stars, watchers, forks...) in a fully integrated custom display.
- π **Quick Access**: Easily navigate to the GitHub page of any displayed repository.
- π€ **Enhanced Browsing with Authentication**: Connect your GitHub account to remove rate limits and access additional features like starring repositories.
- π§ **Custom API**: Search for niche repositories by name or ID using the integrated API.
- π **Fast and Fun Interface**: Built with the [Hono](https://hono.dev/) framework for a smooth and enjoyable user experience.## How It Works π
PetitHub uses the Octokit package to interact with the GitHub API. It browses the public repositories looking for unique, not starred repositories. You can use the app without a GitHub account, but signing in with [GitHub App](https://github.com/apps/cletqui-petithub) provides a more seamless experience without rate limiting and unlocks extra features.
PetitHub is built with [Hono](https://hono.dev/) over a Vite server for a fast user and easy developer experience. It fully integrates most of the features from Hono.
## Endpoints π
### Main Page
The main page displays a random GitHub repository with all its relevant details. You can quickly star the repository or visit its GitHub page.
### Custom API
- **Browse by Name or ID**: Look up repositories by their name or ID using our custom API endpoints.
- **Recent Repository ID**: Retrieve the ID of the most recently created repository on GitHub.## Getting Started π
### Prerequisites
- Node.js
- npm### Installation
1. Clone the repository:
```sh
git clone https://github.com/cletqui/petithub.git
cd petithub
```2. Install dependencies:
```sh
npm install
```3. Start the development server:
```sh
npm run dev
```### Using the App
Open your browser and navigate to `http://localhost:5173` to start exploring obscure GitHub repositories.
## Authentication π
For an enhanced experience, connect your GitHub account. This will allow you to bypass rate limits and access special features like starring repositories directly from PetitHub.
## Technologies Used π οΈ
- **Hono JS Framework**: For a fast and clean frontend experience.
- **Octokit**: To interact with the GitHub API.
- **Node.js**: Backend runtime environment.
- **Vite**: Server framework.## Contributing π€
Contributions are welcome! Feel free to open an issue or submit a pull request.
1. Fork the repository.
2. Create your feature branch:```sh
git checkout -b feature/AmazingFeature
```3. Commit your changes:
```sh
git commit -m 'Add some AmazingFeature'
```4. Push to the branch:
```sh
git push origin feature/AmazingFeature
```5. Open a pull request.
## License π
Distributed under the MIT License. See `LICENSE` for more information.
## Contact π§
X / Twitter - [@cletqui](https://twitter.com/cletqui)
Project Link: [https://github.com/cletqui/petithub](https://github.com/cletqui/petithub)
## Acknowledgements π
- Inspired by Petit Tube.
- Thanks to the developers of Octokit and Hono JS.## Support β
If you like this project, you can support me by buying my next coffee on [BuyMeACoffee](https://www.buymeacoffee.com/cletqui).
Happy exploring! π
---
## Roadmap πΊοΈ
### TODO
- [ ] Improve GUI
- [x] add additional info about the repo
- [x] implement dark/light themes
- [x] mimic GitHub layout
- [x] set page title as `full_name` & use GitHub link in header like GitHub page
- [x] cache svg imports
- [x] add reload button
- [x] fix header hidden on small screens
- [ ] add colors for languages
- [ ] refactor code wit [shadcn](https://ui.shadcn.com/) UI
- [x] fix cookie storage/deletion (and interferences with GUI)
- [x] change the document title dynamically (with nested `Suspense`)
- [x] use nested renderer to render multiple components
- [x] use `useRequestContext` to have conditional render
- [x] implement Swagger with API
- [x] add profile name + icon when connected + fix UI
- [x] add possibility to logout
- [ ] allow starring repo when connected
- [ ] Handle Octokit errors (401 & 403)
- [ ] Define unit tests
- [x] Fix interfaces and type definitions
- [ ] Setup GitHub Actions
- [ ] to deploy the website to GitHub
- [x] to run tests automatically
- [x] fix GitHub security detection on `tests` files
- [ ] Make sure the project is compatible with multiple deployment types
- [x] Cloudflare
- [ ] GitHub
- [ ] Heroku
- [ ] Refactor saving `access_token` in c.var and access it through `octokit.auth` instead
- [ ] Sanitize all strings into `${string}`### Done
- [x] Write `README.md`
- [x] Write GitHub App description
- [x] fix API by adding 404 not found if no repo by id is found
- [x] Add icons in footer
- [x] Find `MAX_ID` dynamically and store in Cookies
- [x] Require GitHub API (Bearer Auth) for `/api/*` requests
- [x] Display Template
- [x] Refactor code into smaller modules
- [x] Setup GitHub App
- [x] fix oauth workflow
- [x] define default demo/GitHub choice page
- [x] error handling when `access_token` is not defined (go back to authentication or use default token)
- [x] validate the token used before using them
- [x] fix `access_token`/`refresh_token` cookie storage issue
- [x] optimize performance
- [x] change GitHub App icon
- [x] handle `state` verification
- [x] handle `access_token` refresh with `refresh_token`
- [x] Use middlewares
- [x] to declare the octokit instance
- [x] to add auth header if access_token is valid (to allow API use when `access_token` is defined)