crystal-erp

byNow S

# \# ERP / CRM Development Prompt (Final Version) # # تو یک \*\*Senior Software Architect\*\*، \*\*Senior PHP Native Developer\*\*، \*\*Senior Frontend Developer\*\* و \*\*UI/UX Designer\*\* هستی. # # هدف تو ساخت یک سیستم کامل ERP/CRM حرفه‌ای است، نه تولید نمونه آموزشی. # # \--- # # \## قوانین اصلی # # \* ابتدا کل معماری پروژه را درک کن. # \* هیچ قابلیت یا فایل را حذف نکن. # \* هیچ قابلیت جدیدی بدون هماهنگی اضافه نکن. # \* اگر بخشی ناقص است همان بخش را کامل کن. # \* تمام کدها باید ساده، خوانا، سبک و قابل نگهداری باشند. # \* از پیچیدگی غیرضروری جلوگیری کن. # \* فقط PHP Native استفاده کن. # \* Composer ممنوع. # \* Framework ممنوع. # \* NodeJS ممنوع. # \* Laravel ممنوع. # \* Symfony ممنوع. # \* هیچ وابستگی خارجی ایجاد نکن. # # تمام پروژه باید فقط داخل مسیر زیر اجرا شود: # # `public\_html` # # \--- # # \## تکنولوژی # # Backend # # \* PHP Native # \* MySQL # \* PDO # \* Prepared Statements # \* OOP # \* MVC Modular # # Frontend # # \* HTML5 # \* CSS3 # \* JavaScript # \* Bootstrap # \* Tailwind CSS # \* Animate.css # # \--- # # \## اصل اول سیستم # # هیچ اطلاعاتی هرگز حذف فیزیکی نشود. # # همه حذف‌ها: # # \* Soft Delete # \* Audit Log # \* Versioning # \* Restore # # در تمام ماژول‌ها رعایت شود. # # \--- # # \## معماری سیستم # # سیستم باید شامل هسته‌های زیر باشد: # # \* Users # \* Companies # \* Projects # \* Employees # \* Foremen # \* Attendance # \* Salary # \* Overtime # \* Financial # \* General Ledger (دفتر کل) # \* Bank Cards # \* Bank Transactions # \* Contracts # \* Files # \* Reports # \* Notifications # \* Messages # \* Audit Logs # \* Security # \* Permissions # \* Dashboard # \* Settings # # \--- # # \## موتور مالی # # هیچ مبلغی مستقیم ذخیره نشود. # # همه محاسبات از روی داده‌ها انجام شود. # # Calculation Engine باید موارد زیر را محاسبه کند: # # \* ساعت کاری # \* نرخ ساعت # \* نرخ روز # \* نرخ ماه # \* اضافه کاری # \* پاداش # \* جریمه # \* مساعده # \* هزینه اتاق # \* هزینه شخصی # \* تسویه # \* دریافت پروژه # \* هزینه پروژه # \* مانده پروژه # # \--- # # \## دفتر کل (General Ledger) # # سیستم باید دارای دفتر کل کامل باشد. # # تمام عملیات مالی باید به صورت خودکار در دفتر کل ثبت شوند. # # از جمله: # # \* پرداخت حقوق # \* مساعده # \* هزینه اتاق # \* هزینه شخصی # \* خریدها # \* دریافت از کارفرما # \* واریز بانکی # \* برداشت بانکی # \* انتقال بین کارت‌ها # \* هزینه پروژه # \* درآمد پروژه # # امکان مشاهده: # # \* دفتر روزانه # \* دفتر کل # \* مانده حساب # \* گردش حساب # \* گزارش مالی # # وجود داشته باشد. # # \--- # # \## مدیریت کارت‌های بانکی # # برای هر کارت: # # \* بانک # \* شماره کارت # \* شماره شبا # \* صاحب کارت # \* موجودی # # ثبت شود. # # تمام دریافت‌ها و پرداخت‌ها موجودی کارت را به صورت خودکار به‌روزرسانی کنند. # # \--- # # \## مدیریت پروژه # # هر پروژه دارای پروفایل مستقل باشد. # # اطلاعات: # # \* کارفرما # \* شماره قرارداد خودکار # \* تاریخ شمسی # \* مبلغ قرارداد # \* دریافت شده # \* مانده # \* فایل قرارداد # \* تصاویر # \* تاریخ شروع # \* پایان # \* آرشیو # # هر پروژه: # # \* کارگر # \* سرکارگر # \* ساعت کاری # \* اضافه کاری # \* دریافت‌ها # \* هزینه‌ها # # را مدیریت کند. # # پروژه قابلیت خروجی PDF داشته باشد. # # \--- # # \## مدیریت کارمندان # # هر کارمند پروفایل مستقل داشته باشد. # # نمایش: # # \* اطلاعات شخصی # \* ساعت کاری # \* اضافه کاری # \* حقوق # \* مساعده # \* هزینه شخصی # \* هزینه اتاق # \* پروژه‌های فعال # \* پروژه‌های قبلی # # همه گزارش‌ها PDF داشته باشند. # # \--- # # \## مدیریت اتاق # # محاسبه سهم افراد کاملاً خودکار انجام شود. # # براساس: # # \* تاریخ ورود # \* تاریخ خروج # \* تعداد روز # \* مبلغ کل # # \--- # # \## فایل‌ها # # برای هر موجودیت پوشه اختصاصی وجود داشته باشد. # # \* پروژه # \* قرارداد # \* شرکت # \* کارمند # \* سرکارگر # # هر فایل: # # \* نسخه # \* تاریخ # \* توضیح # \* آپلودکننده # \* سطح دسترسی # # داشته باشد. # # \--- # # \## مجوزها # # Permission Engine کاملاً پویا باشد. # # هر ماژول عملیات مستقل داشته باشد. # # مانند: # # \* View # \* Create # \* Edit # \* Archive # \* Print # \* PDF # \* Excel # \* Delete (Soft Delete) # \* Restore # \* Reports # \* Files # # \--- # # \## نقش‌ها # # \### Super Admin # # کنترل کامل # # \--- # # \### Admin حسابداری # # فقط مجاز به: # # \* ایجاد پروژه # \* ایجاد کارمند # \* ثبت ساعت کاری # \* ثبت دریافت # \* ثبت هزینه # # عدم دسترسی به: # # \* حذف # \* ویرایش اطلاعات اصلی # \* تنظیمات سیستم # # \--- # # \## داشبورد # # داشبورد اختصاصی برای: # # \* Super Admin # \* Admin # \* Foreman # \* Employee # # کاملاً Responsive باشد. # # \--- # # \## رابط کاربری # # اولویت اول: # # موبایل # # سپس: # # تبلت # # سپس: # # دسکتاپ # # تمام صفحات: # # \* Responsive # \* سبک # \* سریع # \* حرفه‌ای # \* مدرن # # باشند. # # \--- # # \## عملکرد # # سیستم باید روی اینترنت ضعیف نیز روان کار کند. # # \* کمترین درخواست HTTP # \* کمترین فایل # \* کمترین حجم # \* کمترین JavaScript # \* بدون کد اضافی # # \--- # # \## استاندارد کدنویسی # # \* OOP # \* MVC # \* Single Responsibility # \* کدهای کوتاه # \* توابع کوچک # \* مستندسازی # \* نام‌گذاری استاندارد # # \--- # # \## قوانین توسعه # # \* هر فایل فقط مسئول یک وظیفه باشد. # \* از تکرار کد جلوگیری کن. # \* از ساخت فایل اضافی خودداری کن. # \* فقط در صورت نیاز واقعی فایل جدید ایجاد کن. # \* هر ماژول تا پایان کامل شود و سپس سراغ ماژول بعدی برو. # \* قبل از پایان هر ماژول، تمام فایل‌های همان ماژول را از نظر Syntax، Dependency، Reference، مسیرها و معماری بررسی کن. # \* هیچ SQL، Migration یا ساخت دیتابیس تولید نکن مگر اینکه بعداً صریحاً درخواست شود. # # \--- # # \## روش انجام کار # # 1\. ابتدا معماری موجود را بررسی کن. # 2\. فایل‌های ناقص را شناسایی کن. # 3\. وابستگی‌ها را بررسی کن. # 4\. فایل‌های هر ماژول را کامل کن. # 5\. پس از اتمام هر ماژول، یک Audit داخلی انجام بده. # 6\. سپس وارد ماژول بعدی شو. # 7\. تا پایان پروژه هیچ قابلیت نیمه‌کاره باقی نگذار. # # هدف نهایی، تولید یک ERP/CRM کامل، سبک، ماژولار، قابل توسعه، مناسب هاست اشتراکی (`public\_html`) و کاملاً بهینه برای استفاده روزمره، به‌ویژه روی تلفن همراه است.

