This guide covers setting up a local development environment for IntuneGet.
- Node.js 20 or later
- npm, pnpm, or yarn
- Git
- A code editor (VS Code recommended)
# Clone the repository
git clone https://github.com/ugurkocde/IntuneGet.git
cd IntuneGet
# Install dependencies
npm install
# Copy environment template
cp .env.example .env.local
# Start development server
npm run devOpen http://localhost:3000 in your browser.
For basic development, you need:
# Supabase (required)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# Azure AD (required for auth)
NEXT_PUBLIC_AZURE_AD_CLIENT_ID=your-client-id
AZURE_AD_CLIENT_SECRET=your-client-secret
# Application URL
NEXT_PUBLIC_URL=http://localhost:3000# Skip pipeline for faster iteration
# GITHUB_PAT= # Leave empty to disable pipelineIf your team has a shared development Supabase instance:
- Get credentials from your team lead
- Use a unique
user_idprefix in testing to avoid conflicts
IntuneGet/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ ├── auth/ # Authentication pages
│ ├── dashboard/ # Main application
│ └── layout.tsx # Root layout
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ └── ... # Feature components
├── contexts/ # React contexts
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
│ ├── supabase/ # Supabase client
│ └── ...
├── public/ # Static assets
├── supabase/ # Supabase migrations
│ └── migrations/
├── docs/ # Documentation
└── .github/ # GitHub Actions
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
- Use TypeScript strict mode
- Define types for all props and state
- Avoid
anytype
// Good
interface DeploymentProps {
appId: string;
tenantId: string;
}
// Avoid
function deploy(props: any) { ... }- Use functional components with hooks
- Keep components focused and small
- Extract reusable logic to custom hooks
// Good - focused component
function DeployButton({ appId, onDeploy }: DeployButtonProps) {
return (
<Button onClick={() => onDeploy(appId)}>
Deploy
</Button>
);
}
// Avoid - doing too much
function AppCard({ app }) {
// Don't include data fetching, complex state, and rendering all in one
}- Components:
PascalCase.tsx - Utilities:
camelCase.ts - API routes:
route.ts(Next.js convention)
For UI development without authentication:
- Comment out auth checks temporarily
- Use mock data
- Remember to restore before committing
To test deployment UI without the pipeline:
- Create mock deployment records in Supabase
- Update status manually to simulate pipeline progress
- Use Supabase Studio for quick edits
- Set up all environment variables
- Create an Azure AD app registration (use localhost redirect)
- Fork the repo for GitHub Actions
- Test the complete flow
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
}
]
}"Module not found" errors:
# Clear cache and reinstall
rm -rf node_modules .next
npm installTypeScript errors after pulling:
# Regenerate types
npm run buildSupabase connection issues:
- Check
.env.localhas correct values - Verify project isn't paused
- Check network connectivity
- Create component file in
components/ - Export from component
- Import where needed
- Add to any required providers
- Create folder in
app/api/ - Create
route.tswith handlers - Use proper HTTP methods
- Handle errors appropriately
// app/api/example/route.ts
export async function GET(request: Request) {
try {
// ... implementation
return Response.json({ data });
} catch (error) {
return Response.json({ error: 'Failed' }, { status: 500 });
}
}- Create a new migration file in
supabase/migrations/ - Use descriptive name:
20240115_add_column_name.sql - Test locally
- Submit with your PR
- Create a feature branch
- Make focused, incremental changes
- Write clear commit messages
- Update documentation if needed
- Ensure
npm run lintpasses - Ensure
npm run buildsucceeds - Submit PR with description of changes
- Check existing GitHub Issues
- Review documentation in
/docs - Open a GitHub Issue