A comprehensive code analysis dashboard built with React, TypeScript, and Vite for analyzing repository code metrics, findings, and analysis runs.
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- Development
- Testing
- Building
- Deployment
- Project Structure
- Contributing
- License
- Repository Dashboard: View and manage code repositories
- Analysis Runs: Track and monitor code analysis executions
- Findings Management: Display and filter code findings by severity
- Real-time Updates: Live data synchronization with Supabase
- Responsive Design: Mobile-friendly interface with modern UI
- Type-Safe: Full TypeScript support with strict type checking
- Testing: Comprehensive unit and integration tests with Vitest
Before you begin, ensure you have the following installed:
- Node.js: >= 18.0.0 (Download)
- npm: >= 9.0.0 (comes with Node.js)
- Git: For version control
Verify your installations:
node --version # Should output v18.0.0 or higher
npm --version # Should output 9.0.0 or higher
git --version # Should output git versiongit clone https://github.com/stomde/Adm.git
cd Admnpm installThis will install all dependencies listed in package.json.
Create a .env.local file in the root directory by copying the template:
cp .env.example .env.localEdit .env.local and add your configuration values:
# Supabase Configuration
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key_here
# API Configuration
VITE_API_BASE_URL=http://localhost:3000
# Optional: Feature Flags
VITE_ENABLE_DEBUG_MODE=false
VITE_MAX_RETRIES=3.env.local to version control. It's already in .gitignore.
The project uses strict TypeScript settings. Configuration files:
tsconfig.json- Main TypeScript configurationtsconfig.node.json- Configuration for Node.js tools
Key TypeScript settings:
strict: true- Enables all strict type checking optionsnoUnusedLocals: true- Errors on unused local variablesnoUnusedParameters: true- Errors on unused parametersnoFallthroughCasesInSwitch: true- Ensures switch statements are exhaustive
The project includes pre-configured tools for code quality:
- ESLint (
.eslintrc.json) - Static code analysis - Prettier (
.prettierrc) - Code formatting - EditorConfig (
.editorconfig) - Consistent editor settings
Start the development server with hot module replacement:
npm run devThe application will be available at http://localhost:5173
Open your browser and navigate to:
http://localhost:5173
The dashboard will load repositories from your Supabase backend.
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Lint code and fix issues
npm run lint
# Check linting without fixing
npm run lint:check
# Format code with Prettier
npm run format
# Check formatting
npm run format:check
# Type checking
npm run type-check
# Run tests
npm run test
# Run tests with UI
npm run test:ui
# Generate test coverage
npm run test:coverageAdm/
βββ .github/
β βββ workflows/
β β βββ lint.yml # Linting workflow
β β βββ test.yml # Testing workflow
β β βββ build.yml # Build verification workflow
β βββ ISSUE_TEMPLATE/ # GitHub issue templates
βββ src/
β βββ components/ # React components
β β βββ AddRepositoryModal.tsx
β β βββ AnalysisRunsList.tsx
β β βββ FindingsList.tsx
β β βββ RepositoryCard.tsx
β β βββ ErrorBoundary.tsx
β βββ hooks/ # Custom React hooks
β β βββ useApi.ts
β βββ lib/ # Utility functions
β β βββ supabase.ts
β βββ pages/ # Page components
β β βββ Dashboard.tsx
β β βββ RepositoryDetail.tsx
β βββ types/ # Shared TypeScript types
β β βββ index.ts
β βββ App.tsx
β βββ App.css
β βββ index.css
β βββ main.tsx
βββ .editorconfig # Editor configuration
βββ .env.example # Environment template
βββ .eslintrc.json # ESLint configuration
βββ .gitignore # Git ignore rules
βββ .prettierrc # Prettier configuration
βββ package.json # Project dependencies
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
βββ README.md # This file
When creating new components, follow this structure:
// src/components/MyComponent.tsx
import { FC, ReactNode } from 'react'
import './MyComponent.css'
interface MyComponentProps {
title: string
children?: ReactNode
}
const MyComponent: FC<MyComponentProps> = ({ title, children }) => {
return (
<div className="my-component">
<h1>{title}</h1>
{children}
</div>
)
}
export default MyComponent# Run all tests
npm run test
# Run tests in watch mode
npm run test
# Run tests with UI
npm run test:ui
# Generate coverage report
npm run test:coverageTests should be placed alongside their components:
// src/components/MyComponent.test.tsx
import { render, screen } from '@testing-library/react'
import MyComponent from './MyComponent'
describe('MyComponent', () => {
it('renders with title', () => {
render(<MyComponent title="Test" />)
expect(screen.getByText('Test')).toBeInTheDocument()
})
})Create an optimized production build:
npm run buildOutput will be generated in the dist/ directory.
Preview the production build locally:
npm run previewThen open http://localhost:4173 in your browser.
- Connect your GitHub repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy with a single click
# Or use Vercel CLI
npm install -g vercel
vercel- Connect your GitHub repository to Netlify
- Set build command:
npm run build - Set publish directory:
dist - Configure environment variables
- Deploy
- Add to
vite.config.ts:
export default defineConfig({
base: '/Adm/',
// ... rest of config
})- Build and deploy
| File | Purpose |
|---|---|
src/types/index.ts |
Shared TypeScript type definitions |
.env.example |
Environment variable template |
.eslintrc.json |
ESLint configuration for code quality |
.prettierrc |
Prettier configuration for code formatting |
.gitignore |
Git ignore rules |
vite.config.ts |
Vite build configuration |
tsconfig.json |
TypeScript configuration |
The project uses Husky and lint-staged for pre-commit hooks:
# Install Husky
npm run prepare
# This will automatically:
# - Run ESLint on staged files
# - Run Prettier on staged files
# - Run type checking# Lint check only (no fix)
npm run lint:check
# Format check only (no fix)
npm run format:check
# Type checking
npm run type-checkSolution:
rm -rf node_modules package-lock.json
npm installSolution:
# Use different port
npm run dev -- --port 3001Solution:
- Ensure
.env.localexists in the root directory - Restart the development server
- Verify variables are prefixed with
VITE_
Solution:
# Run type checking
npm run type-check
# Clear cache and reinstall
npm run type-checkThe application connects to Supabase for data management:
// Configuration in src/lib/supabase.ts
import { createClient } from '@supabase/supabase-js'
const supabase = createClient(
process.env.VITE_SUPABASE_URL!,
process.env.VITE_SUPABASE_ANON_KEY!
)
export default supabaseconst { request, loading, error } = useApi()
// Fetch data
const data = await request('/repositories')Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure:
- Code passes linting:
npm run lint:check - Code is properly formatted:
npm run format - Types are correct:
npm run type-check - Tests pass:
npm run test
The project includes GitHub Actions workflows for:
-
Lint Workflow (
.github/workflows/lint.yml)- Runs ESLint on all pull requests
- Ensures code quality standards
-
Test Workflow (
.github/workflows/test.yml)- Runs unit tests on all branches
- Generates coverage reports
-
Build Workflow (
.github/workflows/build.yml)- Verifies production build succeeds
- Tests build output
This project is licensed under the MIT License - see the LICENSE file for details.
stomde - @stomde
For issues, questions, or suggestions:
- Open a GitHub Issue
- Check existing documentation
- Review the contributing guide
- React - UI framework
- Vite - Build tool
- TypeScript - Type safety
- Supabase - Backend services
- Recharts - Data visualization
- Lucide Icons - Icon library
Last Updated: 2026-05-17
Version: 0.1.0