# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This is a Laravel-based government services platform that manages citizen requests for various government documents and services. The application includes both public-facing forms for citizens to request services and administrative portals for government officials to manage requests.

## Architecture

The application follows Laravel's MVC architecture with the following key components:

### Core Modules
- **Public Services**: Citizen-facing forms for requesting government documents (KTP, KIA, marriage certificates, etc.)
- **Government Portal**: Administrative interface for processing requests
- **Disnaker Module**: Labor department functionality including inventory management, cash transactions, articles, events, and document management
- **Top Week Service**: Integration with external UUSMS API to fetch weekly statistics

### Key Models
- **GovKtpRequest, GovKiaRequest, etc.**: Government document request models
- **UserLoket**: Citizens/users requesting services
- **UserGov**: Government officials processing requests
- **Disnaker models**: Inventory, cash transactions, articles, events, and documents for the labor department

### Routes Structure
- **Public routes** (`/layanan/*`): Citizen service request forms
- **Portal routes** (`/portal/*`): Admin interface for government officials
- **Disnaker routes** (`/portal/disnaker/*`): Labor department management
- **API routes**: Sanctum-protected API endpoints

## Development Commands

### Common Commands
```bash
# Install dependencies
composer install
npm install

# Run development server
php artisan serve
npm run dev

# Build for production
npm run build

# Run tests
php artisan test
# or
./vendor/bin/phpunit

# Database operations
php artisan migrate
php artisan db:seed
php artisan migrate:refresh --seed

# Code formatting
./vendor/bin/pint
```

### Artisan Commands
- `php artisan migrate` - Run pending migrations
- `php artisan db:seed` - Seed the database
- `php artisan route:list` - List all routes
- `php artisan config:cache` - Cache configuration
- `php artisan route:cache` - Cache routes

## Key Features

### Public Services
- KTP (Identity Card) requests
- KIA (Child Identity Card) requests
- Marriage certificate requests
- Name change requests
- Family card requests
- Event permit requests
- Land certificate requests
- House purchase requests

### Government Portal
- Request management dashboard
- Document approval workflow
- User management for officials

### Disnaker (Labor Department) Module
- Inventory management system
- Cash account and transaction tracking
- Article publishing system
- Event management
- Document repository
- Stock movement tracking

### External Integrations
- UUSMS API integration for weekly statistics via `TopWeekService`

## File Structure

- `app/Http/Controllers/` - Contains controllers for different modules
- `app/Models/` - Eloquent models for database entities
- `app/Services/` - Business logic services (e.g., TopWeekService)
- `routes/web.php` - Main web routes
- `database/migrations/` - Database schema definitions
- `resources/views/` - Blade templates
- `public/storage/` - Public file storage (via symbolic link)

## Important Notes

- The application uses Laravel's built-in authentication system
- File uploads (photos and signatures) are now stored on FiveManage CDN instead of local storage
- The `UserLoket` model represents citizens requesting services
- The `UserGov` model represents government officials
- Soft deletes are implemented throughout the application
- Form requests and validation are used extensively for input sanitization
- FiveManage CDN integration is handled by `FiveManageUploadService` with automatic upload and validation
- Profile photos and signatures are uploaded to CDN and URLs are stored in the database