当前位置: 首页 > 软件库 > 大数据 > 数据查询 >

product-boilerplate

授权协议 Readme
开发语言 Java
所属分类 大数据、 数据查询
软件类型 开源软件
地区 不详
投 递 者 常博裕
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Nice Boys ™️ Product Boilerplate

Quickly ship your apps with the power of code generation.

Philosophy

"Speed of developer iteration is the single most important factor in how quickly a technology company can move."

— Paul Biggar, cofounder CircleCI

Product boilerplate is @brianlovin and @mxstbr's personal setup to quickly build new apps. It aims to get all the common stuff out of the way and make shipping and subsequently iterating on a product as quick as possible.

There are three important traits in all the included tooling that we pay attention to:

  1. Mastery: We know most of these tools inside and out and have a lot of experience with them.
  2. Code generation: The less boilerplate code we need to write, the more we can focus on our app. Code generation allows us to automate the tedious parts.
  3. Type safety: Counterintuitively, having strict type safety lets you move faster because you get warnings about bugs right in your IDE without having to recompile.

Note that this is our personal boilerplate. You are more than welcome to use it (that's why it's open source), but we cannot give any support when using it. Make sure you understand the tools in it before using it!

Stack

The entire app (front- and backend) uses Next.js in serverless-mode for development, and deployment is powered by Now.

Tools

Frontend

Backend

Working with the boilerplate

Code Generation

There are three code generators at work in this boilerplate:

  • GraphQL Codegen automatically generates React components for the frontend that fetch from the API. They are fully typed too, so you know exactly what the shape of the returned data is.
  • Prisma generates a fully type-safe database client from our datamodel.
  • GraphQL Nexus (in combination with Prisma) lets us expose a production-ready GraphQL API from the database client.

Routing

All routing happens via the folder structure in the web/pages/ folder. Any route under web/pages/api will be treated as an API route, all others as React routes.

To add dynamic routing use the Next.js dynamic routes feature.

Commands

To start the app locally you have to run these two commands:

  • yarn run dev: Stars the development process for the serverless front- and backend, as well as all generation processes.
  • yarn run db: Starts the database locally (note: requires Docker to be up and running and docker-compose to be installed)

Further, you will frequently use these commands while developing and they are automatically run whenever you switch branches or pull new code to make sure your generated files are up to date:

  • yarn run db:deploy: Update your local database with changes you made to the datamodel.
  • yarn run generate: Runs all the codegeneration commands in sequence. You can also run them manually if necessary:
    • yarn run generate:db: Generate the Prisma database client for the server.
    • yarn run generate:server: Generate the schema.graphql file for the backend from the Nexus schema
    • yarn run generate:web: Generate the fetching hooks and types for the frontend from the .graphql files contained within it

These are automatically run in a pre-commit hook, so don't worry about calling them manually unless you have a reason to:

  • yarn run prettify: Prettifies the src folder with Prettier.
  • yarn run lint: Lints the src folder with ESLint.

Deployment

To deploy the database, look at the Prisma docs, e.g. their tutorial on deploying the database to AWS fargate.

Once that is up and running, to deploy the app you simply run now, that's it! We recommend enabling the Now GitHub integration for CD.

License

Licensed under the MIT License.

 相关资料
  • Product App Updated to the latest Ember v3 We are going to build a web application which could be a web-shop or a product management app. We can add products, they can belong to a category. We can man

  • 每一个flavor都是通过闭包来配置的: android { ... defaultConfig { minSdkVersion 8 versionCode 10 } productFlavors { flavor1 { packageName "com.example.flavor1"

  • 一、题目 Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest

  • Maximum Product Subarray 描述 Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarra

  • WooCommerce Product API是WooCommerce产品的类,熟悉这个类就能自由操作产品,本文介绍的函数主要来自abstract-wc-product.php,并包含一些variation product的内容。 WooCommerce Product API代码示例 代码如下,从根据ID初始化一个产品开始,有了产品实例,就可以调用产品的各种方法获取信息,或改变产品的属性。 源代

  • 问题内容: 在解释CTE的一些概念时,有人问了一个可爱的问题..我们可以找到行的乘法吗,而我们总是从新手开始集中精力。那给了我一个想法!仅使用SQL是否有可能。我还考虑了我们甚至可以支持的最大精度,因为该产品可能非常庞大。 话虽如此,我们不能编写自己的聚合函数。(可以吗?)我在想仅使用SQL就有可能。 我想到的就像是自己添加2,3次。.但是当集合很大时..由于繁琐,我无法实现。 另一个可能是和,为