-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
2,303 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Introduction | ||
|
||
## What is xShop? | ||
|
||
> xShop is an open source shop developed in laravel, very customizable! Easy site design. | ||
> By the way is very fast development. | ||
> Support multilanguage sites [RTL & LTR support] | ||
### version 2 new features | ||
|
||
- Dashboard panel changes | ||
- Integration of Vue.js and laravel | ||
- Advanced charts | ||
- Better customizable with AI & languages | ||
- Fixed Technical issues | ||
- Project size compression | ||
- UI/UX is more specific | ||
- Developer Friendlier | ||
|
||
## Requirement | ||
|
||
- php 8.2.x or above [ php-gd, sqlite3, php-soap, php-zip ] | ||
- mysql or mariadb or sqlite | ||
- composer | ||
- recommends install imagemagick on server to more image performance [ to generate webp images ] | ||
|
||
## Quick Start | ||
|
||
|
||
|
||
### Installation [ Development mode ] | ||
|
||
> [!IMPORTANT] | ||
> Create new database and rename `.env.example` to `.env` then update you `.env` configs so run this commands: | ||
```bash | ||
git clone https://github.com/4xmen/xshop.git | ||
cd xshop | ||
cp .env.example .env | ||
composer install | ||
php artisan migrate:fresh --seed | ||
php artisan storage:link | ||
php artisan key:generate | ||
php artisan serv | ||
|
||
# to develop front-end | ||
npm i | ||
php artisan client | ||
npm install @rollup/rollup-win32-x64-msvc # just for windows if the below line dose not work | ||
npm run dev | ||
|
||
# or with yarn | ||
|
||
yarn install | ||
php artisan client | ||
yarn add @rollup/rollup-win32-x64-msvc # just for windows if the below line dose not work | ||
yarn dev | ||
|
||
``` | ||
|
||
> [!TIP] | ||
> Default admin email is : `[email protected]` (developer) or `[email protected]` (admin) and default password is: `password` | ||
|
||
### Deploy guide | ||
|
||
We recommend deploy xShop on VPS, so create database and run this commands: | ||
|
||
```bash | ||
cd /home/[yourUsername]/[pathOfYourWebsitePublicHTML] | ||
git clone https://github.com/4xmen/xshop.git . # if this command not work make empty this folder | ||
cp .env.example .env | ||
nano .env # edit your config db, url, etc. | ||
composer install | ||
php artisan migrate:fresh --seed | ||
php artisan storage:link | ||
php key:generate | ||
npm install | ||
php artisan client | ||
npm run build | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# Product Model | ||
|
||
The `Product` model is designed to represent items for sale within your application. It includes essential fields for describing products, managing their inventory, and associating them with multiple categories. | ||
|
||
## Fields Description | ||
|
||
### 1. `id` | ||
- **Type:** Integer | ||
- **Description:** A unique identifier for each product. This field is automatically generated and serves as the primary key for the model. | ||
|
||
### 2. `name` | ||
- **Type:** Text | ||
- **Description:** The name of the product. This title is what users will see when browsing products. | ||
|
||
### 3. `slug` | ||
- **Type:** String | ||
- **Description:** A unique URL-friendly version of the product name that can be used in web addresses. This field is indexed to improve lookup performance. | ||
|
||
### 4. `description` | ||
- **Type:** LongText (Nullable) | ||
- **Description:** A detailed description of the product. This text provides users with comprehensive information about the features and specifications. | ||
|
||
### 5. `table` | ||
- **Type:** LongText (Nullable) | ||
- **Description:** This field can be used to store tabular data about the product, such as specifications or comparisons. | ||
|
||
### 6. `excerpt` | ||
- **Type:** Text (Nullable) | ||
- **Description:** A brief summary of the product. This will appear on the product page under the product name and is useful for SEO purposes. | ||
|
||
### 7. `sku` | ||
- **Type:** String (Nullable, Unique) | ||
- **Description:** SKU refers to a Stock-keeping Unit, which is a unique identifier for each distinct product. This helps in inventory management. | ||
|
||
### 8. `virtual` | ||
- **Type:** Boolean (Nullable) | ||
- **Description:** This field indicates whether the product is a non-physical item (e.g., a service) that does not require shipping. The default value is `false`. | ||
|
||
### 9. `downloadable` | ||
- **Type:** Boolean (Nullable) | ||
- **Description:** Indicates if purchasing the product grants the customer access to a downloadable file, such as software. The default value is `false`. | ||
|
||
### 10. `price` | ||
- **Type:** Unsigned Big Integer (Nullable) | ||
- **Description:** The selling price of the product. This field is indexed to improve lookup performance. | ||
|
||
### 11. `buy_price` | ||
- **Type:** Unsigned Big Integer | ||
- **Description:** The cost price of the product, which is used to calculate the gross margin. The default value is `0`. | ||
|
||
### 12. `category_id` | ||
- **Type:** Unsigned Big Integer | ||
- **Description:** The ID of the main category to which this product belongs. | ||
|
||
### 13. `user_id` | ||
- **Type:** Unsigned Big Integer | ||
- **Description:** The ID of the user who created or owns the product. | ||
|
||
### 14. `on_sale` | ||
- **Type:** Boolean (Nullable) | ||
- **Description:** This field indicates whether the product is currently on sale. The default value is `true`. | ||
|
||
### 15. `stock_quantity` | ||
- **Type:** Unsigned Big Integer (Nullable) | ||
- **Description:** The number of items available in stock for the product. The default is `0`. | ||
|
||
### 16. `stock_status` | ||
- **Type:** Enum | ||
- **Description:** This field represents the availability status of the product and can take one of the following values: 'IN_STOCK', 'OUT_STOCK', or 'BACK_ORDER'. The default value is set to `IN_STOCK`. | ||
|
||
### 17. `rating_count` | ||
- **Type:** Unsigned Big Integer (Nullable) | ||
- **Description:** The number of ratings given to the product. The default value is `0`. | ||
|
||
### 18. `average_rating` | ||
- **Type:** Decimal (3, 2) (Unsigned, Nullable) | ||
- **Description:** The average rating of the product, calculated from the ratings received. The default is `0.00`. | ||
|
||
### 19. `status` | ||
- **Type:** Unsigned Tiny Integer | ||
- **Description:** This field indicates the current status of the product. The default value is `0`. | ||
|
||
### 20. `view` | ||
- **Type:** Unsigned Big Integer | ||
- **Description:** This field tracks the number of times the product has been viewed. The default value is `0`. | ||
|
||
### 21. `sell` | ||
- **Type:** Unsigned Big Integer | ||
- **Description:** This field tracks the total number of sales for this product. The default is `0`. | ||
|
||
### 22. `image_index` | ||
- **Type:** Unsigned Tiny Integer | ||
- **Description:** This field is used to specify which image to display for the product when there are multiple images associated. | ||
|
||
### 23. `theme` | ||
- **Type:** JSON (Nullable) | ||
- **Description:** This field allows for customization of the product’s theme. Various design settings can be stored in JSON format. This field is optional. | ||
|
||
### 24. `canonical` | ||
- **Type:** Text (Nullable) | ||
- **Description:** This field is used for SEO purposes, to indicate the canonical URL for the product to prevent duplicate content issues. | ||
|
||
### 25. `keyword` | ||
- **Type:** Text (Nullable) | ||
- **Description:** A crucial keyword for SEO purposes, aiding in the product's search visibility. It is recommended to use relevant keywords to optimize the product for search engines. | ||
|
||
## Intermediary Table: `category_product` | ||
|
||
The `category_product` table serves as a many-to-many relationship bridge between products and categories. This means that a single product can belong to multiple categories, and a single category can have multiple products associated with it. The table consists of two foreign keys: `category_id`, which references the `id` field in the `categories` table, and `product_id`, which references the `id` field in the `products` table. Both foreign keys are set to delete the associated records from this table if either the product or category is deleted, ensuring data integrity. | ||
|
||
--- | ||
By utilizing the `Product` model in conjunction with the `category_product` intermediary table, you can effectively manage and organize your products while allowing for flexibility in categorization. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# Interaction | ||
|
||
The **Interaction** category encompasses various types of user engagement within the application, including comments, tickets, questions and answers, and contact submissions. Below are the details for each interaction model. | ||
|
||
# Comments Model | ||
|
||
The `comments` model is designed to facilitate user interaction by allowing individuals to leave comments on various types of content, such as posts, galleries, or products. Each comment can also serve as a response to another comment, enabling a threaded discussion format. Comments can be submitted by registered users or visitors, with necessary fields filled accordingly. Each comment can be in different statuses to indicate its approval level. | ||
|
||
## Fields | ||
|
||
- **id**: | ||
- A unique identifier for each comment. It is automatically generated by the system. | ||
|
||
- **body**: | ||
- The main content of the comment. This is where users express their thoughts or feedback. | ||
|
||
- **name**: | ||
- The name of the individual leaving the comment. This field is optional; it can be filled in by users who are not logged into the system. | ||
|
||
- **email**: | ||
- The email address of the commenter. Similar to the name field, this is optional for users who are not registered. | ||
|
||
- **ip**: | ||
- The IP address from which the comment is made. This helps track the origin of the comment for security and analysis purposes. | ||
|
||
- **status**: | ||
- Indicates the current state of the comment: | ||
- `0`: Pending (the comment is awaiting approval). | ||
- `1`: Approved (the comment has been reviewed and is visible to others). | ||
- `-1`: Rejected (the comment was not approved and will not be displayed). | ||
|
||
- **parent_id**: | ||
- If the comment is a response to another comment, this field contains the ID of the original comment. If it is a standalone comment, this field remains empty. | ||
|
||
- **commentable_type**: | ||
- This field identifies the type of content the comment is associated with (e.g., post, product). | ||
|
||
- **commentable_id**: | ||
- This field holds the unique identifier of the related content (e.g., the specific post or product ID). | ||
|
||
- **commentator_type**: | ||
- This field indicates whether the commenter is a registered user or a guest. It helps the system understand who left the comment. | ||
|
||
- **commentator_id**: | ||
- This optional field contains the ID of the user if the commenter is registered. If the commenter is a guest, this field remains empty. | ||
|
||
--- | ||
|
||
# Tickets Model | ||
|
||
The `tickets` model is designed to help customers submit their inquiries or issues for assistance. This system allows for effective tracking and management of customer support requests, ensuring that issues are addressed in a timely manner. Each ticket can be assigned a status to indicate its resolution stage, ensuring clarity in the support process. | ||
|
||
## Fields | ||
|
||
- **id**: | ||
- A unique identifier for each ticket. This is auto-generated by the system to ensure each ticket can be easily tracked. | ||
|
||
- **title**: | ||
- A brief descriptor of the issue. It gives a quick reference point for what the ticket is about and helps the support team prioritize their responses. | ||
|
||
- **customer_id**: | ||
- The unique identifier of the customer who submitted the ticket. This links the ticket to the customer’s profile for easy reference. | ||
|
||
- **user_id**: | ||
- The ID of the support staff member assigned to this ticket (optional). This field can be left empty if no staff member has been assigned yet. | ||
|
||
- **body**: | ||
- The detailed description of the issue or question. This field allows customers to explain their situation in detail, providing the support team with all necessary information. | ||
|
||
- **status**: | ||
- Indicates the current stage of the ticket: | ||
- `PENDING`: The ticket has been submitted and is awaiting a response. | ||
- `ANSWERED`: The ticket has been responded to by the support team. | ||
- `CLOSED`: The issue has been resolved, and the ticket is now closed. | ||
|
||
- **answer**: | ||
- The response from the support team to the customer’s inquiry. This field is optional and may not be filled out until a response is provided. | ||
|
||
- **parent_id**: | ||
- Similar to comments, if this ticket is a follow-up to another ticket, this field contains the ID of the original ticket. If it's a standalone ticket, it remains empty. | ||
|
||
- **foreign keys**: | ||
- The model maintains relationships with `customers` and `users`, ensuring that each ticket is correctly linked to a customer and optionally to a support staff member. | ||
|
||
|
||
# Contact Model | ||
|
||
The `Contact` model is designed to manage inquiries and messages from users who wish to reach out through a "Contact Us" form. This model captures essential information from users, allowing the organization to respond to queries, feedback, or issues effectively. Each submission through this model is stored securely, enabling efficient tracking and follow-up. | ||
|
||
## Fields | ||
|
||
- **id**: | ||
- A unique identifier for each contact entry. This number is automatically generated by the system to ensure every message can be easily distinguished and referred to. | ||
|
||
- **name**: | ||
- The name of the person submitting the contact form. This is important for personalizing the response and addressing the user appropriately. | ||
|
||
- **email**: | ||
- The email address of the individual submitting the inquiry. This field is crucial as it allows the organization to reply directly to the user regarding their submission. | ||
|
||
- **subject**: | ||
- A brief topic or title for the inquiry. This field is optional and helps to summarize the main point of the message, making it easier for the organization to categorize and prioritize responses. | ||
|
||
- **mobile**: | ||
- The mobile phone number of the user. This field captures the user's contact number and is often requested for follow-up calls, especially if the matter requires more immediate or personal communication. | ||
|
||
- **hash**: | ||
- A unique string generated for each contact entry. This field is used internally by the system to ensure that each message can be uniquely identified, even if there are multiple messages from the same user. | ||
|
||
- **body**: | ||
- The main content of the user's message. This is where the user describes their inquiry or issue in detail, providing the necessary context for the organization to understand and address the concern. | ||
|
||
- **is_answered**: | ||
- A boolean field indicating whether the user's inquiry has been addressed. It defaults to `false`, meaning the inquiry is initially unanswered. Once a response is provided, this field will be updated to `true`, helping to track the status of each contact submission. | ||
|
||
--- | ||
|
||
This structure provides a comprehensive overview of the `Comment`, `Ticket` and `Contact` models. It explains each field clearly and is designed for understanding without technical knowledge. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Settings Model | ||
|
||
The `Settings` model is designed to manage various configurations for the system. It allows administrators to set and customize system behaviors and functionalities in a structured way. Each setting can be categorized and stored with specific attributes to facilitate easy management. | ||
|
||
## Fields | ||
|
||
- **id**: | ||
- A unique identifier for each setting entry. This number is automatically generated by the system to ensure that every setting can be distinguished from one another. | ||
|
||
- **section**: | ||
- This field categorizes settings into specific groups. Common values include `general`, `seo`, `sms`, `theme`, or any custom value defined by the user. This categorization helps simplify the management of settings. | ||
|
||
- **type**: | ||
- Defines the data type for the setting value. It could be one of the following options: | ||
- **TEXT**: Standard text input. | ||
- **NUMBER**: Numeric input. | ||
- **LONGTEXT**: For handling large amounts of text. | ||
- **CODE**: Suitable for programming code snippets. | ||
- **EDITOR**: A rich text editor for formatted text. | ||
- **CATEGORY**: For selecting specific categories. | ||
- **GROUP**: For grouping related settings. | ||
- **CHECKBOX**: A boolean option that can be either checked or unchecked. | ||
- **FILE**: For uploading files. | ||
- **COLOR**: For color selection. | ||
- **SELECT**: A dropdown menu for selecting one option. | ||
- **MENU**: For managing navigation menus. | ||
- **LOCATION**: For selecting geographic locations. | ||
- **ICON**: For selecting icons. | ||
- **DATE**: A date input. | ||
- **DATETIME**: A date and time input. | ||
- **TIME**: A time input. | ||
|
||
- **title**: | ||
- A descriptive title for the setting. This title will be displayed in the admin interface, providing clarity on what the setting controls. | ||
|
||
- **active**: | ||
- A boolean field indicating whether this setting is currently active. By default, it is set to `true`, meaning the setting is enabled. | ||
|
||
- **key**: | ||
- A unique identifier for the setting. This key must be unique and is used to retrieve or modify the setting in the system. | ||
|
||
- **value**: | ||
- This field allows for the storage of the setting's value. It can accommodate translation if needed, meaning the same setting could have different values for different languages. | ||
|
||
- **raw**: | ||
- A text field that stores the original value of the setting without any translations. This allows administrators to easily reference the underlying data. | ||
|
||
- **ltr**: | ||
- A boolean field that indicates if the layout should be left-to-right. By default, it is set to `false`. | ||
|
||
- **is_basic**: | ||
- A boolean field indicating whether this setting is a core requirement for the system. It is set to `false` by default, but essential settings should be marked as true. | ||
|
||
- **size**: | ||
- This field specifies a value from 1 to 12 to determine the width of the input field in Bootstrap layout. The default value is set to `12`, which is full-width. | ||
|
||
- **data**: | ||
- A JSON field that can store additional information related to the setting. For example, if the type is `NUMBER`, the `data` field could specify the minimum and maximum values allowed. This flexibility allows for enhanced validation and configurability. | ||
|
||
## Dynamic Field Generation | ||
|
||
When displaying settings in the system, the appropriate input fields are dynamically generated based on the type of each setting. This automation simplifies the user's experience, enabling them to easily manage settings without needing technical knowledge. You can add your own setting if you wish. When you change design of theme setting will be updated. | ||
|
||
--- | ||
|
||
This structure outlines the `Settings` model, emphasizing how it can be used to manage configurations effectively and simplify the administrative tasks associated with system settings. The document is designed to be user-friendly for non-technical users, ensuring clarity and ease of understanding. |
Oops, something went wrong.