Giter Site home page Giter Site logo

crystallizeapi / boilerplates Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 1.0 40.16 MB

Mono Repository with all the boilerplates

License: MIT License

Dockerfile 0.01% TypeScript 91.39% CSS 0.42% JavaScript 6.52% Shell 0.04% Vue 0.76% Makefile 0.02% Java 0.04% Ruby 0.02% Objective-C 0.03% Dart 0.04% Starlark 0.01% MDX 0.06% Astro 0.03% HTML 0.01% Svelte 0.63%
boilerplate gatsby nextjs nuxtjs remix-run

boilerplates's People

Contributors

alexluong avatar cymkd avatar danisal avatar dependabot[bot] avatar devictoribero avatar dhairyadwivedi avatar didrikhegna avatar hakonkrogh avatar iamnottheway avatar jackyef avatar jessetinell avatar jezpoz avatar juicycleff avatar meetdave3 avatar nerdenough avatar nervetattoo avatar oliviel avatar otaviojava avatar papelipe avatar plopix avatar ruheni avatar stasotiro avatar stavrossnowball avatar tommysorensen avatar usulpro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mountmike

boilerplates's Issues

_frontpage-2021 not displaying at the home page in NextJS boilerplate

Component(s) affected: Next.js Boilerplate - Complete ecommerce

Description
The _frontpage-2021 folder contents are not displaying in the root page.

How to reproduce

  • Create a new empty tenant.
  • Install the local service API with npx @crystallize/cli my-api-project and selecting:
    • Vercel platform
    • own tenant
    • no dummy data
  • Install the Next.js Boilerplate with npx @crystallize/cli my-project, selecting:

Run yarn dev on both projects and navigate to localhost:3000. An empty page with no content is shown (only the menus, shop logo and footer).

Although selecting always that I am using my own tenant, the new empty tenant is polluted with a catalog, with "Shop", "Stories" and "About" folders, together with "_frontpage-2021" and "_assets". The "_frontpage-2021" has a title "Retail eCommerce demo powered by Crystallize" but this title doesn't show in the home page of my running site. If I write more content in the "_frontpage-2021" as explained in the videos it is not displaying.

I repeated the process many times so I am sure that I didn't accidentally selected to use the FRNTR data, so that is not why my catalog is full of pages that I didn't create.

Possible Solution
I couldn't find any reference in the frontend code to "_frontpage-2021", but only to "frontpage-2021" without the leading underscore. I tried renaming the catalog folder just in case it had been renamed in the code and not updated in the videos, but it didn't fix the issue.

Additional context

Site home page:

frontend_site

Catalog folders (polluted by some script, I never created them):

catalog

Service API boilerplate does not work with AWS out-of-the-box

Component(s) affected: component 1,component N, etc.
Service API boilerplate, AWS version.

Description
The project runs fine, starts up as it should and you get to see the GraphQL playground. However, the introspection query fails, and you are not able to run any queries.

How to reproduce

  1. npx @crystallize/cli
  2. Choose Service API boilerplate
  3. Choose AWS
  4. Tenant identifier/bootstrapping does not matter here
  5. Run the project, open http://localhost:3001/dev/graphql

Possible Solution

Additional context

A bunch of introspection queries are fired:

Screenshot 2022-06-28 at 12 04 44

Cannot create an order because of the cors - 2

Component(s) affected: CORS, GraphQL MUTATION, CRYSTALLIZE API
Description

Here is a code (just an index.html) that should make a simple request (GraphQL Mutation) to the Crystallize API just by clicking on a button. I removed all the abstractions and modules that could be due to a framework. So the problem is Crystallize. Despite the fact that we have the right creantials, Crystallize does not handle mutations from GraphQL.

IMPORTANT: Please change the access point to the API and the creantials

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>test</title>
  </head>
  <body>
    <button id="btn">Place Order</button>
    <div id="result"></div>
    <script>
      let btn = document.getElementById("btn");
      let result = document.getElementById("result");

      const query = `mutation createOrder {
          orders {
              create(
                  input: {
                      customer: {
                          firstName: "Crystal"
                          lastName: "Ecommerce"
                          identifier: "cus_0001"
                          addresses: [
                              {
                                  type: billing
                                  street: "Kverndalsgata"
                                  streetNumber: "8"
                                  city: "Skien"
                                  country: "Norway"
                                  postalCode: "1234"
                              }
                              {
                                  type: delivery
                                  street: "Kverndalsgata"
                                  streetNumber: "8"
                                  city: "Skien"
                                  country: "Norway"
                                  postalCode: "1234"
                              }
                          ]
                      }
                      cart: {
                          name: "Calathea"
                          sku: "maranta-leuconeura-1611849929203"
                          quantity: 1
                          price: {
                              currency: "EUR"
                              tax: { name: "No Tax", percent: 0 }
                              net: 23
                              gross: 23
                          }
                      }
                      payment: [
                          {
                              provider: stripe
                              stripe: {
                                  orderId: "ord_0001"
                                  customerId: "cus_0001"
                                  paymentMethod: "card"
                                  paymentIntentId: "pi_0001"
                                  metadata: null
                              }
                          }
                      ]
                      total: { gross: 23, net: 23, currency: "EUR" }
                  }
              ) {
                  id
              }
          }
      }`;

      const operationName = 'createOrder'
      const variables = {}
      btn.addEventListener("click", async () => {
        const data = await fetch("https://api.crystallize.com/e-commerce-test/orders", {
            method: "POST",
            headers: {
              "Content-Type": "application/json",
              "X-Crystallize-Access-Token-Id": "******************",
              "X-Crystallize-Access-Token-Secret": "******************",
              // "X-Crystallize-Static-Auth-Token": "******************"
            },
            body: JSON.stringify({ query, variables, operationName }),
        }).then((res) => res.json()).catch((e) => e)

        result.innerHTML = data ? JSON.stringify(data) : "No data";
      });
    </script>
  </body>
</html>

BUT ?

Capture d’écran 2022-12-08 à 12 34 53

i dont know what i have to do nowI don't know what I should do anymore ... 🥹

Cannot create an order because of the cors

Component(s) affected: CORS, GRAPHQL MUTATION

Description
When I execute queries to retrieve information from the GraphQL API everything works fine. But when I have to execute Mutations there is a CORS error. According to what I read it should indeed be configured on the server side. I use Nuxtjs + Nuxt GraphQL Client and here is my configuration:

How to reproduce
nuxt.config.js
nuxt-config

order request
request

mutation
mutation

request header
cors Error

console log
cors test

Possible Solution
I think that the servers could be configured to accept requests that could come from Localhost. I've already encountered this problem several times when I develop with my own backend locally and I always had to configure the server correctly.

Additional context

If you want to take a closer look at the code, you can find it in this repo: https://github.com/michael-mb/E-Com-Crystallize

The .env is naturally ignored

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.