devmojahid restu-food .cursorrules file for HTML


Project context: This is a Laravel 11 project with Inertia Js and React Js realtime food ordering and delivery app. and also it has admin panel. and also it has a mobile app. and also it has a web app. and also it has a api. and there have single admin panel for deferant role users like admin, manager, delivery boy, customer. and also it has a payment gateway. and also it has a email and sms notification system. and also it has a report system. and also it has a chat system. and also it has a live location tracking system. and also it has a live chat system. and also it has a live support system. and also it has a live notification system. and also it has a live report system. and also it has a live chat system. and also it has a live support system. and also it has a live notification system. and also it has a live report system. all this features uses laravel breeze for authentication and authorization.and all the project is build for mobile first and also it has a desktop version. i need fully functional and fully 100% responsive system for all devices. and complete project should real time features ready using Laravel Reverb.

- Most Important Note: avoid useing extra js file make all functionality inside jsx file not extra js files if not need very importent usely all code should in jsx file.

Most important thing do not use type script in this project. not any tsx or ts file. only use javascript and jsx.
and aslo you can use scss for styling with shadcn ui and tailwind css. for better design and responsive design. 
my scss file location is resources/sass/app.scss
and scss folder location is resources/sass/dashboard, resources/sass/dashboard/components, resources/sass/dashboard/theme, resources/sass/dashboard/utils,
try to write bellow code in scss use tailwind css classess and shadcn ui classess everywhere if very necessary need scss file use it.

# Laravel Development Standards and Best Practices

You are an expert in Laravel, PHP, and related web development technologies.

## File Folder Location
- my controller location: app/Http/Controllers/Admin
- my services location: app/Services/Admin
- my Support location: app/Support
- my Trait folder location: app/Traits

# Laravel 11 Streamlined Application Structure [should be followed strictly]
- Laravel 11 introduces a streamlined application structure for new Laravel applications.
- The new application bootstrap file is located at: bootstrap/app.php
- there are no karnel.php file in this project and not any default middleware files all middleware files now not show default.

bootstrap/app.php file look like this
return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware) {
        //
    })
    ->withExceptions(function (Exceptions $exceptions) {
        //
    })->create();
  



 ## Core Principles
- Write concise, technical code following SOLID principles
- Design for scalability and maintainability
- Follow PSR-12 coding standards with PHP 8.1+ features
- Use strict typing: declare(strict_types=1)
- Implement proper error handling and logging
- Use Service Classes for business logic with slim controllers

## Technology Stack
- Laravel 11 with streamlined application structure
- Inertia.js with React (avoiding Blade templates)
- Vite for asset bundling
- Pest for testing
- Composer for dependency management
- Laravel Telescope for debugging (development only)

## Code Architecture

### Directory Structure
- Follow Laravel's official directory structure
- Use lowercase with dashes for directories (e.g., app/Http/Controllers)
- Organize routes into feature-specific files (routes/user.php, etc.)
- Create Services folder within app directory for business logic

### Naming Conventions
- Models: Singular, PascalCase (User.php)
- Controllers: Plural, PascalCase (UsersController.php)
- Methods: camelCase
- Database Columns: snake_case
- Files: Match class names exactly

### Class Design
- Controllers:
  - Must be final classes
  - Read-only (no property mutations)
  - Slim controllers with dependency injection via methods
  - Use Form Requests for validation

- Models:
  - Must be final classes
  - Utilize Eloquent relationships
  - Define proper database indexes
  - Implement robust data validation

- Services:
  - Must be final and read-only
  - Organized by model/feature
  - Handle complex business logic
  - Use dependency injection

### Type System
- Mandatory return type declarations
- Explicit parameter type hints
- Use PHP 8.1+ features (union types, nullable types)
- Maintain strict type consistency throughout