No preview

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 5

Crystal-ERP System Requirements Document

1. Introduction

The Crystal-ERP project aims to develop a comprehensive, professional ERP/CRM system using PHP Native without any frameworks or external dependencies. The system is designed to be modular, maintainable, and optimized for mobile use, ensuring a seamless experience even on weak internet connections.

2. System Overview

Crystal-ERP will be a robust enterprise resource planning and customer relationship management system. It will include core functionalities such as user management, project management, financial management, and more, all while adhering to strict coding standards and architectural principles.

2a. Source Content Inventory

  • Backend Technologies: PHP Native, MySQL, PDO, Prepared Statements, OOP, MVC Modular
  • Frontend Technologies: HTML5, CSS3, JavaScript, Bootstrap, Tailwind CSS, Animate.css
  • Core Modules: Users, Companies, Projects, Employees, Foremen, Attendance, Salary, Overtime, Financial, General Ledger, Bank Cards, Bank Transactions, Contracts, Files, Reports, Notifications, Messages, Audit Logs, Security, Permissions, Dashboard, Settings
Page 2 of 5

3. Functional Requirements as Story Points

  • As a Super Admin, I should have complete control over the system.
  • As an Admin, I should be able to create projects and employees, record working hours, and manage financial transactions.
  • As a Foreman, I should be able to manage project workers and track their attendance and overtime.
  • As an Employee, I should be able to view my personal information, working hours, and project assignments.
  • As a User, I should be able to view, create, edit, archive, print, and export data in PDF and Excel formats.
  • As a User, I should be able to perform soft deletes, restore data, and generate reports.
  • As a User, I should be able to manage bank cards and transactions with automatic balance updates.
  • As a User, I should be able to manage project profiles, including contract details and financial summaries.
  • As a User, I should be able to manage employee profiles with detailed work and financial information.
  • As a User, I should be able to manage room allocations and calculate individual shares automatically.
  • As a User, I should be able to upload and manage files with versioning and access control.

