Installation
This guide will help you install and run GitScope locally for development or customization.Prerequisites
Before you begin, ensure you have the following installed on your system:Node.js
Version 18 or higherDownload from nodejs.org
npm
Version 9 or higherIncluded with Node.js installation
Check your versions with:
Installation steps
Clone the repository
Clone GitScope from GitHub to your local machine:This downloads the complete source code including all components, hooks, and configuration files.
Install dependencies
Install all required npm packages:This installs the following key dependencies from
package.json:Core dependencies:react@^18.2.0— UI frameworkreact-dom@^18.2.0— React DOM rendererrecharts@^2.10.3— Chart library for language visualizationlucide-react@^0.263.1— Icon library
vite@^5.0.8— Build tool and dev server@vitejs/plugin-react@^4.2.1— Vite React plugin@types/react@^18.2.43— TypeScript types for Reactgh-pages@^6.1.1— GitHub Pages deployment tool
Start the development server
Launch the Vite development server:You should see output like:
The dev server includes Hot Module Replacement (HMR) — changes to your code will update instantly without a full page reload.
Open in your browser
Navigate to the local URL:http://localhost:5173You should see the GitScope search interface. The app is now running locally!
Available npm scripts
GitScope includes four npm scripts defined inpackage.json:7-12:
Script details
| Script | Command | Purpose |
|---|---|---|
dev | vite | Starts development server at localhost:5173 with HMR |
build | vite build | Creates production build in /dist directory |
preview | vite preview | Serves production build locally for testing |
deploy | npm run build && gh-pages -d dist | Builds and deploys to GitHub Pages |
Development workflow
During development:Project structure
After installation, your project directory will look like this:Key files to explore
useGitHub.js
src/hooks/useGitHub.jsAll GitHub API communication logic, token management, and rate limit tracking.App.jsx
src/App.jsxRoot component that orchestrates state management and component composition.vite.config.js
vite.config.jsVite configuration including base path for GitHub Pages deployment.index.css
src/index.cssGlobal CSS variables for theming, animations, and utility classes.Configuration
Vite configuration
Thevite.config.js file contains minimal configuration:
plugins: [react()]— Enables React Fast Refresh and JSX supportbase: '/github-dashboard/'— Sets base path for GitHub Pages deployment
If deploying to a different URL, update the
base field to match your hosting path. For root-level hosting, use base: '/'.Environment variables
GitScope doesn’t require environment variables. The GitHub API token is managed through the UI and stored in the browser’slocalStorage.
However, if you want to add environment variables for development:
- Create a
.env.localfile in the project root - Add variables prefixed with
VITE_: - Access in code:
Development tips
Hot Module Replacement
Vite’s HMR updates your app instantly when you save changes:- Component changes — Preserves component state
- CSS changes — Updates styles without reload
- Hook changes — Triggers re-render with new logic
CSS Modules
All component styles use CSS Modules for scoped styling:Theme variables
Customize theme colors insrc/index.css:
Troubleshooting
Port already in use
If port 5173 is already in use, Vite will automatically try the next available port (5174, 5175, etc.). To specify a custom port:Module not found errors
If you see module import errors:- Delete
node_modulesandpackage-lock.json - Run
npm installagain - Restart the dev server
Build failures
Ifnpm run build fails:
- Check for TypeScript errors in the console
- Ensure all imports are correct (file extensions, paths)
- Verify no unused variables or missing dependencies
Next steps
Quickstart guide
Learn how to use GitScope to analyze profiles
Architecture
Deep dive into GitScope’s technical architecture
GitHub API
Explore GitHub API endpoints and hook functions
Configuration
Set up your GitHub token and customize settings