54 lines
3.1 KiB
Markdown
54 lines
3.1 KiB
Markdown
# Copilot Instructions for absensi_TA (Laravel Attendance System)
|
|
|
|
## Project Overview
|
|
- This is a Laravel-based web application for attendance management and related admin/employee workflows.
|
|
- Main features: user management, attendance tracking, leave (cuti) requests, damaged goods (barang rusak) reporting.
|
|
- Follows standard Laravel MVC structure: `app/Models`, `app/Http/Controllers`, `resources/views`, `routes/web.php`.
|
|
|
|
## Architecture & Data Flow
|
|
- **Models**: Eloquent ORM models in `app/Models` (e.g., `Attendance.php`, `User.php`, `BarangRusak.php`).
|
|
- **Controllers**: Business logic in `app/Http/Controllers`. Each domain (attendance, user, etc.) has its own controller.
|
|
- **Views**: Blade templates in `resources/views/`, organized by feature (e.g., `absensi/`, `admin/`, `barang-rusak/`, `cuti/`).
|
|
- **Routes**: Main routing in `routes/web.php`. Console commands in `routes/console.php`.
|
|
- **Migrations**: Database schema changes in `database/migrations/`. Multiple migrations for user table extensions (roles, usernames, profile fields).
|
|
- **Seeders/Factories**: Test data in `database/seeders/` and `database/factories/`.
|
|
|
|
## Developer Workflows
|
|
- **Local Development**: Use XAMPP for local server (`public/index.php`).
|
|
- **Environment**: Configure `.env` for DB and app settings. SQLite is used by default (`database/database.sqlite`).
|
|
- **Build Assets**: Use Vite (`vite.config.js`). Run `npm install` then `npm run dev` to build front-end assets.
|
|
- **Testing**: PHPUnit config in `phpunit.xml`. Run tests with `vendor/bin/phpunit`.
|
|
- **Database Migrations**: Run `php artisan migrate` to apply migrations. Use `php artisan db:seed` for seed data.
|
|
- **Debugging**: Use Laravel's built-in error pages and logging (`storage/logs/`).
|
|
|
|
## Project-Specific Conventions
|
|
- **User Table**: Extended with multiple migrations for roles, usernames, and profile fields. Check migration files for schema evolution.
|
|
- **Views**: Blade templates are grouped by feature. Layouts in `resources/views/layouts/`.
|
|
- **Role Management**: User roles are managed via DB fields and checked in controllers/views.
|
|
- **Attendance Logic**: Core attendance logic in `Attendance.php` model and related controllers.
|
|
- **Damaged Goods**: Managed via `BarangRusak.php` model and `barang-rusak/` views.
|
|
|
|
## Integration Points
|
|
- **External Packages**: Managed via Composer (`composer.json`).
|
|
- **Front-End**: Uses Vite for asset bundling. JS/CSS in `resources/js/` and `resources/css/`.
|
|
- **Storage**: Public and private storage in `storage/app/` and `public/storage`.
|
|
|
|
## Key Files & Directories
|
|
- `app/Models/` — Eloquent models
|
|
- `app/Http/Controllers/` — Controllers
|
|
- `resources/views/` — Blade templates
|
|
- `routes/web.php` — Main routes
|
|
- `database/migrations/` — DB schema
|
|
- `.env` — Environment config
|
|
- `vite.config.js` — Front-end build config
|
|
- `phpunit.xml` — Test config
|
|
|
|
## Example Commands
|
|
- Migrate DB: `php artisan migrate`
|
|
- Seed DB: `php artisan db:seed`
|
|
- Run tests: `vendor/bin/phpunit`
|
|
- Build assets: `npm run dev`
|
|
|
|
---
|
|
_If any section is unclear or missing important project-specific details, please provide feedback to improve these instructions._
|