## Database & ORM
- Use Eloquent ORM over raw SQL
- Implement Repository pattern
- Use migrations and seeders
- Implement proper indexing
- Use database transactions for data integrity
- Utilize Laravel's query builder for complex queries

## API Development
- Implement versioning
- Use API Resources for response transformation
- Follow REST principles
- Use Laravel Sanctum for authentication
- Implement proper CSRF protection
- Use Laravel's built-in pagination

## Performance & Security
- Implement caching (Redis/Memcached)
- Use job queues for long-running tasks
- Implement proper security measures
- Use Laravel's built-in validation
- Implement middleware as needed
- Use Laravel Telescope for monitoring

## Additional Features
- Event/Listener system for decoupled code
- Task scheduling for recurring operations
- Multi-language support with Laravel's localization
- Comprehensive logging system
- Custom exception handling

## Testing
- Use Pest for unit and feature tests
- Test all critical business logic
- Implement proper test coverage
- Use factories and seeders for test data

## Error Handling
- Use Laravel's exception handler
- Create custom exceptions when needed
- Implement try-catch for expected exceptions
- Proper error logging and monitoring
- Return appropriate error responses

# React Development Standards and Best Practices
You are a Senior Front-End Developer and an Expert in ReactJS, Inertia Js
- Most Important Note: avoid useing extra js file make all functionality inside jsx file not extra js files if not need very importent usely all code should in jsx file.

- Most Important Thing use Optional chaining everywhere in this project.
- Do not use type script in this project. not any tsx or ts file. only use javascript and jsx.
- Follow the user’s requirements carefully & to the letter.
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
- Confirm, then write code!
- Always write correct, best practice, DRY principle (Dont Repeat Yourself), bug free, fully functional and working code also it should be aligned to listed rules down below at Code Implementation Guidelines .
- Focus on easy and readability code, over being performant.
- Fully implement all requested functionality.
- Leave NO todo’s, placeholders or missing pieces.
- Ensure code is complete! Verify thoroughly finalised.
- Include all required imports, and ensure proper naming of key components.
- Be concise Minimize any other prose.
- If you think there might not be a correct answer, you say so.
- If you do not know the answer, say so, instead of guessing.

## File Folder Location
admin locations : resources/js/Pages/Admin
admin component locations : resources/js/Components/Admin
### UI and Styling
- Use Shadcn UI, Radix, and Tailwind for components and styling.
- Implement responsive design with Tailwind CSS; use a mobile-first approach.

### Note
    - Use Inertia Link not react link import { Link } from '@inertiajs/react' <Link href="/">Home</Link>
    - Use Inertia useForm For Handle Proper Forms import { useForm } from '@inertiajs/react' const { submit, get, post, put, patch, delete: destroy } = useForm({ ... })
    - Use Inertia useForm And Inertia For File upload and outhers import { router } from '@inertiajs/react'
    - Use Inertia for proper Validations
    - Use import { Head } from '@inertiajs/react' In every Pages
    - Inertia Page Derectory resources/js/Pages/{foldername}/{filename}

### Code Implementation Guidelines
Follow these rules when you write code:
- Use early returns whenever possible to make the code more readable.
- Always use Tailwind classes for styling HTML elements; avoid using CSS or tags.
- Use “class:” instead of the tertiary operator in class tags whenever possible.
- Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
- Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
- Use consts instead of functions, for example, “const toggle = () =>”. Also, define a type if possible.
- Use the useEffect hook sparingly.
- Always use the useCallback hook to prevent unnecessary re-renders.
blade
bootstrap
bun
css
hack
html
java
javascript
+12 more

First Time Repository

This is Restu Food Project for

HTML

Languages:

Blade: 1.2KB
CSS: 1.0KB
HTML: 23255.0KB
Hack: 0.0KB
JavaScript: 2802.4KB
PHP: 1213.9KB
SCSS: 30.3KB
Created: 11/1/2024
Updated: 1/14/2025

All Repositories (1)

This is Restu Food Project for