Laravel PHP React TypeScript Guide .cursorrules prompt file
About .cursorrules prompt file
What you can build
Dynamic Personal Blog Platform - Create a blog platform allowing users to post articles and manage their content with Laravel for the back-end and React for the front-end. Use Tailwind for styling, and implement a rich text editor for creating posts. User authentication and permissions can be managed using Jetstream with Sanctum for API security. This platform can support multi-language content through localization features in Laravel.
E-commerce Web Application - Develop a fully functional e-commerce app with Laravel as the back-end to manage product catalogs, orders, and user management. Use React and Prime React to create a sleek and responsive front-end. Tailwind can be used for design consistency. Leverage Inertia.js for smooth navigation and Jetstream for authentication. Implement testing with Pest for backend reliability.
Online Learning Management System (LMS) - Design an LMS where instructors can create courses and students can enroll. Use Laravel for back-end APIs to handle course materials, enrollment functionalities, and user roles. For React front-end, utilize Prime React components for user interfaces, and TailwindCSS for styling. Incorporate react-hook-form for handling form submissions and Zod for form validation.
Project Management Dashboard - Build a project management tool with features like kanban boards, task assignment, and teamwork analytics. Use Laravel for a robust back-end API and React/Prime React for dynamic and interactive front-end components. Implement role-based access controls with Sanctum and manage various state updates with Inertia.js to keep everything act as a single-page application.
Social Media Platform - Create a social media platform with features like user profiles, friend networks, and a real-time chat. Use Laravel for the back-end to serve APIs, handle user authentication, and store data securely. Use React with Tailwind for a modern UI, and Inertia.js for real-time updates without page reloads. Integrate web sockets for the chat feature and test with Pest to ensure robust performance.
Custom CRM System - Develop a CRM system focusing on customer management, sales tracking, and reporting. Utilize Laravel for RESTful back-end services with API controllers for different customer-related operations. React, combined with Prime React for table and chart components, to visualize data effectively. Use react-hook-form for user input forms, and Zod for validation. Implement multi-step forms for customer data entry.
Remote Job Board - Create a job board for remote work, allowing companies to post jobs and candidates to apply. Laravel back-end should handle job listings, user profiles, and applications. React-based front-end with Prime React and Tailwind for UI. Use Jetstream for user authentication, and Inertia.js for smooth navigation. Extend Knowii API client to manage API interactions between client and server.
Marketplace for Freelancers - Build a platform for freelancers to showcase their skills and get hired. Laravel RESTful services to manage user registrations, job listings, and transactions. Create a React front-end with Prime React for profile and job listing views. Tailwind CSS for a modern look, and use react-hook-form with Zod for all forms. Secure user authentication can be managed with Laravel Sanctum and Jetstream.
Digital Nomad Community Platform - Establish a platform where digital nomads can connect, share travel tips, and collaborate. Laravel API management for user-generated content such as articles or forum posts. Use React for an interactive UI, supplemented by Tailwind and Prime React for styling and component design. Incorporate a forum or chat system with Inertia.js for real-time interactions.
Real Estate Listing Service - Develop a site for browsing real estate listings with filtering and map functionalities. Use Laravel for backend data structuring and APIs, React for interactive searches and list presentations, and Prime React for advanced components. Implement forms with react-hook-form and data validation with Zod. Employ Tailwind for responsive design, and use Inertia.js to manage seamless browsing transitions.
Benefits
- Combine Laravel's API controllers efficiently with Action classes and ApiResponses trait, ensuring scalable design and consistent API behavior.
- Leverage TypeScript with strict typing, ensuring code quality and reliability, avoiding "any" type for robust front-end validation.
- Optimize data handling with Knowii API client, promoting efficient TypeScript and React integration, facilitating seamless API interactions.
Synopsis
Developers looking to build robust web applications with a Laravel backend and a React frontend can use this prompt to streamline coding practices and ensure consistent architectural integrity.
Overview of .cursorrules prompt
The .cursorrules file is designed for developers experienced in Laravel, PHP, Pest, TypeScript, and React, as well as associated technologies like Prime React, Tailwind, Jetstream, and Inertia.js. It outlines specific development guidelines and rules for handling back-end and front-end tasks, emphasizing code precision, architectural quality, and up-to-date practices. For back-end development, it mandates using Action classes for processing and storing API controllers in a defined directory, with validation constants and secure endpoints. The front-end rules focus on TypeScript, React component organization, form handling with react-hook-form, and routing with Inertia.js. The file promotes a codebase that prioritizes readability, functionality, and strict TypeScript configurations while maintaining a casual and concise communication style.