Skip to content

Commit cca0630

Browse files
authored
Merge pull request #177 from gadget-inc/move-readme-to-root-dir
Created READMEs for all current templates
2 parents 5244aad + d364635 commit cca0630

File tree

14 files changed

+354
-1
lines changed

14 files changed

+354
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AI Screenwriter
2+
3+
## Core purpose
4+
5+
This template is a great starting point to build AI applications. It comes pre-configured with an OpenAI connection, allowing you to quickly build features like automated script writing, character dialogue generation, or any other creative writing task.
6+
7+
## Key functionality
8+
9+
- **AI-powered content generation**: Leverages a built-in OpenAI connection to generate movie scripts, quotes, and other creative text based on user prompts.
10+
- **Real-time streaming**: Includes an example of how to stream AI responses directly to the frontend, providing a dynamic and interactive user experience.
11+
- **Semantic search-ready**: The `movie` model includes a vector field for `embedding`, laying the groundwork for building a semantic search feature to find similar movies based on their quotes or titles.
12+
13+
## Key features
14+
15+
- Models
16+
17+
- `movie`: Stores movie titles, quotes, and vector embeddings
18+
- User: Manages signups and user information.
19+
20+
- Global actions:
21+
22+
- `ingestData`: Fetches movie data from Hugging Face, sends it to OpenAI for embeddings, and stores the results.
23+
- `findSimilarMovies`: Uses a user-submitted quote to find similar quotes from the database and generates screenplay suggestions based on vector embeddings.
24+
25+
- Routes
26+
27+
- `POST-chat`: Streams responses from the OpenAI API to the client.
28+
29+
- Frontend
30+
31+
- `App.jsx`: Manages routing for the application's frontend.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Customized Bundles
2+
3+
## Core Purpose
4+
5+
This app enables Shopify merchants to create, manage, and sell product bundles. It allows merchants to group several individual product variants into a single, purchasable unit, offering curated packages to customers and increasing the average order value.
6+
7+
## Key Functionality
8+
9+
The app provides an admin interface for merchants to define a product variant as a "bundle" and associate other product variants as its components, each with a specified quantity. This bundle data is synchronized with Shopify using metafields. When a customer adds a bundle to their cart, a Shopify Function automatically expands the bundle into its individual component products. This ensures that inventory is tracked correctly and that fulfillment processes are seamless. The app maintains a real-time sync with the merchant's product catalog and manages all bundle logic within the Shopify ecosystem.
10+
11+
Relevant Shopify docs:
12+
13+
- [metafieldDefinitionCreate](https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/metafieldDefinitionCreate): Used 3 times to create the metafields `isBundle`, `componentReference` and `productVariantQuantities`
14+
- [cartTransformCreate](https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/cartTransformCreate): Creates the Cart Transform function on the store installing the application
15+
- [publications](https://shopify.dev/docs/api/admin-graphql/2024-07/queries/publications): Fetches a list of publications (sales channels) for the store. This is used to specifically fetch the `Online Store` sales channel
16+
- [productCreate](https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/productCreate): Used when a bundle is created to set title, price, product status and description
17+
- [productVariantUpdate](https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/productVariantUpdate): Used to set the components of the bundle and their quantities when a bundle is created or updated
18+
- [publishablePublish](https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/publishablePublish): Called on bundle creation to publish it to the `Online Store`
19+
- [productUpdate](https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/productUpdate): Used to update the title, price, status and description of the bundle
20+
- [metafieldsSet](https://shopify.dev/docs/api/customer/2024-07/mutations/metafieldsSet): Used to modify the quantities of components in the bundle
21+
22+
## Setup
23+
24+
Follow these steps to get the template working:
25+
26+
1. [Connect to Shopify](https://docs.gadget.dev/guides/tutorials/connecting-to-shopify#connecting-to-shopify) using our built-in Shopify plugin.
27+
28+
2. Sync the code locally using `ggt` ([Gadget CLI](https://docs.gadget.dev/reference/ggt#ggt-reference)) and run `yarn shopify:dev` to test the application. Make sure to install the [Shopify CLI](https://shopify.dev/docs/api/shopify-cli#installation) using these instructions.
29+
30+
3. While dev is running, press the `g` key to open the Shopify GraphiQL UI and run the following command to get your development Cart Transform function id. Add this function id to the `BUNDLER_FUNCTION_ID` environment variable of your development environment.
31+
32+
```graphql
33+
query {
34+
shopifyFunctions(first: 25) {
35+
nodes {
36+
app {
37+
title
38+
}
39+
apiType
40+
title
41+
id
42+
}
43+
}
44+
}
45+
```
46+
47+
4. In the Shopify Partner dashboard, navigate to the `Extensions` tab and turn on `Development store preview`. This will allow you to run the Shopify Function on your development store.
48+
49+
5. Install the application on a development store, create a bundle and test the function. When testing, make sure that you're always running `yarn dev`.
50+
51+
## Key features
52+
53+
- Models
54+
55+
- Bundle: Stores data about product bundles, including title, description, status, price, and components.
56+
- Actions
57+
- `create`: Used to create bundles using the Shopify API.
58+
- `update`: Used to update existing bundles using the Shopify API.
59+
- BundleComponent: Manages the relationship between bundles and product variants, including the quantity of each variant.
60+
- ShopifyShop: Stores shop data related to the Shopify store's configuration.
61+
- Actions
62+
- `install`: Sets up metafield definitions, the cart transformation function, and retrieves information about the shop's sales channels.
63+
64+
- Frontend
65+
66+
- `_app._index`: Displays a list of created bundles, expandable to show their components and quantities.
67+
- `_app.bundle.($id)`: Manages both the creation and update of bundles.
68+
69+
- Global Actions
70+
71+
- `createBundleInShopify`: Handles all Shopify API mutations necessary to create a new product, update its variant, and set bundle metafields.
72+
- `updateBundleInShopify`: Updates the bundle product, its variant, and relevant metafields based on input data.
73+
- `updateBundleComponentQuantity`: Sets the quantity value in the `productVariantQuantities` metafield.
85.8 KB
Loading
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Product quiz
2+
3+
## Core purpose
4+
5+
The application enables store owners to build custom quizzes through the Shopify admin interface. Each quiz consists of multiple questions with various answer options, and merchants can associate specific product recommendations with different answer combinations. When customers take a quiz, their responses are analyzed to generate personalized product suggestions, creating a more engaging and guided shopping experience.
6+
7+
The app includes both an admin interface for merchants to manage their quizzes (create, edit, and configure product mappings) and a customer-facing quiz interface that can be embedded directly into Shopify storefronts via a theme extension. Customer quiz results and product suggestions are tracked, allowing merchants to analyze engagement and optimize their product recommendations over time.
8+
9+
## Setup
10+
11+
The following is a guide to get you started with the product quiz. If you get lost, try following the [full tutorial](https://docs.gadget.dev/guides/tutorials/product-recommendation-quiz-app).
12+
13+
1. [Connect to Shopify](https://docs.gadget.dev/guides/tutorials/connecting-to-shopify#connecting-to-shopify) using our built-in Shopify plugin.
14+
15+
2. Make sure that you have the [Shopify CLI](https://shopify.dev/docs/api/shopify-cli#installation) installed locally.
16+
17+
3. Find the application slug and the environment slug. You'll need them for step 4.
18+
19+
![Photo showing where to find the app and env slug in Gadget UI](./.template/docs/assets/env-app-slug.png)
20+
21+
4. Create a shopify app proxy that has proxy URL matching `https://<application-slug>--<env-slug>.gadget.app/proxy`. Note the subpath used in the theme app extension's JS file. For more information on Shopify app proxies, read the [Shopify docs](https://shopify.dev/docs/apps/build/online-store/display-dynamic-data)
22+
23+
## Setting up liquid files (Online store 1.0)
24+
25+
For themes using Online Store 1.0, instructions are included in the **Install** tab of the admin app. You need to manually copy-paste code files included in the app into the theme.
26+
27+
## Setting up App Theme Extension (Online store 2.0)
28+
29+
In order to set up a theme app extension for stores using a new Online Store 2.0 theme:
30+
31+
- Update `extensions/quiz/blocks/quiz-page.liquid` by replacing the src on line 7 with your script tag
32+
- Run `yarn dev` in the project root to start the development environment (Shopify CLI)
33+
- Follow Shopify's prompts to connect to your existing Partners app and store
34+
35+
## Key features
36+
37+
- Models
38+
39+
- Quiz: Framework for creating and storing quizzes.
40+
- Fields
41+
- `slug`: The slug that will be used to determine which quiz to show the customer
42+
- `title`: The title of the product quiz
43+
- `results`: A hasMany relationship to the results of this quiz
44+
- `questions`: The questions on the quiz
45+
- Question: Individual questions included in a quiz.
46+
- Fields
47+
- `text`: The body of the question
48+
- `quiz`: The quiz that the question belongs to
49+
- `answers`: The answers associated to the question
50+
- Answer: Possible answers for a quiz question.
51+
- Fields
52+
- `text`: The body of the answer
53+
- `question`: The question that the answer belongs to
54+
- `recommendedProduct`: The product that is recommended for this answer
55+
- RecommendedProduct: A Shopify product recommended to shoppers based on their quiz answers.
56+
- Fields
57+
- `productSuggestion`: The suggested product
58+
- `answer`: The answer that the recommendation belongs to
59+
- QuizResult: Captures the shopper's email and the products recommended to them based on their quiz answers.
60+
- Fields
61+
- `email`: The email of the customer that filled out the form
62+
- `shopperSuggestion`: The product that was recommended to the customer
63+
- `quiz`: The quiz that the result record belongs to
64+
- ShopperSuggestion: Handles the has-many-through relationship between quizResult and shopifyProduct.
65+
- Fields
66+
- `product`: The product that the suggestion belongs to
67+
- `quizResult`: The quiz result record that the product belongs to
68+
- ShopifyTheme: Tracks whether a theme is using Shopify's Online Store 2.0.
69+
- Fields
70+
- `usingOnlineStore2`: Boolean field signifying if the store is using a Shopify 2.0 theme
71+
72+
- Frontend
73+
74+
- `App.jsx`: Handles routing for the frontend pages.
75+
- `HomePage.jsx`: Main page for the Shopify admin app.
76+
- `CreateQuizPage.jsx`: Contains the form for creating new quizzes.
77+
- `EditQuizPage.jsx`: Contains the form for editing existing quizzes.
78+
- `QuizForm.jsx`: Entry point for the form used to create and edit quizzes.
79+
- `InstallTab.jsx`: Provides installation instructions for adding the quiz to the storefront.
80+
- `Store1Instructions.jsx`: Manual instructions for themes built on Online Store 1.0.
81+
82+
- Actions
83+
84+
- `quiz/create`: Generates an ID/slug when a quiz is created (e.g., "My Cool Quiz" becomes "my-cool-quiz").
85+
- `quiz/delete`: Cascading delete that removes a quiz along with its questions, answers, and recommended products.
86+
- `shopifyAsset/create`: Detects whether the shop is using Shopify Storefront 1.0 or 2.0.
87+
- `shopifyAsset/update`: Updates to detect the shop’s storefront version.
88+
89+
- Access Controls
90+
91+
- `unauthenticated`: Quizzes can be viewed by anyone who visits the shop, regardless of whether they are logged in.
92+
- `shopify-app-users`: Merchants can only read themes from their store.
85.8 KB
Loading

shopify/product-reviews-public-remix-ssr/.template/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
3. Run the `shopify app dev` command in the Gadget terminal
88

9-
4. Embed your theme app extension on the product page of your devalopment store
9+
4. Embed your theme app extension on the product page of your development store
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Product Reviews
2+
3+
## Core purpose
4+
5+
This app enables Shopify merchants to collect, manage, and display customer reviews for their products. It provides an automated review collection system that requests feedback from customers after purchase, along with a comprehensive admin interface for review moderation and a storefront display system.
6+
7+
## Key functionality
8+
9+
The app automatically sends review request emails to customers based on configurable timing after order fulfillment. Customers can submit reviews through a secure, code-based system that doesn't require account creation. Merchants can approve or reject reviews through the admin interface, and approved reviews are displayed on product pages via a theme extension. The system syncs review data with Shopify using metafields, maintaining review summaries and ratings directly in the merchant's product catalog for seamless integration with their storefront.
10+
11+
## Setup
12+
13+
1. [Connect to Shopify](https://docs.gadget.dev/guides/tutorials/connecting-to-shopify#connecting-to-shopify) using our built-in Shopify plugin
14+
15+
2. Find the application slug and the environment slug. You'll need them for step 3.
16+
17+
![Photo showing where to find the app and env slug in Gadget UI](./.template/docs/assets/env-app-slug.png)
18+
19+
3. Create a shopify app proxy that has proxy URL matching `https://<application-slug>--<env-slug>.gadget.app/proxy`. Note the subpath used in the theme app extension's JS file. For more information on Shopify app proxies, read the [Shopify docs](https://shopify.dev/docs/apps/build/online-store/display-dynamic-data)
20+
21+
4. Run the `shopify app dev` command in the Gadget terminal
22+
23+
5. Embed your theme app extension on the product page of your development store
24+
25+
## Key features
26+
27+
- Models
28+
29+
- `review`: Stores review data including the rating, content, and approval status, and links to the corresponding product, customer, and order.
30+
- `shopifyShop`: Extended with settings for review requests, like `daysUntilReviewRequest`.
31+
- `shopifyOrder`: Extended to manage when review requests are sent.
32+
33+
- Frontend
34+
35+
- `web/routes/_app._index.tsx`: The main dashboard for merchants to view and manage product reviews.
36+
- `web/rotues/_public.review.($code).tsx`: A public page where customers can submit a review for their purchase.
37+
- `extensions/product-reviews/blocks/productReviews.liquid`: A theme extension block to display approved reviews on product pages.
38+
39+
- Actions
40+
41+
- `review/create, update, delete`: Allow for the management and approval of reviews.
42+
- `sendReviewRequests`: A scheduled action to email customers asking for a review after their purchase.
43+
- `createReviewMetaobject` & `updateReviewsMetafield`: Actions to store review data as Shopify metaobjects and metafields, making them accessible on the storefront.
64.9 KB
Loading
44.3 KB
Loading
64.6 KB
Loading

0 commit comments

Comments
 (0)