GitHub Repo Explorer is a web application that allows users to explore GitHub repositories directly from their browser. It supports authentication for private repositories, displays repository details, and enables copying folder-file structures for documentation purposes.
- Sign In with GitHub: Access private repositories using GitHub authentication.
- Repository Details: View information such as stars, watchers, branches, primary language, creation and update dates, and visibility (public/private).
- Copy File Structure: Easily copy the folder-file structure of a repository for documentation or reference.
- Theme Toggle: Switch between light and dark themes.
- Frontend: React + TypeScript
- Styling: Tailwind CSS
- Authentication: NextAuth.js with GitHub OAuth
- Node.js and npm installed
- GitHub account with developer access
- GitHub OAuth application set up
git clone https://github.com/subh05sus/gh-explore.git
cd gh-explore
npm install
Create a .env
file in the root directory and add the following environment variables:
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-generated-secret-paste-it-here
GITHUB_ID=your-github-client-id
GITHUB_SECRET=your-github-client-secret
You can generate a secure secret key using one of the following commands:
-
Using OpenSSL:
openssl rand -base64 32
-
Using Node.js:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
- Go to GitHub and sign in to your account.
- Click on your profile picture in the top-right corner and select "Settings" from the dropdown menu.
- Scroll down the left sidebar and click on "Developer settings" near the bottom.
- In the left sidebar of the Developer settings, click on "OAuth Apps".
- Click the "New OAuth App" button.
- Fill out the form with the following information:
- Application name: Choose a name for your app (e.g., "GitHub Repo Explorer")
- Homepage URL: Enter your application's homepage URL (e.g., http://localhost:3000 for local development)
- Application description: (Optional) Provide a brief description of your app
- Authorization callback URL: This should be your app's callback URL (e.g., http://localhost:3000/api/auth/callback/github for local development)
- Click "Register application".
- On the next page, you'll see your new OAuth App's details. The "Client ID" field contains your GITHUB_ID.
- Click "Generate a new client secret" to create your GITHUB_SECRET.
Run the development server:
npm run dev
The application will be available at http://localhost:3000.
- Navigate to the application in your browser.
- Sign in with your GitHub account to explore your private repositories else you can only explore any public repository.
- Select a repository to view details and copy its file structure.
- Toggle between light and dark themes for a better user experience.
This project does not currently specify a license.
Contributions are welcome! Feel free to open issues or submit pull requests.
Created by Subhadip Saha.
If you have any questions or feedback, feel free to reach out!