Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Setup

  • Run npm install && npm install -g @shopify/cli@latest to install dependencies.
  • Create a new Public app from your Shopify Partner Dashboard.
  • Setup Partner Dashboard
    • Run npm run ngrok to generate your subdomain. Copy the <your-url> domain and add it in API_HOST_NAME in your .env file.
    • Setup URL's manually by heading over to Shopify Partner Dashboard > Apps > Your App Name > Configuration
    • In the URLs section
      • App URL: https://<your-url>
      • Allowed Redirection URL(s):
        • https://<your-url>/api/v1/shopify-auth/offline
        • https://<your-url>/api/v1/shopify-auth/online
      • Embedded in Shopify admin:
        • should be true
      • Compliance webhooks
        • Customers Data Request: https://<your-url>/api/v1/mandatory-webhook/customers/data-request
        • Customers Redact: https://<your-url>/api/v1/mandatory-webhook/customers/redact
        • Shop Redact: https://<your-url>/api/v1/mandatory-webhook/shops/redact
    • In the API access section
      • Protected customer data access:
        • Choose App functionality
  • Build your .env file in core project based on .env.example . Some envs explanation:
    • DATABASE_URL: Postgres connection URL. If you're using a locally hosted version, postgresql://<username>:<password>@localhost:5432/<dbname>
    • API_HOST_NAME: URL generated from Ngrok. It should not contain trailing slash.
  • You can choose Shopify api scopes in apps/server/src/config/shopify.config.ts
    • A list of access scopes can be found here
  • Build your shopify.app.toml file in core project based on shopify.app.toml.example
  • Prisma migrations
    • Run db:migrate:dev to run db migrations
  • Build project
    • Run build to build project.
  • Running App
    • Development Mode
      • Run npm run ngrok to create a ngrok instance if you haven't already.
      • Run npm run dev to run the server in development mode.
    • Production Mode
      • Run npm run ngrok:prod to create a ngrok instance if you haven't already.
      • Run npm run build to build both react and nest.
      • Run npm run start to run the server in development mode.
    • Install the app by heading over to https://<your-url>/api/v1/shopify-auth?shop=mystorename.myshopify.com. In dev mode, if you try and install from your partner dashboard, it'll fail since it'll use Vite instead of Express to run the server. Or just select store in Shopify Partner Dashboard.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

License

Nest is MIT licensed.