4. User Personas

  • Super Admin: Has full control over all system functionalities and settings.
  • Admin: Manages projects, employees, and financial transactions but has restricted access to system settings and data deletion.
  • Foreman: Oversees project workers, manages attendance, and tracks overtime.
  • Employee: Views personal and project-related information.

5. Core User Flows

  • Super Admin: Logs in -> Accesses dashboard -> Manages system settings and permissions -> Generates reports
  • Admin: Logs in -> Creates a new project -> Adds employees -> Records working hours -> Manages financial transactions
  • Foreman: Logs in -> Views assigned projects -> Manages worker attendance and overtime
  • Employee: Logs in -> Views personal profile -> Checks assigned projects and working hours
Page 3 of 5

6. Visuals Colors and Theme

  • primary: #007BFF (a strong blue for brand identity)
  • primary_light: #66B2FF (a lighter blue for hover states)
  • secondary: #6C757D (a neutral gray for supporting elements)
  • accent: #28A745 (a green for call-to-actions and active states)
  • highlight: #FFC107 (a yellow for notifications and highlights)
  • bg: #F8F9FA (a light gray for page backgrounds)
  • surface: #FFFFFF (white for card and panel backgrounds)
  • text: #212529 (a dark gray for primary text)
  • text_muted: #6C757D (a softer gray for secondary text)
  • border: #DEE2E6 (a subtle gray for borders)

7. Signature Design Concept

Interactive Dashboard

The Crystal-ERP landing page will feature an interactive dashboard that visually represents the system's core modules as interconnected nodes. Users can click on each node to expand and explore detailed functionalities. The nodes will animate and rearrange dynamically based on user interaction, providing a visually engaging and intuitive navigation experience. This concept will be implemented using motion/react for smooth animations and transitions.

Page 4 of 5

Landing Hero Motion Brief

The hero section will depict a dynamic flow of data inputs transforming into actionable insights. Animated icons representing different modules (e.g., users, projects, finances) will converge towards a central dashboard interface, which then expands to reveal detailed analytics and reports. This loop will run continuously, with interactive elements allowing users to hover and explore specific modules. The animation will be crafted using motion/react for a seamless and engaging experience.

8. Interaction Model & Motion Direction

  • Intended Interaction Model: Animated
  • The landing page will feature moderate scroll-triggered reveals and hover transitions, with spring physics applied to interactive elements for a polished user experience.
  • Internal pages will maintain a static layout for clarity and ease of use, focusing on data-heavy content presentation.

9. Non-Functional Requirements

  • The system must operate smoothly on weak internet connections.
  • Minimize HTTP requests, file sizes, and JavaScript usage.
  • Ensure all code is simple, readable, lightweight, and maintainable.

10. Tech Stack

  • Backend: PHP Native, MySQL, PDO
  • Frontend: HTML5, CSS3, JavaScript, Bootstrap, Tailwind CSS, Animate.css
Page 5 of 5

11. Assumptions and Constraints

  • The system will be hosted in the public_html directory.
  • No external dependencies or frameworks will be used.
  • All deletions will be soft deletes with audit logs and versioning.

12. Glossary

  • ERP: Enterprise Resource Planning
  • CRM: Customer Relationship Management
  • OOP: Object-Oriented Programming
  • MVC: Model-View-Controller
  • PDO: PHP Data Objects
  • Soft Delete: A method of marking data as deleted without physically removing it from the database.

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

Login: Sign In
Dashboard: View Overview
Projects: Create Project
Projects: View Project Profile
Employees: Create Employee
Employees: View Profile
Attendance: Record Working Hours
Overtime: Record Overtime
Financial: Record Transaction
Bank Cards: Manage Transactions
Reports: Generate Reports
Contracts: Manage Contracts

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

Login: Sign In
Dashboard: View Overview
Projects: Create Project
Projects: View Project Profile
Employees: Create Employee
Employees: View Profile
Attendance: Record Working Hours
Overtime: Record Overtime
Financial: Record Transaction
Bank Cards: Manage Transactions
Reports: Generate Reports
Contracts: Manage Contracts